diff options
author | joe <joe@jerkface.net> | 2014-03-14 13:09:16 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-03-14 13:09:16 -0400 |
commit | 4685d21a6525062d69f1195ca2683acee55fa303 (patch) | |
tree | 7b56f467beeb3cd565e7051b958bbdf7944dc98c | |
parent | 0e78e2e0329ddf9dffdb0a5b030e21772168f32e (diff) |
Added vt switch reporting to output
-rw-r--r-- | consolation.hs | 6 |
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 | ||
71 | onTTY cs vtnum = atomically $ writeTVar (csActiveTTY cs) vtnum | 71 | onTTY outvar cs vtnum = do |
72 | logit outvar $ "switch: " <> tshow vtnum | ||
73 | atomically $ writeTVar (csActiveTTY cs) vtnum | ||
72 | 74 | ||
73 | retryWhen var pred = do | 75 | retryWhen 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 |