[XMonad] Support restarts

This commit is contained in:
Ivan Malison 2021-08-03 10:49:05 -06:00
parent f8c5afee36
commit e3d26815cd
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -57,6 +57,7 @@ import XMonad.Hooks.FadeInactive
import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.Minimize import XMonad.Hooks.Minimize
import qualified XMonad.Operations
import XMonad.Hooks.TaffybarPagerHints import XMonad.Hooks.TaffybarPagerHints
import XMonad.Hooks.WorkspaceHistory import XMonad.Hooks.WorkspaceHistory
import XMonad.Layout.Accordion import XMonad.Layout.Accordion
@ -94,16 +95,21 @@ myConfig = def
, normalBorderColor = "#000000" , normalBorderColor = "#000000"
, focusedBorderColor = "#ffff00" , focusedBorderColor = "#ffff00"
, logHook = , logHook =
updatePointer (0.5, 0.5) (0, 0) +++ updatePointer (0.5, 0.5) (0, 0) <>
toggleFadeInactiveLogHook 0.9 +++ workspaceHistoryHook +++ toggleFadeInactiveLogHook 0.9 <> workspaceHistoryHook <>
setWorkspaceNames +++ activateLogHook (reader W.focusWindow >>= doF) <+> logHook def setWorkspaceNames <> activateLogHook (reader W.focusWindow >>= doF) <+> logHook def
, handleEventHook = , handleEventHook =
fullscreenEventHook +++ followIfNoMagicFocus +++ minimizeEventHook fullscreenEventHook <> followIfNoMagicFocus <> minimizeEventHook <> restartEventHook
, startupHook = myStartup , startupHook = myStartup
, keys = customKeys (const []) addKeys , keys = customKeys (const []) addKeys
} }
where
x +++ y = mappend y x restartEventHook e@ClientMessageEvent { ev_message_type = mt } = do
a <- getAtom "XMONAD_RESTART"
if (mt == a)
then XMonad.Operations.restart "imalison-xmonad" True >> return (All True)
else return $ All True
restartEventHook _ = return $ All True
myNavigation2DConfig = def { defaultTiledNavigation = centerNavigation } myNavigation2DConfig = def { defaultTiledNavigation = centerNavigation }