summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/System
diff options
context:
space:
mode:
authorJohn Soo <jsoo1@asu.edu>2021-09-17 11:31:56 -0700
committerJohn Soo <jsoo1@asu.edu>2021-11-07 17:47:47 -0800
commitb2d9ca5a587c62ee38d04766689f19d3d4a13c1b (patch)
tree2c42b65e83c6ecfbb70f475a2318239a8f2f841e /src/Xmobar/System
parent397953f1c626a3a81b9ef7280d961fb3ce340c56 (diff)
downloadxmobar-b2d9ca5a587c62ee38d04766689f19d3d4a13c1b.tar.gz
xmobar-b2d9ca5a587c62ee38d04766689f19d3d4a13c1b.tar.bz2
Let xmobar be used with a signal TMVar when used from other haskell.
Diffstat (limited to 'src/Xmobar/System')
-rw-r--r--src/Xmobar/System/Signal.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Xmobar/System/Signal.hs b/src/Xmobar/System/Signal.hs
index ce39e10..3983654 100644
--- a/src/Xmobar/System/Signal.hs
+++ b/src/Xmobar/System/Signal.hs
@@ -60,12 +60,11 @@ parseSignalType :: String -> Maybe SignalType
parseSignalType = fmap fst . safeHead . reads
-- | Signal handling
-setupSignalHandler :: IO (TMVar SignalType)
-setupSignalHandler = do
- tid <- newEmptyTMVarIO
+setupSignalHandler :: TMVar SignalType -> IO ()
+setupSignalHandler tid = do
installHandler sigUSR2 (Catch $ updatePosHandler tid) Nothing
installHandler sigUSR1 (Catch $ changeScreenHandler tid) Nothing
- return tid
+ return ()
updatePosHandler :: TMVar SignalType -> IO ()
updatePosHandler sig = do