2016-05-29 12:06:32 +00:00
|
|
|
import XMonad
|
2017-08-29 10:26:56 +00:00
|
|
|
import XMonad.Config.Desktop
|
2016-05-29 12:06:32 +00:00
|
|
|
import XMonad.Hooks.DynamicLog
|
|
|
|
import XMonad.Hooks.ManageDocks
|
|
|
|
import XMonad.Util.Run(spawnPipe)
|
|
|
|
import XMonad.Util.EZConfig(additionalKeys)
|
|
|
|
import System.IO
|
|
|
|
|
|
|
|
main = do
|
2017-03-30 03:59:51 +00:00
|
|
|
xmproc <- spawnPipe "/usr/bin/xmobar /home/craige/.xmobarrc"
|
|
|
|
-- Launch xmobar as my task bar.
|
2017-08-29 10:26:56 +00:00
|
|
|
xmonad $ desktopConfig
|
2017-03-30 03:59:51 +00:00
|
|
|
{ focusFollowsMouse = False
|
|
|
|
, terminal = "terminology"
|
2017-08-29 10:26:56 +00:00
|
|
|
, manageHook = manageDocks <+> manageHook desktopConfig
|
|
|
|
, layoutHook = avoidStruts $ layoutHook desktopConfig
|
2017-03-30 03:59:51 +00:00
|
|
|
, logHook = dynamicLogWithPP $ xmobarPP
|
|
|
|
{ ppOutput = hPutStrLn xmproc
|
|
|
|
, ppCurrent = xmobarColor "#859900" "" . wrap "[" "]"
|
|
|
|
, ppVisible = xmobarColor "#2aa198" "" . wrap "(" ")"
|
|
|
|
, ppLayout = xmobarColor "#2aa198" ""
|
|
|
|
, ppTitle = xmobarColor "#859900" "" . shorten 50
|
|
|
|
}
|
|
|
|
, modMask = mod4Mask -- Rebind Mod to the Windows key
|
|
|
|
--, borderWidth = 1
|
|
|
|
} `additionalKeys`
|
|
|
|
-- Custom dmenu launcher
|
|
|
|
[ ((mod4Mask, xK_p ), spawn
|
2017-03-30 04:41:28 +00:00
|
|
|
" exe=`dmenu_path | dmenu -fn \"Open Sans-10\" -p \"λ:\" \
|
|
|
|
\ -nb \"#073642\" -nf \"#93a1a1\" -sb \"#002b36\" -sf \
|
|
|
|
\ \"#859900\"` && eval \"exec $exe\""
|
2017-03-30 03:59:51 +00:00
|
|
|
)
|
|
|
|
-- Lock the screen
|
|
|
|
, ((0, 0x1008ff2d), spawn "xscreensaver-command -lock")
|
|
|
|
-- XF86ScreenSaver
|
|
|
|
, ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
|
|
|
|
, ((0, xK_Print), spawn "scrot")
|
|
|
|
-- Turn off the display port
|
|
|
|
, ((mod4Mask, xK_d), spawn "/usr/bin/xrandr --output DP-1 --off")
|
|
|
|
-- Turn on the display port and set it as the primary display
|
|
|
|
, ((mod4Mask .|. shiftMask, xK_d), spawn
|
2017-03-30 04:41:28 +00:00
|
|
|
" /usr/bin/xrandr --output LVDS-1 --primary --auto --output \
|
|
|
|
\ DP-1 --left-of LVDS-1 --auto"
|
2017-03-30 03:59:51 +00:00
|
|
|
)
|
|
|
|
-- Turn off the HDMI port
|
|
|
|
, ((mod4Mask .|. controlMask, xK_h), spawn
|
|
|
|
"/usr/bin/xrandr --output HDMI-1 --off"
|
|
|
|
)
|
|
|
|
-- Turn on the HDMI port and set it as the primary display
|
|
|
|
, ((mod4Mask .|. shiftMask, xK_h), spawn
|
2017-03-30 04:41:28 +00:00
|
|
|
" /usr/bin/xrandr --output LVDS-1 --primary --auto --output \
|
2017-08-29 10:26:56 +00:00
|
|
|
\ HDMI-1 --right-of LVDS-1 --auto"
|
2017-03-30 03:59:51 +00:00
|
|
|
)
|
|
|
|
-- Turn off the VGA port
|
|
|
|
, ((mod4Mask, xK_v), spawn "/usr/bin/xrandr --output VGA-1 --off")
|
|
|
|
-- Turn on the VGA port and set it as the primary display
|
|
|
|
, ((mod4Mask .|. shiftMask, xK_v), spawn
|
2017-03-30 04:41:28 +00:00
|
|
|
" /usr/bin/xrandr --output LVDS-1 --primary --auto --output \
|
|
|
|
\ VGA-1 --left-of LVDS-1 --auto"
|
2017-03-30 03:59:51 +00:00
|
|
|
)
|
|
|
|
, ((0 , 0x1008FF11), spawn
|
|
|
|
"amixer set Master 2%-") -- XF86AudioLowerVolume
|
|
|
|
, ((0 , 0x1008FF12), spawn
|
|
|
|
"amixer set Master toggle") -- XF86AudioMute
|
|
|
|
, ((0 , 0x1008FF13), spawn
|
|
|
|
"amixer set Master 2%+") -- XF86AudioRaiseVolume
|
|
|
|
, ((0 , 0x1008FF14), spawn "mpc toggle") -- Play/pause
|
|
|
|
, ((0 , 0x1008FF15), spawn "mpc stop") -- Stop
|
|
|
|
, ((0 , 0x1008FF16), spawn "mpc prev") -- XF86AudioPrevious
|
|
|
|
, ((0 , 0x1008FF17), spawn "mpc next") -- XF86AudioNext
|
|
|
|
]
|