Last active
December 18, 2015 16:19
-
-
Save nouse/5810725 to your computer and use it in GitHub Desktop.
xmonad.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Config { font = "xft:Noto Sans CJK SC:size=10:antialias=true" | |
, bgColor = "black" | |
, fgColor = "green" | |
, position = TopSize L 94 13 | |
, lowerOnStart = True | |
, commands = [ Run Network "eth0" [] 50 | |
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 50 | |
, Run Memory ["-t","Mem: <usedratio>%"] 50 | |
, Run Com "uname" ["-s","-r"] "" 36000 | |
, Run Date "%a %b %_d %Y %H:%M" "date" 50 | |
, Run XMonadLog | |
] | |
, sepChar = "%" | |
, alignSep = "}{" | |
, template = "%XMonadLog% }{ %cpu% | %memory% | %eth0% | %uname% | <fc=#ee9a00>%date%</fc>" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XMonad | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Hooks.ManageHelpers | |
import XMonad.Layout.NoBorders | |
import XMonad.Util.CustomKeys | |
import XMonad.Util.SpawnOnce | |
import qualified Data.Map as M | |
import Data.Monoid (Endo) | |
delkeys :: XConfig l -> [(KeyMask, KeySym)] | |
delkeys XConfig {modMask = modm} = | |
[(modm .|. shiftMask, xK_p)] | |
inskeys :: XConfig l -> [((KeyMask, KeySym), X())] | |
inskeys (XConfig {modMask = modm}) = | |
[((modm .|. shiftMask, xK_l), spawn "xscreensaver-command -lock")] | |
myKeys :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ()) | |
myKeys = customKeys delkeys inskeys | |
myManageHook :: Query (Endo WindowSet) | |
myManageHook = composeAll [ | |
className =? "Iceweasel" --> doShift "3:www" , | |
isFullscreen --> doFullFloat | |
] | |
main :: IO () | |
main = do | |
xmonad $ defaultConfig { | |
keys = myKeys, | |
manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig, | |
layoutHook = smartBorders $ avoidStruts $ layoutHook defaultConfig, | |
logHook = dynamicLogString defaultPP >>= xmonadPropLog, | |
startupHook = do | |
spawn "feh --bg-scale /usr/share/wallpapers/Lines/contents/images/1920x1080.png" | |
spawn "xscreensaver -no-splash" | |
spawnOnce "trayer --edge top --align right --SetDockType true --SetPartialStrut true \ | |
\--expand true --width 6 --widthtype percent --transparent true --tint 0x000000 --heighttype pixel \ | |
\--height 24" | |
spawnOnce "workrave" | |
spawn "xmobar" | |
spawn "xsetroot -cursor_name left_ptr" | |
, | |
modMask = mod4Mask, | |
workspaces = ["1:emacs", "2:terminal", "3:www", "4", "5", "6", "7", "8", "9"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment