aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extras/HOME/.xmobarrc4
-rw-r--r--src/Rahm/Desktop/XMobarLog.hs12
2 files changed, 13 insertions, 3 deletions
diff --git a/extras/HOME/.xmobarrc b/extras/HOME/.xmobarrc
index 7461de8..aa252f7 100644
--- a/extras/HOME/.xmobarrc
+++ b/extras/HOME/.xmobarrc
@@ -29,13 +29,13 @@ Config
, alignSep = "}{"
, template =
" %logo% <fc=#a0a0a0><fn=3>%uname%</fn></fc><fc=#404040> │\
- \</fc>%StdinReader%}\
+ \</fc>%UnsafeStdinReader%}\
\{ %cpu% %memory% <fc=#404040>\
\│</fc> %weather% <fc=#404040>│\
\</fc> <fc=#a0a0a0>%media%</fc> <fc=#404040>│ \
\</fc>%bluetooth%%bat% <fc=#404040>│</fc> <fn=2><fc=#606060>%time%</fc></fn> "
, commands = [
- Run StdinReader,
+ Run UnsafeStdinReader,
Run Date "%m/%d %H:%M:%S" "time" 10,
Run Cpu [
"-t", "<fn=3><fc=#000000><bar></fc></fn>",
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.