diff options
| author | Josh Rahm <rahm@google.com> | 2022-04-22 18:03:27 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-10-09 12:19:46 -0600 |
| commit | 92deb70d1268317e3b80c8c28e0358f0c9064f3e (patch) | |
| tree | f2fab1c1edeb5d7de92e7de1ab5f5b85b91fe057 /src/Rahm/Desktop/XMobarLog.hs | |
| parent | bba296cf93d9e5284dd3dc397a3f73114e25c03f (diff) | |
| download | rde-92deb70d1268317e3b80c8c28e0358f0c9064f3e.tar.gz rde-92deb70d1268317e3b80c8c28e0358f0c9064f3e.tar.bz2 rde-92deb70d1268317e3b80c8c28e0358f0c9064f3e.zip | |
Run hlint
Diffstat (limited to 'src/Rahm/Desktop/XMobarLog.hs')
| -rw-r--r-- | src/Rahm/Desktop/XMobarLog.hs | 15 |
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 |