From e76a1c089951a72055bc8fc35808ccfa8988ddec Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Mon, 21 Nov 2022 20:21:20 -0700 Subject: Add clickable Theaters to xmobar. --- src/Rahm/Desktop/XMobarLog.hs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/Rahm/Desktop/XMobarLog.hs') diff --git a/src/Rahm/Desktop/XMobarLog.hs b/src/Rahm/Desktop/XMobarLog.hs index e419739..6cf4364 100644 --- a/src/Rahm/Desktop/XMobarLog.hs +++ b/src/Rahm/Desktop/XMobarLog.hs @@ -57,18 +57,18 @@ xMobarLogHook (XMobarLog xmproc) = do forM_ theaters $ \theater -> case theater of (Just n, _, True) -> do tell "" - tell n + tell $ toTheaterAction n tell " " (Just n, _, False) -> do tell "" - tell n + tell $ toTheaterAction n tell " " _ -> return () if not (null theaters) - then tell "| " + then tell "| " else return () forM_ wss $ \(t, ws) -> do @@ -94,6 +94,12 @@ xMobarLogHook (XMobarLog xmproc) = do printf "%s" [ch] [ch] [ch] toAction ch = ch + toTheaterAction [ch] | isAsciiUpper ch || + isAsciiLower ch || + isDigit ch = + printf "%s" [ch] [ch] + toTheaterAction ch = ch + toChangeLayoutAction :: String -> String toChangeLayoutAction = printf "\ -- cgit