diff options
author | slotThe <soliditsallgood@tuta.io> | 2019-10-14 11:21:26 +0200 |
---|---|---|
committer | slotThe <soliditsallgood@tuta.io> | 2019-10-14 12:19:42 +0200 |
commit | 3891e8ca2804df0a69a4bccbceb99403c70fbfe6 (patch) | |
tree | 201adf6199c474ba650a242dd5b5b2d86c9840aa | |
parent | 1fb356814315ac362218fddfa06a9f8bf7577403 (diff) | |
download | xmobar-3891e8ca2804df0a69a4bccbceb99403c70fbfe6.tar.gz xmobar-3891e8ca2804df0a69a4bccbceb99403c70fbfe6.tar.bz2 |
Add types for percentage based volume control
-rw-r--r-- | src/Xmobar/Plugins/Monitors/Volume.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Volume.hs b/src/Xmobar/Plugins/Monitors/Volume.hs index 05c12d1..250918a 100644 --- a/src/Xmobar/Plugins/Monitors/Volume.hs +++ b/src/Xmobar/Plugins/Monitors/Volume.hs @@ -42,6 +42,8 @@ data VolumeOpts = VolumeOpts , highDbThresh :: Float , lowDbThresh :: Float , volumeIconPattern :: Maybe IconPattern + , lowVolThresh :: Maybe Float + , highVolThresh :: Maybe Float } defaultOpts :: VolumeOpts @@ -53,6 +55,8 @@ defaultOpts = VolumeOpts , highDbThresh = -5.0 , lowDbThresh = -30.0 , volumeIconPattern = Nothing + , lowVolThresh = Just 20 + , highVolThresh = Just 60 } options :: [OptDescr (VolumeOpts -> VolumeOpts)] @@ -65,6 +69,8 @@ options = , Option "c" ["offc"] (ReqArg (\x o -> o { offColor = Just x }) "") "" , Option "" ["volume-icon-pattern"] (ReqArg (\x o -> o { volumeIconPattern = Just $ parseIconPattern x }) "") "" + , Option "L" ["lowv"] (ReqArg (\x o -> o { lowVolThresh = Just $ read x }) "") "" + , Option "H" ["highv"] (ReqArg (\x o -> o { highVolThresh = Just $ read x }) "") "" ] parseOpts :: [String] -> IO VolumeOpts |