From 2d8b01a88efd2e5f8e976c07bde9a0b71c19f4b7 Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 19 Feb 2022 02:46:06 +0000 Subject: Strip new lines from X log messages (issue #590) --- src/Xmobar/Plugins/XMonadLog.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Xmobar/Plugins/XMonadLog.hs b/src/Xmobar/Plugins/XMonadLog.hs index 4efd585..d887aad 100644 --- a/src/Xmobar/Plugins/XMonadLog.hs +++ b/src/Xmobar/Plugins/XMonadLog.hs @@ -30,6 +30,7 @@ import Codec.Binary.UTF8.String as UTF8 #endif import Foreign.C (CChar) +import Data.List (intercalate) import Xmobar.X11.Events (nextEvent') data XMonadLog = XMonadLog @@ -56,11 +57,12 @@ instance Exec XMonadLog where UnsafeXPropertyLog a -> a NamedXPropertyLog a _ -> a UnsafeNamedXPropertyLog a _ -> a + stripNL = intercalate " - " . lines sanitize = case x of UnsafeXMonadLog -> id UnsafeXPropertyLog _ -> id UnsafeNamedXPropertyLog _ _ -> id - _ -> stripActions + _ -> stripActions . stripNL d <- openDisplay "" xlog <- internAtom d atom False -- cgit v1.2.3