summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2018-11-29 21:24:31 +0100
committertv <tv@krebsco.de>2018-11-29 21:56:52 +0100
commit53359a60f5f0114b013c6241b52aa7387d1b922a (patch)
tree4391ec7281e0d85a8a371278b18aca70cbfb8fde /tv/5pkgs
parent95f6255f586e93e096d56de75add76d7560b9df1 (diff)
xmonad-stockholm: 1.2.0 -> 1.3.0
Diffstat (limited to 'tv/5pkgs')
-rw-r--r--tv/5pkgs/simple/xmonad-tv/default.nix22
1 files changed, 2 insertions, 20 deletions
diff --git a/tv/5pkgs/simple/xmonad-tv/default.nix b/tv/5pkgs/simple/xmonad-tv/default.nix
index ab4be91f3..edfee98a0 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