Skip to content

Instantly share code, notes, and snippets.

@ruanyf
Created July 22, 2017 08:47
Show Gist options
  • Save ruanyf/65893d5d5916bb2ffefd8ea69ff869f7 to your computer and use it in GitHub Desktop.
Save ruanyf/65893d5d5916bb2ffefd8ea69ff869f7 to your computer and use it in GitHub Desktop.
xmonad 配置文件范例
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
main = do
xmproc <- spawnPipe "xmobar"
xmonad $ defaultConfig
{ manageHook = manageDocks <+> manageHook defaultConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
}
, modMask = mod4Mask -- Rebind Mod to the Windows key
} `additionalKeys`
[ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock; xset dpms force off")
, ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
, ((0, xK_Print), spawn "scrot")
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment