summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Config
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xmobar/Config')
-rw-r--r--src/Xmobar/Config/Parse.hs2
-rw-r--r--src/Xmobar/Config/Types.hs13
2 files changed, 14 insertions, 1 deletions
diff --git a/src/Xmobar/Config/Parse.hs b/src/Xmobar/Config/Parse.hs
index 056f3fc..48a31c3 100644
--- a/src/Xmobar/Config/Parse.hs
+++ b/src/Xmobar/Config/Parse.hs
@@ -57,7 +57,7 @@ parseConfig defaultConfig =
x <- perms
eof
s <- getState
- return (x,s)
+ return (x (SignalChan Nothing),s)
perms = permute $ Config
<$?> pFont <|?> pFontList <|?> pWmClass <|?> pWmName
diff --git a/src/Xmobar/Config/Types.hs b/src/Xmobar/Config/Types.hs
index c31e460..3cad31c 100644
--- a/src/Xmobar/Config/Types.hs
+++ b/src/Xmobar/Config/Types.hs
@@ -17,9 +17,12 @@ module Xmobar.Config.Types
-- $config
Config (..)
, XPosition (..), Align (..), Border(..)
+ , SignalChan (..)
) where
+import qualified Control.Concurrent.STM as STM
import Xmobar.Run.Runnable (Runnable(..))
+import Xmobar.System.Signal (SignalType)
-- $config
-- Configuration data type
@@ -65,6 +68,7 @@ data Config =
-- right text alignment
, template :: String -- ^ The output template
, verbose :: Bool -- ^ Emit additional debug messages
+ , signal :: SignalChan -- ^ The signal channel used to send signals to xmobar
} deriving (Read, Show)
data XPosition = Top
@@ -91,3 +95,12 @@ data Border = NoBorder
| BottomBM Int
| FullBM Int
deriving ( Read, Show, Eq )
+
+newtype SignalChan = SignalChan { unSignalChan :: Maybe (STM.TMVar SignalType) }
+
+instance Read SignalChan where
+ readsPrec _ s = [ (SignalChan Nothing, s) ]
+
+instance Show SignalChan where
+ show (SignalChan (Just _)) = "SignalChan (Just <tmvar>)"
+ show (SignalChan Nothing) = "SignalChan Nothing"