L2 Cache

Behold the power of |!

User Tools

Site Tools


configuration:xmonad

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
configuration:xmonad [2012/09/03 08:28]
sjorge [~/.xmonad/apps]
configuration:xmonad [2014/10/09 22:02] (current)
Line 12: Line 12:
   * XMonad Contrib   * XMonad Contrib
   * Trayer   * Trayer
 +  * dmenu
   * dzen2   * dzen2
   * conky   * conky
Line 25: Line 26:
 | ~/​.xmonad/​.conky_dzen ​            | conky configuration for use with dzen             | | ~/​.xmonad/​.conky_dzen ​            | conky configuration for use with dzen             |
 | ~/​.xmonad/​dzen2/​* ​                | pixmap images used in my status bar               | | ~/​.xmonad/​dzen2/​* ​                | pixmap images used in my status bar               |
 +| ~/​.xmonad/​bin/​* ​                  | helper scripts and binries ​                       |
 | /​usr/​local/​bin/​xmonad-cdm-wrapper | wrapper for xmobad for use with cdm, tigervnc,​... | | /​usr/​local/​bin/​xmonad-cdm-wrapper | wrapper for xmobad for use with cdm, tigervnc,​... |
- 
 ==== ~/​.xmonad/​xmonad.hs ==== ==== ~/​.xmonad/​xmonad.hs ====
 <​code>​ <​code>​
Line 37: Line 38:
 -- actions -- actions
 import XMonad.Actions.CycleWS import XMonad.Actions.CycleWS
 +import XMonad.Actions.PerWorkspaceKeys
  
 -- hooks -- hooks
Line 66: Line 68:
     dzenLeftBar <- spawnPipe myXmonadBar     dzenLeftBar <- spawnPipe myXmonadBar
     dzenRightBar <- spawnPipe myStatusBar     dzenRightBar <- spawnPipe myStatusBar
-    trayerRightBar <- spawnPipe myTrayBar 
     xmonad $ ewmh defaultConfig {      xmonad $ ewmh defaultConfig { 
           terminal ​           = myTerminal           terminal ​           = myTerminal
Line 78: Line 79:
         , focusedBorderColor ​ = colorFocusedBorder         , focusedBorderColor ​ = colorFocusedBorder
         , borderWidth ​        = withPixelSize         , borderWidth ​        = withPixelSize
 +  , startupHook  ​     = myStartup
     }     }
 +--}}}
 +
 +-- {{{ startup
 +myStartup :: X ()
 +myStartup = do
 +          spawn "​syndaemon -i 1 -t -d" -- synaptics timeout
 +          spawn "​trayer --edge top --align right --widthtype pixel --heighttype pixel --expand true --align right --SetDockType true --SetPartialStrut true --tint 0x000000 --transparent true --alpha 0 --margin 75 --height 8 --width 238"
 +          spawn "​xfce4-power-manager"​
 +          spawn "sleep 2; volti"
 +          spawn "sleep 2; wicd-gtk --tray"​
 +
 --}}} --}}}
  
Line 95: Line 108:
  
 -- workspaces -- workspaces
-myWorkspaces ​   = ["​1:​main","​2:​general","​3:​classic","​4:​web","​5:​irc"​]+myWorkspaces ​   = ["​1:​main","​2:​general","​3:​classic","​4:​vbox","​5:​web","​6:irc"]
  
 --}}} --}}}
Line 101: Line 114:
 -- {{{ keys -- {{{ keys
 keys' conf@(XConfig {XMonad.modMask = modMask}) = M.fromList [ keys' conf@(XConfig {XMonad.modMask = modMask}) = M.fromList [
-     ​((modMask, ​                    ​xK_p        ), spawn "​exe=`dmenu_run -nb black -sb black -nf \"#​555753\"​ -sf \"#​8AE234\"​` && eval \"exec $exe\""​)+     ​((modMask,​     ​xK_p ), bindOn [("​3:​classic",​ spawn "/​home/​sjorge/​.xmonad/​bin/​xmonad-xephyr-run"​),​ ("​4:​vbox",​ spawn "/​home/​sjorge/​.xmonad/​bin/​xmonad-windows-run"​),​ (""​, spawn "​exe=`dmenu_run -nb black -sb black -nf \"#​555753\"​ -sf \"#​8AE234\"​` && eval \"exec $exe\""​)])
     , ((modMask .|. shiftMask, ​     xK_Return ​  ), spawn $ XMonad.terminal conf)     , ((modMask .|. shiftMask, ​     xK_Return ​  ), spawn $ XMonad.terminal conf)
     , ((modMask, ​                   xK_F2       ), spawn "​gmrun"​)     , ((modMask, ​                   xK_F2       ), spawn "​gmrun"​)
     , ((modMask .|. shiftMask, ​     xK_c        ), kill)     , ((modMask .|. shiftMask, ​     xK_c        ), kill)
-    , ((modMask .|. shiftMask, ​     xK_l        ), spawn "slock")+    , ((modMask .|. shiftMask, ​     xK_l        ), spawn "xlock")
  
     -- Programs     -- Programs
Line 134: Line 147:
     -- quit, or restart     -- quit, or restart
     , ((modMask .|. shiftMask, ​     xK_q        ), io (exitWith ExitSuccess))     , ((modMask .|. shiftMask, ​     xK_q        ), io (exitWith ExitSuccess))
-    , ((modMask, ​                   xK_q        ), spawn "​killall conky dzen2 trayer ​&& ​xmonad --recompile && xmonad --restart"​)+    , ((modMask, ​                   xK_q        ), spawn "​killall conky dzen2 trayer ​syndaemon ; wicd-tray-kill ; xmonad --recompile && xmonad --restart"​)
  ]  ]
 --}}} --}}}
Line 141: Line 154:
 myBitmapsDir = "/​home/​sjorge/​.xmonad/​dzen2"​ myBitmapsDir = "/​home/​sjorge/​.xmonad/​dzen2"​
  
--- dzen2 +-- dzen2 1366 - 1024 = 342 
-myXmonadBar = "dzen2 -w 712 -h 16 -ta '​l'​ -fg '#​555753'​ -bg '#​000000'​ -fn '​Terminus-8'"​+myXmonadBar = "dzen2 -w 1054 -h 16 -ta '​l'​ -fg '#​555753'​ -bg '#​000000'​ -fn '​Terminus-8'"​
 myLogHook :: Handle -> X () myLogHook :: Handle -> X ()
 myLogHook h = dynamicLogWithPP $ defaultPP myLogHook h = dynamicLogWithPP $ defaultPP
Line 167: Line 180:
  
 -- conky -- conky
-myStatusBar = "conky -c /​home/​sjorge/​.xmonad/​.conky_dzen ​| dzen2 -x 712 -w 312 -h 16 -ta '​r'​ -fg '#​555753'​ -bg '#​000000'​ -fn '​Terminus-8'​+myStatusBar = "conky -c /​home/​sjorge/​.xmonad/​.conky_dzen_clock ​| dzen2 -x 1291 -w 75 -h 16 -ta '​r'​ -fg '#​555753'​ -bg '#​000000'​ -fn '​Terminus-8'"​
- +
--- trayer +
-myTrayBar = "​trayer --edge top --align right --widthtype pixel --heighttype pixel --expand true --align right --SetDockType true --SetPartialStrut true --tint 0x000000 --transparent true --alpha 0 --margin 74 --height 8 --width 238"+
  
 --}}} --}}}
Line 178: Line 188:
 manageHook'​ :: ManageHook manageHook'​ :: ManageHook
 manageHook'​ = (composeAll . concat $ manageHook'​ = (composeAll . concat $
-    [ [resource ​    =? r            --> doIgnore ​            ​| ​  ​r ​  <- myIgnores ] -- ignore desktop +    [ [resource ​    =? r            --> doIgnore ​            ​| ​  ​r ​  <- myIgnores ​  ​] -- ignore desktop 
-    , [className ​   =? c            --> doShift ​ "​1:​main" ​   |   ​c ​  <- myMain ​   ] -- move dev to main +    , [className ​   =? c            --> doShift ​ "​1:​main" ​   |   ​c ​  <- myMain ​     ] -- move dev to main 
-    , [className ​   =? c            --> doShift ​ "​2:​general"​ |   ​c ​  <- myGeneral ] -- move general to general +    , [className ​   =? c            --> doShift ​ "​2:​general"​ |   ​c ​  <- myGeneral ​  ​] -- move general to general 
-    , [className ​   ​=?            ​-->​ doShift ​ "​3:​classic"​ |     <- myClassic ] -- move general to general +    , [name         =?            ​-->​ doShift ​ "​3:​classic"​ |     <- myClassic ​  ] -- move general to general 
-    , [className ​   =? c            --> doShift ​ "4:​web" ​    ​| ​  ​c ​  <- myWebs ​   ] -- move webs to web +    , [name         =? n            --> doShift ​ "​4:​vbox" ​   |   ​n ​  <- myVbox ​     ​] -- move general to general 
-    , [className ​   =? c            --> doShift "5:​irc" ​    ​| ​  ​c ​  <- myIRC     ​] -- move irc to irc   +    , [className ​   =? c            --> doShift ​ "5:​web" ​    ​| ​  ​c ​  <- myWebs ​     ] -- move webs to web 
-    , [className ​   =? c            --> doCenterFloat ​       |   ​c ​  <- myFloatsC ] -- float my floats +    , [className ​   =? c            --> doShift "6:​irc" ​    ​| ​  ​c ​  <- myIRC       ​] -- move irc to irc  ​ 
-    , [name         =? n            --> doCenterFloat ​       |   ​n ​  <- myFloatsN ] -- float my names +    , [className ​   =? c            --> unfloat ​             |   ​c ​  <- myNoFloatsC ] -- unfloat my floats 
-    , [isFullscreen ​                ​-->​ myDoFullFloat ​                            ​+    , [className ​   =? c            --> doCenterFloat ​       |   ​c ​  <- myFloatsC ​  ​] -- float my floats 
-    , [manageDocks   ​]+    , [name         =? n            --> doCenterFloat ​       |   ​n ​  <- myFloatsN ​  ​] -- float my names 
 +    , [isFullscreen ​                ​-->​ myDoFullFloat ​                              ​
 +    , [manageDocks  ​   ​]
     ])      ]) 
    
Line 193: Line 205:
         role      = stringProperty "​WM_WINDOW_ROLE"​         role      = stringProperty "​WM_WINDOW_ROLE"​
         name      = stringProperty "​WM_NAME"​         name      = stringProperty "​WM_NAME"​
 +        unfloat = ask >>= doF . W.sink
  
         -- sorters         -- sorters
         myMain  ​ = ["​Terminal"​]         myMain  ​ = ["​Terminal"​]
         myGeneral = ["​Thunar",​ "​Deluge","​Ristretto"​]         myGeneral = ["​Thunar",​ "​Deluge","​Ristretto"​]
-        myClassic = ["Skype""Pidgin"]+        myClassic = ["Xmonad Classic"
 +        myVbox  ​ = ["VirtualBox - Windows 7"]
         myWebs ​   = ["​Firefox","​Google-chrome","​Chromium","​Chromium-browser","​Opera"​]         myWebs ​   = ["​Firefox","​Google-chrome","​Chromium","​Chromium-browser","​Opera"​]
         myIRC  ​ = ["​Xchat"​]         myIRC  ​ = ["​Xchat"​]
Line 205: Line 219:
    
         -- floats         -- floats
-        myFloatsC ​ = ["​VirtualBox","​Xmessage","​XFontSel","​Downloads",​ "​Wicd-client.py"​] +        myFloatsC ​ = ["​VirtualBox","​Xmessage","​XFontSel","​Downloads","​Wicd-client.py","​xfce4-power-information","​xfce4-power-manager-settings"] 
-        myFloatsN ​ = ["​bashrun",​"​Google Chrome Options","​Chromium Options"​]+        myFloatsN ​ = ["​Google Chrome Options","​Chromium Options","​XChat:​ Network List"​] 
 +        myNoFloatsC = ["​Xephyr",​ "​VirtualBox"]
  
 -- fullscreen with focus  -- fullscreen with focus 
Line 214: Line 229:
 -- layouts -- layouts
 layoutHook' ​ =  onWorkspaces ["​1:​main" ​   ] customLayoutTilted $ layoutHook' ​ =  onWorkspaces ["​1:​main" ​   ] customLayoutTilted $
-                onWorkspaces ["​3:​classic"​ ] customLayoutFloat ​+                onWorkspaces ["​3:​classic"​ ] customLayoutFull ​
-                onWorkspaces ["​4:​web" ​    ] customLayoutFull $ +                onWorkspaces ["4:vbox" ] customLayoutFull $ 
-                onWorkspaces ["5:​irc" ​    ] customLayoutFull $+                onWorkspaces ["5:​web" ​    ] customLayoutFull $ 
 +                onWorkspaces ["6:​irc" ​    ] customLayoutFull $
                 customLayoutDefault                 customLayoutDefault
  
Line 223: Line 239:
     tiled ​  = ResizableTall 1 (2/100) (1/2) []     tiled ​  = ResizableTall 1 (2/100) (1/2) []
  
-customLayoutFull = avoidStruts $ smartBorders Full 
- where 
-    tiled ​  = ResizableTall 1 (2/100) (1/2) [] 
-  
 customLayoutDefault = avoidStruts $ Full ||| tiled ||| Mirror tiled customLayoutDefault = avoidStruts $ Full ||| tiled ||| Mirror tiled
  where  where
  tiled ​  = ResizableTall 1 (2/100) (1/2) []  tiled ​  = ResizableTall 1 (2/100) (1/2) []
  
-customLayoutFloat = avoidStruts $ simpleFloat+customLayoutFull = avoidStruts $ smartBorders Full  
 +--customLayoutFloat = avoidStruts $ simpleFloat
  
 --}}} --}}}
Line 240: Line 253:
 ## core x configuration ## core x configuration
 xsetroot -solid black xsetroot -solid black
 +xloadimage -onroot -center /​home/​sjorge/​Documents/​Themes/​Backgrounds/​xmonad.png
 xsetroot -cursor_name left_ptr xsetroot -cursor_name left_ptr
 setxkbmap -layout be setxkbmap -layout be
- +xbindkeys
-## system tray +
-xfce4-power-manager & +
-wicd-gtk --tray &+
  
 ## default apps ## default apps
-sleep 3 +sleep 5 
-xchat & +#xchat & 
-skype & +chromium ​&
-pidgin & +
-firefox ​&+
 </​code>​ </​code>​
 ==== ~/​.xmonad/​.conky_dzen ====  ==== ~/​.xmonad/​.conky_dzen ==== 
Line 263: Line 272:
  
 TEXT TEXT
-${if_empty ${exec ifconfig wlan0 | grep 'inet '​}}^i(/​home/​sjorge/​.xmonad/​dzen2/​net-wired.xbm)${else}^i(/​home/​sjorge/​.xmonad/​dzen2/​wifi_01.xbm) ${exec iwconfig wlan0 | grep '​Signal level' | cut -d= -f3 | awk '​{print 100+$1 "​%"​}'​} ${exec iwgetid | cut -d\" -f2 | awk '​{print ​ $1}'​}${endif} ${if_match ${exec cat /​sys/​class/​power_supply/​ADP1/​online} == 1}^i(/​home/​sjorge/​.xmonad/​dzen2/​ac_01.xbm)${else}^i(/​home/​sjorge/​.xmonad/​dzen2/​bat_full_01.xbm)${endif} ${battery_percent ​BAT1}% | ^fg(\#​B9EE85)${time %a %H:%M}+${if_empty ${exec ifconfig wlan0 | grep 'inet '​}}^i(/​home/​sjorge/​.xmonad/​dzen2/​net-wired.xbm)${else}^i(/​home/​sjorge/​.xmonad/​dzen2/​wifi_01.xbm) ${exec iwconfig wlan0 | grep '​Signal level' | cut -d= -f3 | awk '​{print 100+$1 "​%"​}'​} ${exec iwgetid | cut -d\" -f2 | awk '​{print ​ $1}'​}${endif} ${if_match ${exec cat /​sys/​class/​power_supply/​ADP1/​online} == 1}^i(/​home/​sjorge/​.xmonad/​dzen2/​ac_01.xbm)${else}^i(/​home/​sjorge/​.xmonad/​dzen2/​bat_full_01.xbm)${endif} ${battery_percent ​BAT0}% | ^fg(\#​B9EE85)${time %a %H:%M}
 </​code>​ </​code>​
  
Line 272: Line 281:
 ## apps ## apps
 [ -e ~/​.xmonad/​apps ] && ~/​.xmonad/​apps & [ -e ~/​.xmonad/​apps ] && ~/​.xmonad/​apps &
- 
 ## xmonad ## xmonad
 exec ck-launch-session dbus-launch xmonad exec ck-launch-session dbus-launch xmonad
 </​code>​ </​code>​
  
 +==== ~/​.xmonad/​bin/​xmonad-windows-run ==== 
 +<​code>​
 +#!/bin/sh
 +
 +if [ "​$(VBoxManage list runningvms | grep -ci hikari)"​ -lt 1 ]; then
 + exec Xephyr -screen 1366x752 -terminate -title "​VirtualBox - Windows 7" :4 &
 + xdotool search --classname "​Xephyr"​ windowmove 0 16
 + xdotool search --classname "​Xephyr"​ windowsize 1366 752
 + DISPLAY=:4 exec VirtualBox --startvm Hikari &
 +fi
 +</​code>​
 +
 +==== ~/​.xmonad/​bin/​xmonad-xephyr-run ==== 
 +<​code>​
 +#!/bin/sh
 +
 +if [ "$(ps aux | grep Xephyr | grep -v grep | grep -vi virtualbox | wc -l)" -lt 1 ]; then
 + exec Xephyr -screen 1366x752 -terminate -title "​Xmonad Classic"​ :3 &
 + xdotool search --classname "​Xephyr"​ windowmove 0 16
 + xdotool search --classname "​Xephyr"​ windowsize 1366 752
 + sleep 1
 + export DISPLAY=:3
 + exec xfce4-session
 + sleep 1
 + exe=`dmenu_run_xephyr -nb black -sb black -nf "#​555753"​ -sf "#​8AE234"​`
 + eval "exec $exe"
 +else
 + export DISPLAY=:3
 + exe=`dmenu_run_xephyr -nb black -sb black -nf "#​555753"​ -sf "#​8AE234"​`
 + eval "exec $exe"
 +
 +fi
 +</​code>​
 +
 +==== ~/​.xmonad/​bin/​xmonad-xephyr-kill ==== 
 +<​code>​
 +#!/bin/sh
 +
 +PID=$(ps aux | grep Xephyr | grep :3 | grep -v grep | awk '{ print $2 }')
 +
 +if [ ! -z $PID ]; then
 + kill $PID
 +fi
 +</​code>​
 ==== ~/​.xmonad/​dzen2/​ ====  ==== ~/​.xmonad/​dzen2/​ ==== 
 {{:​configuration:​dzen2.tar|}} {{:​configuration:​dzen2.tar|}}
configuration/xmonad.1346653711.txt.gz · Last modified: 2014/10/09 22:02 (external edit)