Refactor xmonad.hs, add avoidStruts

This commit is contained in:
Ivan Malison 2016-09-13 12:51:06 -07:00
parent f180fd9a6f
commit fc65a696e8
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -1,45 +1,42 @@
import System.IO import System.IO
import XMonad import XMonad
import XMonad.Actions.WindowBringer
import XMonad.Config() import XMonad.Config()
import XMonad.Hooks.DynamicLog import XMonad.Hooks.DynamicLog
import XMonad.Util.CustomKeys
import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Util.EZConfig
import XMonad.Util.Run(spawnPipe) import XMonad.Util.Run(spawnPipe)
import qualified Data.Map as M
startup :: X()
startup = do
spawn "stalonetray"
spawn "xscreensaver -no-splash"
spawn "feh --bg-scale /usr/share/backgrounds/gnome/Blinds.jpg"
spawn "copyq"
-- Use Super/Command/WinKey instead of Alt
myModMask :: KeyMask
myModMask = mod4Mask
main :: IO () main :: IO ()
main = do main = do
xmproc <- spawnPipe "xmobar" xmproc <- spawnPipe "xmobar"
xmonad $ ewmh defaultConfig xmonad $ ewmh def
{ modMask = mod4Mask -- Use Super instead of Alt { modMask = myModMask
, keys = customKeys delkeys inskeys , terminal = "urxvt"
, terminal = "urxvt" , layoutHook = avoidStruts $ layoutHook def
, logHook = dynamicLogWithPP xmobarPP , logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc { ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50 , ppTitle = xmobarColor "green" "" . shorten 50
} }
, handleEventHook = , handleEventHook = handleEventHook def <+> fullscreenEventHook
handleEventHook defaultConfig <+> fullscreenEventHook , startupHook = myStartup
, startupHook = startup } `additionalKeys`
} [ ((myModMask, xK_p), spawn "rofi -show drun")
where , ((myModMask, xK_g), spawn "rofi -show window")
delkeys :: XConfig l -> [(KeyMask, KeySym)] -- TODO: Change this to bringing the window to the current workspace
delkeys _ = [ ] , ((myModMask, xK_b), spawn "rofi -show run")
]
inskeys :: XConfig l -> [((KeyMask, KeySym), X ())] myStartup :: X()
inskeys conf@XConfig {XMonad.modMask = modm} = myStartup = do
[ ((modm, xK_p), spawn "rofi -show drun") spawn "stalonetray"
, ((modm, xK_g), spawn "rofi -show window") spawn "xsetroot -solid black"
, ((modm, xK_b), spawn "rofi -show run") -- TODO: Figure out how to set different backgrounds for different x
] -- monitors
-- spawn "feh --bg-scale /usr/share/backgrounds/gnome/Blinds.jpg"
spawn "copyq"