Skip to content

Instantly share code, notes, and snippets.

@johari
Last active June 8, 2018 20:29
Show Gist options
  • Save johari/ade8d0e4a6ce14da3048556ee2d0b366 to your computer and use it in GitHub Desktop.
Save johari/ade8d0e4a6ce14da3048556ee2d0b366 to your computer and use it in GitHub Desktop.
Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
, borderColor = "black"
, border = TopB
, bgColor = "black"
, fgColor = "grey"
, position = TopW L 100
, commands = [ Run Weather "CYVR" ["-t","<tempC>C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000
, Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10
, Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Swap [] 10
, Run Com "uname" ["-s","-r"] "" 36000
, Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% | %cpu% | %memory% * %swap% | %eth0% - %eth1% }{<fc=#ee9a00>%date%</fc> | %uname% | %CYVR% "
}
import XMonad
import qualified XMonad.StackSet as W
import XMonad.Actions.CycleWS
import XMonad.Actions.DynamicWorkspaces
import XMonad.Actions.CopyWindow(copy)
import XMonad.Config.Desktop
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
myManageHook = composeAll
[ className =? "Gimp" --> doFloat
, className =? "rdesktop" --> doFloat
]
myWorkspaces :: [String]
myWorkspaces = map show [1..9]
modm = mod1Mask
main = do
xmproc <- spawnPipe "xmobar ~/.xmobarrc"
xmonad $ desktopConfig
{ manageHook = manageDocks <+> myManageHook -- make sure to include myManageHook definition from above
<+> manageHook desktopConfig
, layoutHook = avoidStruts $ layoutHook desktopConfig
, workspaces = myWorkspaces
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
}
, modMask = mod1Mask -- Rebind Mod to the Left Alt key globally
, focusFollowsMouse = True
} `additionalKeys`
[ ((mod1Mask, xK_f), spawn "firefox")
, ((mod1Mask, xK_Return), spawn "urxvt")
, ((modm .|. shiftMask, xK_BackSpace), removeWorkspace)
, ((modm .|. shiftMask, xK_v ), selectWorkspace def)
, ((modm, xK_m ), withWorkspace def (windows . W.shift))
, ((modm .|. shiftMask, xK_m ), withWorkspace def (windows . copy))
, ((modm .|. shiftMask, xK_r ), renameWorkspace def)
, ((modm , xK_f), moveTo Next NonEmptyWS)
, ((modm .|. shiftMask, xK_f), moveTo Prev NonEmptyWS)
, ((modm , xK_e), moveTo Next EmptyWS)
, ((modm .|. shiftMask, xK_e), moveTo Prev EmptyWS)
, ((modm, xK_Return), windows W.swapMaster) -- %! Swap the focused window and the master window
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment