diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2022-11-21 20:21:20 -0700 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-11-21 20:21:20 -0700 |
| commit | e76a1c089951a72055bc8fc35808ccfa8988ddec (patch) | |
| tree | 197df493396e594c4bd275f5b2dc75d7ce1f5ccd /src/Rahm/Desktop/XMobarLog.hs | |
| parent | a1636c65e05d02f7d4fc408137e1d37b412ce890 (diff) | |
| download | rde-e76a1c089951a72055bc8fc35808ccfa8988ddec.tar.gz rde-e76a1c089951a72055bc8fc35808ccfa8988ddec.tar.bz2 rde-e76a1c089951a72055bc8fc35808ccfa8988ddec.zip | |
Add clickable Theaters to xmobar.
Diffstat (limited to 'src/Rahm/Desktop/XMobarLog.hs')
| -rw-r--r-- | src/Rahm/Desktop/XMobarLog.hs | 12 |
1 files changed, 9 insertions, 3 deletions
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 "<fn=1><fc=#ffffff>" - tell n + tell $ toTheaterAction n tell " </fc></fn>" (Just n, _, False) -> do tell "<fn=2><fc=#888888>" - tell n + tell $ toTheaterAction n tell " </fc></fn>" _ -> return () if not (null theaters) - then tell "| " + then tell "<fc=#888888>| </fc>" else return () forM_ wss $ \(t, ws) -> do @@ -94,6 +94,12 @@ xMobarLogHook (XMobarLog xmproc) = do printf "<action=`xdotool key 'Hyper_L+g' '%s'` button=1><action=`xdotool key 'Hyper_L+Shift_L+g' '%s'` button=3>%s</action></action>" [ch] [ch] [ch] toAction ch = ch + toTheaterAction [ch] | isAsciiUpper ch || + isAsciiLower ch || + isDigit ch = + printf "<action=`xdotool key 'Hyper_L+Shift_L+g' '%s'` button=1>%s</action>" [ch] [ch] + toTheaterAction ch = ch + toChangeLayoutAction :: String -> String toChangeLayoutAction = printf "<action=`xdotool key Hyper_L+space n` button=1>\ |