Skip to content

Instantly share code, notes, and snippets.

@afrontend
Last active May 3, 2018 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afrontend/a9a62ca9b9d52dda8408e4eb0d32d6d6 to your computer and use it in GitHub Desktop.
Save afrontend/a9a62ca9b9d52dda8408e4eb0d32d6d6 to your computer and use it in GitHub Desktop.
{-~/.xmonad/xmonad.hs-}
{-xmonad 0.11.1-}
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
import XMonad.Actions.CycleWS
import qualified XMonad.StackSet as W
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")
-- a basic CycleWS setup
, ((mod4Mask, xK_l), nextWS)
, ((mod4Mask, xK_h), prevWS)
, ((mod4Mask .|. mod1Mask, xK_l), shiftToNext >> nextWS)
, ((mod4Mask .|. mod1Mask, xK_h), shiftToPrev >> prevWS)
, ((mod4Mask, xK_Delete), kill)
-- a basic XMonad.StackSet
, ((mod4Mask .|. mod1Mask, xK_j ), windows W.swapDown) -- Swap the focused window with the next window
, ((mod4Mask .|. mod1Mask, xK_k ), windows W.swapUp) -- Swap the focused window with the previous window
, ((mod4Mask, xK_Left), sendMessage Shrink) -- Shrink the master area
, ((mod4Mask, xK_Right), sendMessage Expand) -- Expand the master area
, ((mod4Mask, xK_o), nextScreen)
, ((mod4Mask .|. mod1Mask, xK_o), shiftNextScreen >> nextScreen)
, ((mod4Mask .|. shiftMask, xK_o), swapNextScreen)
, ((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