aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Rahm/Desktop/XMobarLog.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Rahm/Desktop/XMobarLog.hs b/src/Rahm/Desktop/XMobarLog.hs
index 8b0ad72..0f67ed4 100644
--- a/src/Rahm/Desktop/XMobarLog.hs
+++ b/src/Rahm/Desktop/XMobarLog.hs
@@ -12,6 +12,7 @@ import XMonad.Util.NamedWindows (getName)
import XMonad.Util.Run (spawnPipe)
import XMonad (X)
import Rahm.Desktop.Lib (getPopulatedWorkspaces, WorkspaceState(..))
+import Text.Printf
import qualified XMonad as X
import qualified XMonad.StackSet as S
@@ -43,6 +44,7 @@ xMobarLogHook (XMobarLog xmproc) = do
X.liftIO $ do
hPutStrLn xmproc $ trunc 80 $ execWriter $ do
+ tell " "
tell layoutXpm
tell $ "<fc=#404040> │ </fc>"
@@ -51,12 +53,20 @@ xMobarLogHook (XMobarLog xmproc) = do
Current -> tell "<fn=1><fc=#ff8888>"
Visible -> tell "<fn=6><fc=#8888ff>"
Hidden -> tell "<fn=2><fc=#888888>"
- tell (S.tag ws)
+
+ tell $ toAction $ S.tag ws
tell " </fc></fn>"
tell $ "<fc=#404040>│ </fc><fc=#a0a0a0><fn=3>"
tell $ title
tell $ "</fn></fc>"
+
+ where
+ toAction [ch] | (ch >= 'A' && ch <= 'Z') ||
+ (ch >= 'a' && ch <= 'z') ||
+ (ch >= '0' && ch <= '9') =
+ printf "<action=`xdotool key 'Hyper_L+g' '%s'`>%s</action>" [ch] [ch]
+ toAction ch = ch
-- Truncate an XMobar string to the provided number of _visible_ characters.
-- This is to keep long window titles from overrunning the whole bar.