xmonadã®è¨å®
ã»ã¼æå³ãããããªãã¾ã¾åè¦å «è¦ãã¦ããªãã¨ã使ããããæãã«ãªã£ããã©ãã¡ã¢ãã¨ããªãã¨çµ¶å¯¾ã«åç¾ã§ããªãã®ã§èªåç¨ã«ã¡ã¢ã
ã¾ãã¯ã¤ã³ã¹ãã¼ã«
sudo apt-get install xmonad xmobar
xmobarã¯ãªããã¹ãã¼ã¿ã¹ãã¼ã¿ãããªãã¤ãããã©ã«ãã ã¨ã¦ã£ã³ãã¦ä»¥å¤ã¯è¡¨ç¤ºãããªããã©ã¨ããããæè¨ã ãã§ã表示ããã¦æ¬²ããã®ã§å°å ¥ã
ããã§ããã¼ã ãã©ã«ãä¸ã®.xmonadãã©ã«ãã®xmonad.hsã«è¨å®ãæ¸ãã¦ããããã ãã©ãããããªãã®ã§ã¨ããããm2ymããã®xmonad.hsãããã ãã
https://gist.github.com/769071
ããããããªãé¨åãå¤ããã©ã¨ãããã
modm = mod4Mask
ã¯superãã¼ã修飾ã«ä½¿ãçãªãã¨ã§ã
borderWidth = 2 , normalBorderColor = "#99ccff" , focusedBorderColor = "#0033dd"
ãã®è¾ºã¯ã¦ã£ã³ãã¦å¢çã®ç·ã®å¤ªãã¨ãããã¨ãã
`additionalKeys` [ ((modm, xK_f), sendMessage (Toggle FULL)) , ((modm, xK_g), sendMessage ToggleGaps) , ((modm, xK_j), sendMessage MirrorShrink) , ((modm, xK_k), sendMessage MirrorExpand) , ((modm, xK_period), windows W.focusDown) , ((modm, xK_comma), windows W.focusUp) , ((modm .|. shiftMask, xK_period), windows W.swapDown) , ((modm .|. shiftMask, xK_comma), windows W.swapUp) , ((modm, xK_w), nextScreen) ]
ã¯ä¸ããã
ç¾å¨ã®ã¦ã£ã³ãã¦ã®ãã«ã¹ã¯ãªã¼ã³åãããæ»ãããã®ãã°ã«ã
ã¹ãã¼ã¿ã¹ãã¼ãåºãããæ¶ãããã
ã¦ã£ã³ãã¦ã®ä¸ä¸ã®å¢çãä¸ã«ã
ã¦ã£ã³ãã¦ã®ä¸ä¸ã®å¢çãä¸ã«ã
ãã©ã¼ã«ã¹ãåã®ã¦ã£ã³ãã¦ã«ã
ãã©ã¼ã«ã¹ã次ã®ã¦ã£ã³ãã¦ã«ã
ç¾å¨ã®ã¦ã£ã³ãã¦ãåã®ã¦ã£ã³ãã¦ã®ä½ç½®ã¨å
¥ãæ¿ãã
ç¾å¨ã®ã¦ã£ã³ãã¦ã次ã®ã¦ã£ã³ãã¦ã®ä½ç½®ã¨å
¥ãæ¿ãã
ï¼ï¼ï¼
ã¨ãã£ãæãã
wãæ¼ããã¨ãã«ä½ãããã¦ãã®ãããããªãã£ãã
`additionalKeys` [ ((modm, xK_a), runOrRaise "emacs" (className =? "Emacs")) , ((modm, xK_s), runOrRaise "gnome-terminal" (className =? "Gnome-terminal")) , ((modm, xK_d), runOrRaise "firefox" (className =? "Namoroka")) ]
ãã®è¾ºã¯ããããEmacsãèµ·åãã¦ãªãã£ããèµ·åãèµ·åãã¦ããããã«ãã©ã¼ã«ã¹ã
ã¿ãããªãã¤ã
m2ymããã¯ç«¯æ«ã¯urxvt, ãã©ã¦ã¶ã¯Chromeãã¤ãã£ã¦ãã¿ããã§ãããåã¯gnome-terminalã¨firefoxãªã®ã§ãããªæãã«ãªã£ã¦ã¾ããï¼ãã¤ã®éã«ãfirefoxãNamorokaã£ã¦ååã«ãªã£ã¡ãã£ã¦ããã ãã©ããã¯ãªããªãã ãï¼ï¼
classNameã®èª¿ã¹æ¹ã¯ã
http://watermans-linuxtips.blogspot.com/2009/02/window.html
ã«ããããã«
$ xprop | grep WM_CLASS
ã§èª¿ã¹ããã¾ãã
xmonadãã¤ã³ã¹ãã¼ã«ããæç¹ã§ãã°ã¤ã³ç»é¢ã®ã»ãã·ã§ã³ã®é¸æã®ã¨ãã«xmonadãã§ãã®ã§ãããé¸ã¶ã¨xmonadãèµ·åã§ããããã«ãªãã®ã§ããããã®ã¾ã¾ã ã¨ã¡ãã£ã¨ãã¾ã£ããã¨ã«ãªãã¾ãã
gnomeããã£ã¦ããã¦ããã¨(é³é調ç¯ãã¿ã³ã¨ã)ãããããå¹ããªããªã£ã¡ããã®ã§ãããããã¡ããã¨ã¤ãããããã«ãã¾ãã
ããã¯ã~/.xsessionã£ã¦ãã¡ã¤ã«ã«æ¸ãããã§ããã¾ãã
ç¾æç¹ã§ã®åã®.xsessionã¯
#!/bin/sh xmodmap $HOME/.Xmodmap $HOME/.dropbox-dist/dropboxd & gnome-volume-control-applet & stalonetray -i 1 --geometry 6x1-0-0 -bg white & gnome-settings-daemon & xcompmgr & exec xmonad
ãããªæãã§ãã
xmodmapã¯å¤æãã¼ãAltã«ãç¡å¤æãã¼ãSuperã«ãã¦ã¾ãã
ãã§ãdropboxãã¤ããã®ã§ãèµ·åããã¦ãã¾ãã
ãã®æ¬¡ã¯ããªã¥ã¼ã ã³ã³ããã¼ã«ç¨ã®ã¢ããªã±ã¼ã·ã§ã³ã®èµ·åã
ãã®æ¬¡ã¯gnomeã ã¨å³ä¸ãã¸ãã«ããã·ã¹ãã ãã¬ã¤ãxmonadã«ã¯ãªãã®ã§ãã®ä»£ããã«ãªããã¤ã§ãã
ããã¯
sudo apt-get install stalonetray
ãã¨ãã¦ãã ããã
次ã®gnome-settings-daemonã¯ããã¨ãã¨ã¼ãã¯ctrlã¨capsã®å ¥ãæ¿ããgnomeã®è¨å®ã®æ¹ã§ãã£ã¦ãã®ã§ããã®è¨å®ãé©ç¨ãã¦ããããã¤ã£ã½ãã§ãã
xcompmgrã¯emacsã¨ãã®åéæãæå¹ã«ãã¦ããããã¤ã§ãã
ã¿ã¤ã«åWMãªã®ã§åéæã«ãã¦ãèæ¯ããè¦ããªãã®ã§ããã¾ãæå³ãªãã®ã§ããæ°æã¡çãªåé¡ã§ãããä»ã足ãã¦ã¾ãã
æå¾ã«ãxmobarã®è¨å®ã§ãã
ãã®è¨å®ã¯ã~/.xmobarrcãã¡ã¤ã«ã«æ¸ãã¦ãããã¨ã«ãªãã®ã§ãããããã£ã¦è¦ãéã大ä½ã¿ããªåããããªè¨å®ããã¦ãããããªã®ã§ãã©ãã§ãé©å½ã«ããã£ã¦ãã¦ã³ãããããããã¨æãã¾ãã
ããã¦ã
main = xmonad $ defaultConfig ...
ã£ã¦ãªã£ã¦ãã¨ãã
main = do xmproc <- spawnPipe "xmobar" xmonad $ defaultConfig ...
ã«ãã¦ã
æåã®æ¹ã«ã
import XMonad.Util.Run(spawnPipe)
ã足ãã¨ãã¦ãã ããã
ãã ãã²ã¨ã¤åãã¯ã¾ã£ãã®ããç¾å¨ã®ã¯ã¼ã¯ã¹ãã¼ã¹ã¨ãã©ã¼ã«ã¹ã®ããã¦ã£ã³ãã¦ã®ã¿ã¤ãã«ã表示ãããæ¹æ³ã§ãStdinReaderã£ã¦ãã¤ãããã£ã¦ã®ã¯ããããã£ãã®ã§ããã表示ããããã¨ããã¨Updating...ã¨ã ã表示ããã¦ãã¾ãããã¾ããã§ããã
ããã¹ã¦ã¿ããããªããlogHookã¨ãããã®ãããããªãããããªãã¿ããã§ãã
http://web.archiveorange.com/archive/v/j8BnASHPs7ocYRzEB2yM
ã¨ãããã¨ã§ãä¸è¨ãµã¤ãã«ããéãã
myLogHook dest = dynamicLogWithPP defaultPP { ppOutput = hPutStrLn dest ,ppVisible = wrap "(" ")" } xmonad $ defaultConfig { ... , logHook = myLogHook xmproc }
ã¨å¤æ´ãã¦ããã¾ãã
ããã«ã
import XMonad.Hooks.DynamicLog import XMonad.Util.Run
ã追å ãã¦ããã¦ãã ããã
ãã¨ãããããããã
sudo apt-get install i3status
ãããããããã¾ãããããããªãããããã¾ããã
ã¾ã¨ã
xmonad.hs
import qualified Data.Map as M import XMonad import qualified XMonad.StackSet as W import XMonad.Actions.WindowGo import XMonad.Actions.CycleWS import XMonad.Hooks.ManageDocks import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.DynamicLog import XMonad.Layout import XMonad.Layout.Gaps import XMonad.Layout.ResizableTile import XMonad.Layout.NoBorders import XMonad.Layout.MultiToggle import XMonad.Layout.MultiToggle.Instances import XMonad.Util.EZConfig import XMonad.Util.Run(spawnPipe) import XMonad.Util.Run tall = ResizableTall 1 (3/100) (1/2) [] layout = smartBorders $ mkToggle1 FULL $ gaps [(U,24)] $ tall ||| Mirror tall works = map show [1..9] modm = mod4Mask myLogHook dest = dynamicLogWithPP defaultPP { ppOutput = hPutStrLn dest , ppVisible = wrap "(" ")" } main = do xmproc <- spawnPipe "xmobar" xmonad $ defaultConfig { borderWidth = 2 , terminal = "gnome-terminal" , normalBorderColor = "#99ccff" , focusedBorderColor = "#0033dd" , layoutHook = layout , manageHook = manageDocks <+> composeAll [ className =? "MPlayer" --> doFloat, className =? "Gimp" --> doFloat, title =? "Speedbar" --> doFloat, title =? "Adobe Reader" --> doFloat] , logHook = myLogHook xmproc , workspaces = works , modMask = modm } `additionalKeys` [ ((modm, xK_f), sendMessage (Toggle FULL)) , ((modm, xK_g), sendMessage ToggleGaps) , ((modm, xK_j), sendMessage MirrorShrink) , ((modm, xK_k), sendMessage MirrorExpand) , ((modm, xK_period), windows W.focusDown) , ((modm, xK_comma), windows W.focusUp) , ((modm .|. shiftMask, xK_period), windows W.swapDown) , ((modm .|. shiftMask, xK_comma), windows W.swapUp) , ((modm, xK_w), nextScreen) ] `additionalKeys` [ ((modm .|. m, k), windows $ f i) | (i, k) <- zip works [ xK_exclam, xK_at, xK_numbersign , xK_dollar, xK_percent, xK_asciicircum , xK_ampersand, xK_asterisk, xK_parenleft , xK_parenright ] , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)] ] `additionalKeys` [ ((modm, xK_a), runOrRaise "emacs" (className =? "Emacs")) , ((modm, xK_s), runOrRaise "gnome-terminal" (className =? "Gnome-terminal")) , ((modm, xK_d), runOrRaise "firefox" (className =? "Namoroka")) ]
.xmobarrc
Config { font = "xft:Sans-9:bold" , bgColor = "black" , fgColor = "grey" , position = Top , lowerOnStart = False , commands = [ Run Weather "EGPF" ["-t","<station>: <tempC>C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000 , Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10 , Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10 , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10 , Run Memory ["-t","Mem: <usedratio>%"] 10 , Run Swap [] 10 , Run Com "uname" ["-s","-r"] "" 36000 , Run Date "%a %b %_d %Y %H:%M:%S" "date" 10 , Run StdinReader ] , sepChar = "%" , alignSep = "}{" , template = "%cpu% | %memory% * %swap% | %eth0% - %eth1% } %StdinReader% { <fc=#ee9a00>%date%</fc>| %EGPF% | %uname%" }
.xsession
#!/bin/sh xmodmap $HOME/.Xmodmap $HOME/.dropbox-dist/dropboxd & gnome-volume-control-applet & stalonetray -i 1 --geometry 6x1-0-0 -bg white & gnome-settings-daemon & xcompmgr & exec xmonad