Skip to content

Instantly share code, notes, and snippets.

@coproduto
Created August 7, 2020 14:02
Show Gist options
  • Save coproduto/4051a1087da8b684e423a7e5165f7f41 to your computer and use it in GitHub Desktop.
Save coproduto/4051a1087da8b684e423a7e5165f7f41 to your computer and use it in GitHub Desktop.
import XMonad
import XMonad.Hooks.DynamicLog
import qualified Data.Map as M
myStatusBar = "xmobar"
myStatusBarPP = xmobarPP
{ ppCurrent = xmobarColor "#429942" "" . wrap "<" ">" }
-- Key binding to toggle the gap for the bar.
toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
[ -- Screenshot key bindings
--take a screenshot of entire display
((modMask, xK_Print ), spawn "scrot screen_%Y-%m-%d-%H-%M-%S.png -d 1")
--take a screenshot of focused window
, ((modMask .|. controlMask, xK_Print ), spawn "scrot window_%Y-%m-%d-%H-%M-%S.png -d 1-u")
]
myConfig = def
{ terminal = "urxvt"
, modMask = mod4Mask
}
main = xmonad =<< statusBar myStatusBar myStatusBarPP toggleStrutsKey myConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment