diff options
author | tv <tv@krebsco.de> | 2018-11-29 21:24:31 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2018-11-29 21:56:52 +0100 |
commit | 8d87e4b8909adff80f9b9dd83fe177a3dff8918d (patch) | |
tree | c7fe07fb4096bdded50fc172dc047a7d3adff6f9 | |
parent | 84c79ff43b2b65bba969aef7460f4a9d2915c112 (diff) |
xmonad-stockholm: 1.2.0 -> 1.3.0
-rw-r--r-- | jeschli/5pkgs/simple/xmonad-jeschli/default.nix | 9 | ||||
-rw-r--r-- | tv/2configs/xserver/default.nix | 2 | ||||
-rw-r--r-- | tv/5pkgs/simple/xmonad-tv/default.nix | 22 |
3 files changed, 9 insertions, 24 deletions
diff --git a/jeschli/5pkgs/simple/xmonad-jeschli/default.nix b/jeschli/5pkgs/simple/xmonad-jeschli/default.nix index 4ebd98f..827c77b 100644 --- a/jeschli/5pkgs/simple/xmonad-jeschli/default.nix +++ b/jeschli/5pkgs/simple/xmonad-jeschli/default.nix @@ -24,8 +24,9 @@ import Control.Monad.Extra (whenJustM) import Graphics.X11.ExtraTypes.XF86 import Text.Read (readEither) import XMonad -import System.IO (hPutStrLn, stderr) import System.Environment (getArgs, withArgs, getEnv, getEnvironment, lookupEnv) +import System.Exit (exitFailure) +import System.IO (hPutStrLn, stderr) import System.Posix.Process (executeFile) import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace , removeEmptyWorkspace) @@ -66,12 +67,14 @@ myFont = "-schumacher-*-*-*-*-*-*-*-*-*-*-*-iso10646-*" main :: IO () main = getArgs >>= \case - ["--shutdown"] -> sendShutdownEvent - _ -> mainNoArgs + [] -> mainNoArgs + ["--shutdown"] -> shutdown + args -> hPutStrLn stderr ("bad arguments: " <> show args) >> exitFailure mainNoArgs :: IO () mainNoArgs = do workspaces0 <- getWorkspaces0 + handleShutdownEvent <- newShutdownEventHandler xmonad -- $ withUrgencyHookC dzenUrgencyHook { args = ["-bg", "magenta", "-fg", "magenta", "-h", "2"], duration = 500000 } -- urgencyConfig { remindWhen = Every 1 } diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix index 199ffca..a44ece8 100644 --- a/tv/2configs/xserver/default.nix +++ b/tv/2configs/xserver/default.nix @@ -101,7 +101,7 @@ in { "\${XMONAD_DATA_DIR}" ]}"; ExecStart = "${pkgs.xmonad-tv}/bin/xmonad-${currentSystem}"; - ExecStop = "${pkgs.xmonad-tv}/bin/xmonad-${currentSystem} --shutdown $MAINPID"; + ExecStop = "${pkgs.xmonad-tv}/bin/xmonad-${currentSystem} --shutdown"; User = cfg.user.name; WorkingDirectory = cfg.user.home; }; diff --git a/tv/5pkgs/simple/xmonad-tv/default.nix b/tv/5pkgs/simple/xmonad-tv/default.nix index ab4be91..edfee98 100644 --- a/tv/5pkgs/simple/xmonad-tv/default.nix +++ b/tv/5pkgs/simple/xmonad-tv/default.nix @@ -19,10 +19,7 @@ pkgs.writeHaskellPackage "xmonad-tv" { module Main where -import System.IO.Error (isDoesNotExistError, tryIOError) import System.Exit (exitFailure) -import Control.Monad (forever) -import Control.Concurrent (threadDelay) import Control.Exception import Control.Monad.Extra (whenJustM) @@ -32,8 +29,6 @@ import XMonad import System.IO (hPutStrLn, stderr) import System.Environment (getArgs, getEnv, getEnvironment, lookupEnv) import System.Posix.Process (executeFile) -import System.Posix.Signals (nullSignal, signalProcess) -import System.Posix.Types (ProcessID) import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace , removeEmptyWorkspace) import XMonad.Actions.GridSelect @@ -65,26 +60,13 @@ myFont = "-schumacher-*-*-*-*-*-*-*-*-*-*-*-iso10646-*" main :: IO () main = getArgs >>= \case [] -> mainNoArgs - ["--shutdown", pidArg] -> mainShutdown (read pidArg) + ["--shutdown"] -> shutdown args -> hPutStrLn stderr ("bad arguments: " <> show args) >> exitFailure -mainShutdown :: ProcessID -> IO () -mainShutdown pid = do - sendShutdownEvent - hPutStrLn stderr ("waiting for: " <> show pid) - result <- tryIOError (waitProcess pid) - if isSuccess result - then hPutStrLn stderr ("result: " <> show result <> " [AKA success^_^]") - else hPutStrLn stderr ("result: " <> show result) - where - isSuccess = either isDoesNotExistError (const False) - -waitProcess :: ProcessID -> IO () -waitProcess pid = forever (signalProcess nullSignal pid >> threadDelay 10000) - mainNoArgs :: IO () mainNoArgs = do workspaces0 <- getWorkspaces0 + handleShutdownEvent <- newShutdownEventHandler xmonad $ withUrgencyHook (SpawnUrgencyHook "echo emit Urgency ") $ def |