diff options
Diffstat (limited to 'src/Xmobar/Plugins/Monitors/Common')
-rw-r--r-- | src/Xmobar/Plugins/Monitors/Common/Run.hs | 14 | ||||
-rw-r--r-- | src/Xmobar/Plugins/Monitors/Common/Types.hs | 5 |
2 files changed, 6 insertions, 13 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Common/Run.hs b/src/Xmobar/Plugins/Monitors/Common/Run.hs index 9b0c1b7..076ac07 100644 --- a/src/Xmobar/Plugins/Monitors/Common/Run.hs +++ b/src/Xmobar/Plugins/Monitors/Common/Run.hs @@ -24,7 +24,7 @@ module Xmobar.Plugins.Monitors.Common.Run ( runM , getArgvs , doArgs , computePureConfig - , commonOptions + , pluginOptions ) where import Control.Exception (SomeException,handle) @@ -35,10 +35,8 @@ import System.Console.GetOpt import Xmobar.Plugins.Monitors.Common.Types import Xmobar.Run.Exec (doEveryTenthSeconds) -commonOptions = options - -options :: [OptDescr Opts] -options = +pluginOptions :: [OptDescr Opts] +pluginOptions = [ Option ['H'] ["High"] (ReqArg High "number") "The high threshold" , Option ['L'] ["Low"] (ReqArg Low "number") "The low threshold" @@ -66,7 +64,7 @@ options = -- | Get all argument values out of a list of arguments. getArgvs :: [String] -> [String] getArgvs args = - case getOpt Permute options args of + case getOpt Permute pluginOptions args of (_, n, [] ) -> n (_, _, errs) -> errs @@ -77,7 +75,7 @@ doArgs :: [String] -> ([String] -> Monitor Bool) -> Monitor String doArgs args action detect = - case getOpt Permute options args of + case getOpt Permute pluginOptions args of (o, n, []) -> do doConfigOptions o ready <- detect n if ready @@ -158,6 +156,6 @@ getMConfig args mconfig = do runReaderT (updateOptions args >> ask) config updateOptions :: [String] -> Monitor () -updateOptions args= case getOpt Permute options args of +updateOptions args= case getOpt Permute pluginOptions args of (o, _, []) -> doConfigOptions o _ -> return () diff --git a/src/Xmobar/Plugins/Monitors/Common/Types.hs b/src/Xmobar/Plugins/Monitors/Common/Types.hs index e8e9bfd..f1d85c9 100644 --- a/src/Xmobar/Plugins/Monitors/Common/Types.hs +++ b/src/Xmobar/Plugins/Monitors/Common/Types.hs @@ -22,7 +22,6 @@ module Xmobar.Plugins.Monitors.Common.Types ( Monitor , Opts (..) , Selector , setConfigValue - , getConfigValue , mkMConfig , io , PureConfig (..) @@ -135,10 +134,6 @@ sel s = do hs <- ask liftIO $ readIORef (s hs) -pmods :: PureConfig -> PSelector a -> (a -> a) -> a -pmods config value f = let val = value config - in f val - mods :: Selector a -> (a -> a) -> Monitor () mods s m = do v <- ask |