summaryrefslogtreecommitdiffhomepage
path: root/Plugins/Monitors/Common.hs
diff options
context:
space:
mode:
authorJose A Ortega Ruiz <jao@gnu.org>2010-02-12 01:38:29 +0100
committerJose A Ortega Ruiz <jao@gnu.org>2010-02-12 01:38:29 +0100
commit626d76aeee415ebd4f0fbb4f8740f206de2ec7d3 (patch)
tree1b1c275bf4db7eba339e5d8d35bdc7d23303b809 /Plugins/Monitors/Common.hs
parent3b7bfcdefdfdd1dce75b379cea16b33e5a34653b (diff)
downloadxmobar-626d76aeee415ebd4f0fbb4f8740f206de2ec7d3.tar.gz
xmobar-626d76aeee415ebd4f0fbb4f8740f206de2ec7d3.tar.bz2
New monitor argument to set both max and min widths (-w)
Ignore-this: 27650f63b928ee0ae2bf4d4bf19919e5 darcs-hash:20100212003829-748be-c8d9c4bdc4e8b42f6a929f16d1c4aafc65421ec0.gz
Diffstat (limited to 'Plugins/Monitors/Common.hs')
-rw-r--r--Plugins/Monitors/Common.hs24
1 files changed, 14 insertions, 10 deletions
diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs
index 6729397..2d35a71 100644
--- a/Plugins/Monitors/Common.hs
+++ b/Plugins/Monitors/Common.hs
@@ -132,21 +132,23 @@ data Opts = HighColor String
| PercentPad String
| MinWidth String
| MaxWidth String
+ | Width String
| PadChars String
| PadAlign String
options :: [OptDescr Opts]
options =
- [ Option ['H'] ["High"] (ReqArg High "number" ) "The high threshold"
- , Option ['L'] ["Low"] (ReqArg Low "number" ) "The low threshold"
- , Option ['h'] ["high"] (ReqArg HighColor "color number" ) "Color for the high threshold: ex \"#FF0000\""
- , Option ['n'] ["normal"] (ReqArg NormalColor "color number" ) "Color for the normal threshold: ex \"#00FF00\""
- , Option ['l'] ["low"] (ReqArg LowColor "color number" ) "Color for the low threshold: ex \"#0000FF\""
- , Option ['t'] ["template"] (ReqArg Template "output template" ) "Output template."
- , Option ['p'] ["ppad"] (ReqArg PercentPad "percent padding" ) "Minimum percentage width."
- , Option ['m'] ["minwidth"] (ReqArg MinWidth "minimum width") "Minimum field width"
- , Option ['M'] ["maxwidth"] (ReqArg MaxWidth "maximum width") "Maximum field width"
- , Option ['c'] ["padchars"] (ReqArg PadChars "padding chars") "Characters to use for padding"
+ [ Option ['H'] ["High"] (ReqArg High "number" ) "The high threshold"
+ , Option ['L'] ["Low"] (ReqArg Low "number" ) "The low threshold"
+ , Option ['h'] ["high"] (ReqArg HighColor "color number" ) "Color for the high threshold: ex \"#FF0000\""
+ , Option ['n'] ["normal"] (ReqArg NormalColor "color number" ) "Color for the normal threshold: ex \"#00FF00\""
+ , Option ['l'] ["low"] (ReqArg LowColor "color number" ) "Color for the low threshold: ex \"#0000FF\""
+ , Option ['t'] ["template"] (ReqArg Template "output template" ) "Output template."
+ , Option ['p'] ["ppad"] (ReqArg PercentPad "percent padding") "Minimum percentage width."
+ , Option ['m'] ["minwidth"] (ReqArg MinWidth "minimum width" ) "Minimum field width"
+ , Option ['M'] ["maxwidth"] (ReqArg MaxWidth "maximum width" ) "Maximum field width"
+ , Option ['w'] ["width"] (ReqArg Width "fixed width" ) "Fixed field width"
+ , Option ['c'] ["padchars"] (ReqArg PadChars "padding chars" ) "Characters to use for padding"
, Option ['a'] ["align"] (ReqArg PadAlign "padding alignment") "'l' for left padding, 'r' for right"
]
@@ -174,6 +176,8 @@ doConfigOptions (o:oo) =
PercentPad p -> setConfigValue (nz p) ppad >> next
MinWidth mn -> setConfigValue (nz mn) minWidth >> next
MaxWidth mx -> setConfigValue (nz mx) maxWidth >> next
+ Width w -> setConfigValue (nz w) minWidth >>
+ setConfigValue (nz w) maxWidth >> next
PadChars pc -> setConfigValue pc padChars >> next
PadAlign pa -> setConfigValue (isPrefixOf "r" pa) padRight >> next