summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Config/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xmobar/Config/Types.hs')
-rw-r--r--src/Xmobar/Config/Types.hs23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/Xmobar/Config/Types.hs b/src/Xmobar/Config/Types.hs
index 3f2297f..a448d5d 100644
--- a/src/Xmobar/Config/Types.hs
+++ b/src/Xmobar/Config/Types.hs
@@ -1,6 +1,6 @@
-----------------------------------------------------------------------------
-- |
--- Module : Xmobar.Config
+-- Module : Xmobar.Config.Types
-- Copyright : (c) Andrea Rossato
-- License : BSD-style (see LICENSE)
--
@@ -13,12 +13,9 @@
-----------------------------------------------------------------------------
module Xmobar.Config.Types
- ( -- * Configuration
- -- $config
- Config (..)
+ ( Config (..)
, XPosition (..), Align (..), Border (..), TextOutputFormat (..)
- , SignalChan (..)
- , indexedFont, indexedOffset
+ , FontIndex, SignalChan (..)
) where
import qualified Control.Concurrent.STM as STM
@@ -71,19 +68,9 @@ 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
+ , signal :: SignalChan -- ^ The signal channel to send signals to xmobar
} deriving (Read, Show)
-indexedFont :: Config -> Int -> String
-indexedFont config idx =
- if idx < 1 || idx > length (additionalFonts config)
- then font config else additionalFonts config !! (idx - 1)
-
-indexedOffset :: Config -> Int -> Int
-indexedOffset config idx =
- if idx < 1 || idx > length (textOffsets config)
- then textOffset config else textOffsets config !! (idx - 1)
-
data XPosition = Top
| TopH Int
| TopW Align Int
@@ -111,6 +98,8 @@ data Border = NoBorder
data TextOutputFormat = Plain | Ansi | Pango | Swaybar deriving (Read, Show, Eq)
+type FontIndex = Int
+
newtype SignalChan = SignalChan { unSignalChan :: Maybe (STM.TMVar SignalType) }
instance Read SignalChan where