Refactor xmonad.hs, add avoidStruts
This commit is contained in:
parent
f180fd9a6f
commit
fc65a696e8
@ -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
|
||||
xmonad $ ewmh def
|
||||
{ modMask = myModMask
|
||||
, terminal = "urxvt"
|
||||
, layoutHook = avoidStruts $ layoutHook def
|
||||
, logHook = dynamicLogWithPP xmobarPP
|
||||
{ ppOutput = hPutStrLn xmproc
|
||||
, ppTitle = xmobarColor "green" "" . shorten 50
|
||||
}
|
||||
, handleEventHook =
|
||||
handleEventHook defaultConfig <+> fullscreenEventHook
|
||||
, startupHook = startup
|
||||
}
|
||||
where
|
||||
delkeys :: XConfig l -> [(KeyMask, KeySym)]
|
||||
delkeys _ = [ ]
|
||||
|
||||
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")
|
||||
, 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")
|
||||
]
|
||||
|
||||
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"
|
||||
|
Loading…
Reference in New Issue
Block a user