From fc65a696e855a4c8a0e7247dcd4f5af30e88b16e Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 13 Sep 2016 12:51:06 -0700 Subject: [PATCH] Refactor xmonad.hs, add avoidStruts --- dotfiles/xmonad/xmonad.hs | 61 +++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 840844f2..1c24beb1 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -1,45 +1,42 @@ import System.IO import XMonad -import XMonad.Actions.WindowBringer import XMonad.Config() import XMonad.Hooks.DynamicLog -import XMonad.Util.CustomKeys import XMonad.Hooks.EwmhDesktops +import XMonad.Hooks.ManageDocks +import XMonad.Util.EZConfig 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 = do xmproc <- spawnPipe "xmobar" - xmonad $ ewmh defaultConfig - { modMask = mod4Mask -- Use Super instead of Alt - , keys = customKeys delkeys inskeys - , terminal = "urxvt" - , logHook = dynamicLogWithPP xmobarPP - { ppOutput = hPutStrLn xmproc - , ppTitle = xmobarColor "green" "" . shorten 50 - } - , handleEventHook = - handleEventHook defaultConfig <+> fullscreenEventHook - , startupHook = startup - } - where - delkeys :: XConfig l -> [(KeyMask, KeySym)] - delkeys _ = [ ] + xmonad $ ewmh def + { modMask = myModMask + , terminal = "urxvt" + , layoutHook = avoidStruts $ layoutHook def + , logHook = dynamicLogWithPP xmobarPP + { ppOutput = hPutStrLn xmproc + , ppTitle = xmobarColor "green" "" . shorten 50 + } + , handleEventHook = handleEventHook def <+> fullscreenEventHook + , startupHook = myStartup + } `additionalKeys` + [ ((myModMask, xK_p), spawn "rofi -show drun") + , ((myModMask, xK_g), spawn "rofi -show window") + -- TODO: Change this to bringing the window to the current workspace + , ((myModMask, xK_b), spawn "rofi -show run") + ] - inskeys :: XConfig l -> [((KeyMask, KeySym), X ())] - inskeys conf@XConfig {XMonad.modMask = modm} = - [ ((modm, xK_p), spawn "rofi -show drun") - , ((modm, xK_g), spawn "rofi -show window") - , ((modm, xK_b), spawn "rofi -show run") - ] +myStartup :: X() +myStartup = do + spawn "stalonetray" + spawn "xsetroot -solid black" + -- TODO: Figure out how to set different backgrounds for different x + -- monitors + -- spawn "feh --bg-scale /usr/share/backgrounds/gnome/Blinds.jpg" + spawn "copyq"