mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 08:30:21 -07:00
Remove getProgName capability from restart, we don't use it anymore
This commit is contained in:
parent
d1af7d986d
commit
31c7734f7b
@ -207,7 +207,7 @@ keys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
|
|||||||
|
|
||||||
-- quit, or restart
|
-- quit, or restart
|
||||||
, ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) -- %! Quit xmonad
|
, ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) -- %! Quit xmonad
|
||||||
, ((modMask , xK_q ), restart (Just "xmonad") True) -- %! Restart xmonad
|
, ((modMask , xK_q ), restart "xmonad" True) -- %! Restart xmonad
|
||||||
]
|
]
|
||||||
++
|
++
|
||||||
-- mod-[1..9] %! Switch to workspace N
|
-- mod-[1..9] %! Switch to workspace N
|
||||||
|
@ -43,7 +43,6 @@ import System.Posix.Process (executeFile, forkProcess, getProcessStatus, createS
|
|||||||
import System.Process
|
import System.Process
|
||||||
import System.Directory
|
import System.Directory
|
||||||
import System.Exit
|
import System.Exit
|
||||||
import System.Environment
|
|
||||||
import Graphics.X11.Xlib
|
import Graphics.X11.Xlib
|
||||||
import Graphics.X11.Xlib.Extras (Event)
|
import Graphics.X11.Xlib.Extras (Event)
|
||||||
import Data.Typeable
|
import Data.Typeable
|
||||||
@ -321,19 +320,14 @@ runOnWorkspaces job =do
|
|||||||
$ current ws : visible ws
|
$ current ws : visible ws
|
||||||
modify $ \s -> s { windowset = ws { current = c, visible = v, hidden = h } }
|
modify $ \s -> s { windowset = ws { current = c, visible = v, hidden = h } }
|
||||||
|
|
||||||
-- | Restart xmonad via exec().
|
-- | @restart name resume@. Attempt to restart xmonad by executing the program
|
||||||
|
-- @name@. If @resume@ is 'True', restart with the current window state.
|
||||||
|
-- When executing another window manager, @resume@ should be 'False'.
|
||||||
--
|
--
|
||||||
-- If the first parameter is 'Just name', restart will attempt to execute the
|
restart :: String -> Bool -> X ()
|
||||||
-- program corresponding to 'name'. Otherwise, xmonad will attempt to execute
|
restart prog resume = do
|
||||||
-- the name of the current program.
|
|
||||||
--
|
|
||||||
-- When the second parameter is 'True', xmonad will attempt to resume with the
|
|
||||||
-- current window state.
|
|
||||||
restart :: Maybe String -> Bool -> X ()
|
|
||||||
restart mprog resume = do
|
|
||||||
broadcastMessage ReleaseResources
|
broadcastMessage ReleaseResources
|
||||||
io . flush =<< asks display
|
io . flush =<< asks display
|
||||||
prog <- maybe (io getProgName) return mprog
|
|
||||||
args <- if resume then gets (("--resume":) . return . showWs . windowset) else return []
|
args <- if resume then gets (("--resume":) . return . showWs . windowset) else return []
|
||||||
catchIO (executeFile prog True args Nothing)
|
catchIO (executeFile prog True args Nothing)
|
||||||
where showWs = show . mapLayout show
|
where showWs = show . mapLayout show
|
||||||
|
@ -145,7 +145,7 @@ myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
|
|||||||
, ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
|
, ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
|
||||||
|
|
||||||
-- Restart xmonad
|
-- Restart xmonad
|
||||||
, ((modMask , xK_q ), restart (Just "xmonad") True)
|
, ((modMask , xK_q ), restart "xmonad" True)
|
||||||
]
|
]
|
||||||
++
|
++
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user