aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/XMobarLog.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-11-21 22:14:50 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-11-21 22:14:50 -0700
commit80057a6ed33f07f3a91a7a1d3552b222804b5d9e (patch)
tree249b2cda2074991adead57843d77db9d475bb514 /src/Rahm/Desktop/XMobarLog.hs
parent8888a83ef06d16d4bdd3c06bef721fff43f04175 (diff)
downloadrde-80057a6ed33f07f3a91a7a1d3552b222804b5d9e.tar.gz
rde-80057a6ed33f07f3a91a7a1d3552b222804b5d9e.tar.bz2
rde-80057a6ed33f07f3a91a7a1d3552b222804b5d9e.zip
Rudimentary pending buffer shown in Xmobar.
Diffstat (limited to 'src/Rahm/Desktop/XMobarLog.hs')
-rw-r--r--src/Rahm/Desktop/XMobarLog.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Rahm/Desktop/XMobarLog.hs b/src/Rahm/Desktop/XMobarLog.hs
index dbe4808..05f6f21 100644
--- a/src/Rahm/Desktop/XMobarLog.hs
+++ b/src/Rahm/Desktop/XMobarLog.hs
@@ -12,6 +12,7 @@ import Rahm.Desktop.Logger
import qualified Rahm.Desktop.StackSet as S
import Rahm.Desktop.Theater (getTheaters)
import Rahm.Desktop.Workspaces (WorkspaceState (..), getPopulatedWorkspaces)
+import Rahm.Desktop.XMobarLog.PendingBuffer (getPendingBuffer)
import System.IO (Handle, hPutStrLn, hSetEncoding, utf8)
import Text.Printf
import XMonad (X)
@@ -44,6 +45,7 @@ xMobarLogHook (XMobarLog xmproc) = do
winset <- X.gets X.windowset
title <- maybe (pure "") (fmap show . getName) . S.peek $ winset
+ pendingBuffer <- getPendingBuffer
let wss = getPopulatedWorkspaces winset
let log = trunc 80 $
@@ -53,7 +55,7 @@ xMobarLogHook (XMobarLog xmproc) = do
tell " "
tell $ logLevelToXMobar loglevel
- forM_ theaters $ \theater -> case theater of
+ forM_ theaters $ \case
(Just n, _, True) -> do
tell "<fn=1><fc=#ffffff>"
tell $ toTheaterAction n
@@ -62,6 +64,7 @@ xMobarLogHook (XMobarLog xmproc) = do
tell "<fn=2><fc=#888888>"
tell $ toTheaterAction n
tell " </fc></fn>"
+ _ -> return ()
unless (null theaters) $ do
tell "<fc=#888888>| </fc>"
@@ -74,6 +77,10 @@ xMobarLogHook (XMobarLog xmproc) = do
tell $ toAction $ S.tag ws
tell " </fc></fn>"
+ tell " "
+ tell pendingBuffer
+ tell " "
+
tell " <fc=#ff8888><fn=3>"
tell title
tell "</fn></fc>"