Add rofi support and startup hooks to xmonad

This commit is contained in:
Ivan Malison 2016-09-13 02:50:25 -07:00
parent baee1db612
commit 0a1b86b32b
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -4,14 +4,24 @@ import XMonad
import XMonad.Actions.WindowBringer
import XMonad.Config()
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.CustomKeys
import XMonad.Hooks.EwmhDesktops
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"
main :: IO ()
main = do
xmproc <- spawnPipe "xmobar"
xmonad defaultConfig
xmonad $ ewmh defaultConfig
{ modMask = mod4Mask -- Use Super instead of Alt
, keys = customKeys delkeys inskeys
, terminal = "urxvt"
@ -19,13 +29,17 @@ main = do
{ 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 =
[ ((mod4Mask, xK_g), gotoMenu)
, ((modM4ask, xK_b), bringMenu)
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")
]