1
0
Fork 0

Nicer notifications display

This commit is contained in:
Malte 2023-03-12 13:25:03 +01:00
parent d2e4667b5c
commit b8b63ef974

View file

@ -262,7 +262,7 @@ main = do
, simpleModule (1 * oneSecond) do
now <- Time.getCurrentTime
notifications <- lines . decodeUtf8 . ByteString.strip . fromRight "" <$> Exception.try @Exception.IOException (readFileBS [i|/home/maralorn/.notifications/#{Time.formatTime Time.defaultTimeLocale "%Y-%m-%d" now}.log|])
when' (not $ null notifications) $ withColor red $ Text.strip $ Text.intercalate [i|\n$color1$hr${color \##{red}}\n|] $ fmap (unwords . drop 3 . Text.splitOn "|") notifications
when' (not $ null notifications) $ withColor red $ Text.strip $ Text.intercalate [i|\n$color1$hr${color \##{red}}\n|] $ fmap (Text.intercalate ":${color0} " . drop 3 . Text.splitOn "|") notifications
]
foldConcurrently_
[ void $ simpleModule oneSecond (getMode home) mode_var