summaryrefslogtreecommitdiff
path: root/consolation.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-03-14 13:09:16 -0400
committerjoe <joe@jerkface.net>2014-03-14 13:09:16 -0400
commit4685d21a6525062d69f1195ca2683acee55fa303 (patch)
tree7b56f467beeb3cd565e7051b958bbdf7944dc98c /consolation.hs
parent0e78e2e0329ddf9dffdb0a5b030e21772168f32e (diff)
Added vt switch reporting to output
Diffstat (limited to 'consolation.hs')
-rw-r--r--consolation.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/consolation.hs b/consolation.hs
index 2b181dc1..0c576dfc 100644
--- a/consolation.hs
+++ b/consolation.hs
@@ -68,7 +68,9 @@ onLogin cs start = \e -> do
68 forkIO . start getActive 68 forkIO . start getActive
69 -- forM_ (Map.elems dead ) $ putStrLn . ("gone: "++) . show 69 -- forM_ (Map.elems dead ) $ putStrLn . ("gone: "++) . show
70 70
71onTTY cs vtnum = atomically $ writeTVar (csActiveTTY cs) vtnum 71onTTY outvar cs vtnum = do
72 logit outvar $ "switch: " <> tshow vtnum
73 atomically $ writeTVar (csActiveTTY cs) vtnum
72 74
73retryWhen var pred = do 75retryWhen var pred = do
74 value <- var 76 value <- var
@@ -166,7 +168,7 @@ main = do
166 inotify <- initINotify 168 inotify <- initINotify
167 169
168 -- get active tty 170 -- get active tty
169 mtty <- monitorTTY (onTTY cs) 171 mtty <- monitorTTY (onTTY outvar cs)
170 atomically $ retryWhen (readTVar $ csActiveTTY cs) (==0) 172 atomically $ retryWhen (readTVar $ csActiveTTY cs) (==0)
171 173
172 -- read utmp 174 -- read utmp