From 5074fdf2d6aa85ce17ad98112ec5019eb05a39c4 Mon Sep 17 00:00:00 2001 From: Jochen Keil Date: Fri, 10 Aug 2012 08:36:03 +0200 Subject: New configuration option "persistent" When persistent is set to True then xmobar will always be mapped (revealed) and never be hidden. The flag is checked in eventLoop and operation to map/unmap windows is not carried out if persistence is desired. --- src/Xmobar.hs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/Xmobar.hs') diff --git a/src/Xmobar.hs b/src/Xmobar.hs index a65a236..1ae55bb 100644 --- a/src/Xmobar.hs +++ b/src/Xmobar.hs @@ -145,11 +145,17 @@ eventLoop tv xc@(XConf d _ w fs cfg) signal = do Toggle -> toggle where - hide = hideWindow d w >> eventLoop tv xc signal - reveal = do - r' <- repositionWin d w fs cfg - showWindow d w - eventLoop tv (XConf d r' w fs cfg) signal + isPersistent = not $ persistent cfg + + hide = when isPersistent (hideWindow d w) >> eventLoop tv xc signal + + reveal = if isPersistent + then do + r' <- repositionWin d w fs cfg + showWindow d w + eventLoop tv (XConf d r' w fs cfg) signal + else eventLoop tv xc signal + toggle = isMapped d w >>= \b -> if b then hide else reveal reposWindow rcfg = do -- cgit v1.2.3