aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/XMobarLog.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-04-22 18:03:27 -0600
committerJosh Rahm <rahm@google.com>2022-04-22 18:03:27 -0600
commit32a394483e5d8f571b27a70f9a7156cae1ed6180 (patch)
treef2fab1c1edeb5d7de92e7de1ab5f5b85b91fe057 /src/Rahm/Desktop/XMobarLog.hs
parent7dfbd2e4bc893f7527f9cc4ebf9c474ddfb0dc65 (diff)
downloadrde-32a394483e5d8f571b27a70f9a7156cae1ed6180.tar.gz
rde-32a394483e5d8f571b27a70f9a7156cae1ed6180.tar.bz2
rde-32a394483e5d8f571b27a70f9a7156cae1ed6180.zip
Run hlint
Diffstat (limited to 'src/Rahm/Desktop/XMobarLog.hs')
-rw-r--r--src/Rahm/Desktop/XMobarLog.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Rahm/Desktop/XMobarLog.hs b/src/Rahm/Desktop/XMobarLog.hs
index 6ec4ac7..629e021 100644
--- a/src/Rahm/Desktop/XMobarLog.hs
+++ b/src/Rahm/Desktop/XMobarLog.hs
@@ -6,6 +6,7 @@ import Control.Monad.Writer (tell, execWriter)
import Data.List (sortBy)
import Data.Maybe (mapMaybe)
import Data.Ord (comparing)
+import Data.Char (isAsciiLower, isAsciiUpper, isDigit)
import Rahm.Desktop.Layout.Draw (drawLayout)
import System.IO (Handle, hSetEncoding, hPutStrLn, utf8)
import XMonad.Util.NamedWindows (getName)
@@ -48,7 +49,7 @@ xMobarLogHook (XMobarLog xmproc) = do
let log = trunc 80 $ execWriter $ do
tell " "
tell layoutXpm
- tell $ " "
+ tell " "
tell $ logLevelToXMobar loglevel
forM_ wss $ \(t, ws) -> do
@@ -60,17 +61,17 @@ xMobarLogHook (XMobarLog xmproc) = do
tell $ toAction $ S.tag ws
tell " </fc></fn>"
- tell $ " <fc=#ff8888><fn=3>"
- tell $ title
- tell $ "</fn></fc>"
+ tell " <fc=#ff8888><fn=3>"
+ tell title
+ tell "</fn></fc>"
logs Trace "XMobar: %s" log
X.io $ hPutStrLn xmproc log
where
- toAction [ch] | (ch >= 'A' && ch <= 'Z') ||
- (ch >= 'a' && ch <= 'z') ||
- (ch >= '0' && ch <= '9') =
+ toAction [ch] | (isAsciiUpper ch) ||
+ (isAsciiLower ch) ||
+ (isDigit ch) =
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