mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 12:41:52 -07:00
Run gnomeRegister from startupHook
This commit is contained in:
@@ -33,13 +33,12 @@ import System.Environment (getEnvironment)
|
|||||||
-- > import XMonad
|
-- > import XMonad
|
||||||
-- > import XMonad.Config.Gnome
|
-- > import XMonad.Config.Gnome
|
||||||
-- >
|
-- >
|
||||||
-- > main = do
|
-- > main = xmonad gnomeConfig
|
||||||
-- > gnomeRegister
|
|
||||||
-- > xmonad gnomeConfig
|
|
||||||
|
|
||||||
gnomeConfig = desktopConfig
|
gnomeConfig = desktopConfig
|
||||||
{ terminal = "gnome-terminal"
|
{ terminal = "gnome-terminal"
|
||||||
, keys = \c -> gnomeKeys c `M.union` keys desktopConfig c }
|
, keys = \c -> gnomeKeys c `M.union` keys desktopConfig c
|
||||||
|
, startupHook = gnomeRegister }
|
||||||
|
|
||||||
gnomeKeys (XConfig {modMask = modm}) = M.fromList $
|
gnomeKeys (XConfig {modMask = modm}) = M.fromList $
|
||||||
[ ((modm, xK_p), gnomeRun)
|
[ ((modm, xK_p), gnomeRun)
|
||||||
@@ -66,8 +65,8 @@ gnomeRun = withDisplay $ \dpy -> do
|
|||||||
-- gnome-session>=2.26: to start xmonad with a command as such:
|
-- gnome-session>=2.26: to start xmonad with a command as such:
|
||||||
--
|
--
|
||||||
-- > gconftool-2 -s /desktop/gnome/session/required_components/windowmanager xmonad --type string
|
-- > gconftool-2 -s /desktop/gnome/session/required_components/windowmanager xmonad --type string
|
||||||
gnomeRegister :: IO ()
|
gnomeRegister :: MonadIO m => m ()
|
||||||
gnomeRegister = do
|
gnomeRegister = io $ do
|
||||||
x <- lookup "DESKTOP_AUTOSTART_ID" `fmap` getEnvironment
|
x <- lookup "DESKTOP_AUTOSTART_ID" `fmap` getEnvironment
|
||||||
whenJust x $ \sessionId -> safeSpawn "dbus-send"
|
whenJust x $ \sessionId -> safeSpawn "dbus-send"
|
||||||
["--session"
|
["--session"
|
||||||
|
Reference in New Issue
Block a user