diff options
| author | Josh Rahm <rahm@google.com> | 2021-11-04 10:44:49 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-10-09 12:19:45 -0600 |
| commit | bce86b0bb2b863a75cfb570b4d049d8105e1b9a5 (patch) | |
| tree | 19ab542802561a25d6714a11cd78382034d58d71 | |
| parent | 8c1296e7e66e78ca78d824b67f0b334e3c981edb (diff) | |
| download | rde-bce86b0bb2b863a75cfb570b4d049d8105e1b9a5.tar.gz rde-bce86b0bb2b863a75cfb570b4d049d8105e1b9a5.tar.bz2 rde-bce86b0bb2b863a75cfb570b4d049d8105e1b9a5.zip | |
Remove extra log. Change trunc to be TCO-able.
| -rw-r--r-- | extras/HOME/.xmobarrc | 2 | ||||
| -rw-r--r-- | src/Main.hs | 29 |
2 files changed, 13 insertions, 18 deletions
diff --git a/extras/HOME/.xmobarrc b/extras/HOME/.xmobarrc index 5a5d4a4..5f4af3c 100644 --- a/extras/HOME/.xmobarrc +++ b/extras/HOME/.xmobarrc @@ -57,7 +57,7 @@ Config "--high", "red" ] 10, Run WeatherX "KLMO" - [ ("clear", "<fc=#00a3c4>") + [ ("clear", "<fc=#ddcf04>") , ("sunny", "<fc=#ddcf04>") , ("mostly clear", "<fc=#00a3c4>") , ("mostly sunny", "<fc=#ddcf04>") diff --git a/src/Main.hs b/src/Main.hs index 9785b52..e18c1d8 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -49,11 +49,6 @@ main = do xmproc <- spawnPipe "xmobar" hSetEncoding xmproc utf8 - logFile <- openFile "/tmp/xmonad.log" WriteMode - - hPutStrLn logFile "·······························" - hFlush logFile - config <- applyKeys $ def { terminal = "alacritty" @@ -101,7 +96,7 @@ main = do tell " </fc></fn>" tell $ xmobarColor "#404040" "" "│ " - tell $ "<fc=#808080><fn=3>" + tell $ "<fc=#a0a0a0><fn=3>" tell $ title tell $ "</fn></fc>" } @@ -111,22 +106,22 @@ main = do xmonad (docks config) where - trunc amt str = trunc' False amt str - - trunc' :: Bool -> Int -> String -> String - trunc' _ _ [] = [] - trunc' ignore amt (a:as) = + trunc amt str = reverse $ trunc' False amt str [] + + trunc' :: Bool -> Int -> String -> String -> String + trunc' _ _ [] acc = acc + trunc' ignore amt (a:as) acc = case a of - '<' -> a : trunc' True amt as - '>' -> a : trunc' False amt as + '<' -> trunc' True amt as (a : acc) + '>' -> trunc' False amt as (a : acc) _ -> if ignore - then a : trunc' True amt as + then trunc' True amt as (a : acc) else case amt of - 0 -> trunc' False 0 as - 3 -> "..." ++ trunc' False 0 as - _ -> a : trunc' False (amt - 1) as + 0 -> trunc' False 0 as acc + 3 -> trunc' False 0 as ("..." ++ acc) + _ -> trunc' False (amt - 1) as (a : acc) splitOnAll arr str = splitOnAll' arr [str] splitOnAll' [] str = str |