summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins/Monitors/Common/Types.hs
diff options
context:
space:
mode:
authorSibi Prabakaran <sibi@psibi.in>2020-06-20 21:39:02 +0530
committerjao <jao@gnu.org>2020-06-23 16:38:20 +0100
commit28ea8d95137131e81c836ed2d446f8925518e85c (patch)
tree16f823a3d81a4bbb22861ce46d869391ab679574 /src/Xmobar/Plugins/Monitors/Common/Types.hs
parent148f1083c45bc66112ff18d44f4d2a43d891c5ca (diff)
downloadxmobar-28ea8d95137131e81c836ed2d446f8925518e85c.tar.gz
xmobar-28ea8d95137131e81c836ed2d446f8925518e85c.tar.bz2
Update based on feedback on the PR
Diffstat (limited to 'src/Xmobar/Plugins/Monitors/Common/Types.hs')
-rw-r--r--src/Xmobar/Plugins/Monitors/Common/Types.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Common/Types.hs b/src/Xmobar/Plugins/Monitors/Common/Types.hs
index a2d5eb4..d09da8e 100644
--- a/src/Xmobar/Plugins/Monitors/Common/Types.hs
+++ b/src/Xmobar/Plugins/Monitors/Common/Types.hs
@@ -24,10 +24,10 @@ module Xmobar.Plugins.Monitors.Common.Types ( Monitor
, setConfigValue
, mkMConfig
, io
- , PureConfig (..)
+ , MonitorConfig (..)
, getPConfigValue
, getConfigValue
- , getPureConfig
+ , getMonitorConfig
, PSelector
, TemplateInput(..)
) where
@@ -71,8 +71,8 @@ data MConfig =
, maxTotalWidthEllipsis :: IORef String
}
-data PureConfig =
- PureConfig
+data MonitorConfig =
+ MonitorConfig
{ pNormalColor :: Maybe String
, pLow :: Int
, pLowColor :: Maybe String
@@ -97,8 +97,8 @@ data PureConfig =
}
deriving (Eq, Ord)
-getPureConfig :: MConfig -> IO PureConfig
-getPureConfig MC{..} = do
+getMonitorConfig :: MConfig -> IO MonitorConfig
+getMonitorConfig MC{..} = do
pNormalColor <- readIORef normalColor
pLow <- readIORef low
pLowColor <- readIORef lowColor
@@ -120,13 +120,13 @@ getPureConfig MC{..} = do
pNaString <- readIORef naString
pMaxTotalWidth <- readIORef maxTotalWidth
pMaxTotalWidthEllipsis <- readIORef maxTotalWidthEllipsis
- pure $ PureConfig {..}
+ pure $ MonitorConfig {..}
-- | from 'http:\/\/www.haskell.org\/hawiki\/MonadState'
type Selector a = MConfig -> IORef a
-type PSelector a = PureConfig -> a
+type PSelector a = MonitorConfig -> a
-psel :: PureConfig -> PSelector a -> a
+psel :: MonitorConfig -> PSelector a -> a
psel value accessor = accessor value
sel :: Selector a -> Monitor a
@@ -146,7 +146,7 @@ setConfigValue v s =
getConfigValue :: Selector a -> Monitor a
getConfigValue = sel
-getPConfigValue :: PureConfig -> PSelector a -> a
+getPConfigValue :: MonitorConfig -> PSelector a -> a
getPConfigValue = psel
mkMConfig :: String