Refactor xmonad.hs, add avoidStruts
This commit is contained in:
parent
f180fd9a6f
commit
fc65a696e8
@ -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 ())]
|
|
||||||
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user