diff options
author | Jochen Keil <jochen.keil@gmail.com> | 2012-08-10 08:42:32 +0200 |
---|---|---|
committer | Jochen Keil <jochen.keil@gmail.com> | 2012-08-10 08:42:32 +0200 |
commit | 509eee4e98b5a9a1362a87f0d88e317d08b4dec2 (patch) | |
tree | 3ea184cb8fe55e20bc96a544197e32f86a95f628 | |
parent | 5074fdf2d6aa85ce17ad98112ec5019eb05a39c4 (diff) | |
download | xmobar-509eee4e98b5a9a1362a87f0d88e317d08b4dec2.tar.gz xmobar-509eee4e98b5a9a1362a87f0d88e317d08b4dec2.tar.bz2 |
New SignalType TogglePersistent
By sending a TogglePersistent signal the configuration option
"persistent" can be changed. Thus it is possible to hide or show xmobar
constantly.
-rw-r--r-- | src/Signal.hs | 1 | ||||
-rw-r--r-- | src/Xmobar.hs | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/Signal.hs b/src/Signal.hs index 0acdea1..ad19fdd 100644 --- a/src/Signal.hs +++ b/src/Signal.hs @@ -16,6 +16,7 @@ data SignalType = Wakeup | Hide | Reveal | Toggle + | TogglePersistent deriving (Read, Show) -- | Signal handling diff --git a/src/Xmobar.hs b/src/Xmobar.hs index 1ae55bb..adbe956 100644 --- a/src/Xmobar.hs +++ b/src/Xmobar.hs @@ -144,6 +144,9 @@ eventLoop tv xc@(XConf d _ w fs cfg) signal = do Reveal -> reveal Toggle -> toggle + TogglePersistent -> eventLoop + tv xc { config = cfg { persistent = not $ persistent cfg } } signal + where isPersistent = not $ persistent cfg |