mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 08:30:21 -07:00
restart (simple exec(), no state saved)
This commit is contained in:
parent
41c2dd3fbf
commit
ec344fa383
11
Main.hs
11
Main.hs
@ -28,6 +28,9 @@ import Graphics.X11.Xinerama
|
||||
|
||||
import Control.Monad.State
|
||||
|
||||
import System.Posix.Process
|
||||
import System.Environment
|
||||
|
||||
import XMonad
|
||||
import qualified StackSet as W
|
||||
|
||||
@ -58,6 +61,7 @@ keys = M.fromList $
|
||||
, ((modMask, xK_l ), changeWidth defaultDelta)
|
||||
, ((modMask .|. shiftMask, xK_c ), kill)
|
||||
, ((modMask .|. shiftMask, xK_q ), io $ exitWith ExitSuccess)
|
||||
, ((modMask .|. shiftMask, xK_F12 ), io restart)
|
||||
, ((modMask, xK_space ), switchLayout)
|
||||
, ((modMask, xK_Return), promote)
|
||||
] ++
|
||||
@ -156,6 +160,13 @@ grabKeys dpy rootw = do
|
||||
where
|
||||
grab kc m = grabKey dpy kc m rootw True grabModeAsync grabModeAsync
|
||||
|
||||
-- | Restart xmonad by exec()'ing self. This doesn't save state and xmonad has
|
||||
-- to be in PATH for this to work.
|
||||
restart :: IO ()
|
||||
restart = do prog <- getProgName
|
||||
args <- getArgs
|
||||
executeFile prog True args Nothing
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Event handler
|
||||
--
|
||||
|
Loading…
x
Reference in New Issue
Block a user