summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-02-19 02:46:06 +0000
committerjao <jao@gnu.org>2022-02-19 02:46:06 +0000
commit2d8b01a88efd2e5f8e976c07bde9a0b71c19f4b7 (patch)
treeaafc25efb5fd394c2ef4a12a09356f781cd1d7e3 /src/Xmobar
parent5492821f70dc5f3646a239fe66d7cb9d5ca76bf7 (diff)
downloadxmobar-2d8b01a88efd2e5f8e976c07bde9a0b71c19f4b7.tar.gz
xmobar-2d8b01a88efd2e5f8e976c07bde9a0b71c19f4b7.tar.bz2
Strip new lines from X log messages (issue #590)
Diffstat (limited to 'src/Xmobar')
-rw-r--r--src/Xmobar/Plugins/XMonadLog.hs4
1 files changed, 3 insertions, 1 deletions
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