summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors
diff options
context:
space:
mode:
authorEric Mrak <mail@ericmrak.info>2014-03-13 23:43:08 -0700
committerEric Mrak <mail@ericmrak.info>2014-03-13 23:43:08 -0700
commit91f48b568ffd287097fd41a7dca7fce5b9cc48f4 (patch)
tree98ab85984b633793698150e7e66c6bb62e4f4799 /src/Plugins/Monitors
parent4e734b02da0eeffa14bf5960e92f4e7dcdac23dd (diff)
downloadxmobar-91f48b568ffd287097fd41a7dca7fce5b9cc48f4.tar.gz
xmobar-91f48b568ffd287097fd41a7dca7fce5b9cc48f4.tar.bz2
Volume module has volumevbar
Diffstat (limited to 'src/Plugins/Monitors')
-rw-r--r--src/Plugins/Monitors/Volume.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Plugins/Monitors/Volume.hs b/src/Plugins/Monitors/Volume.hs
index 024292f..d7122d1 100644
--- a/src/Plugins/Monitors/Volume.hs
+++ b/src/Plugins/Monitors/Volume.hs
@@ -24,7 +24,7 @@ import System.Console.GetOpt
volumeConfig :: IO MConfig
volumeConfig = mkMConfig "Vol: <volume>% <status>"
- ["volume", "volumebar", "dB","status"]
+ ["volume", "volumebar", "volumevbar", "dB","status"]
data VolumeOpts = VolumeOpts
@@ -76,6 +76,10 @@ formatVolBar :: Integer -> Integer -> Integer -> Monitor String
formatVolBar lo hi v =
showPercentBar (100 * x) x where x = percent v lo hi
+formatVolVBar :: Integer -> Integer -> Integer -> Monitor String
+formatVolVBar lo hi v =
+ showVerticalBar (100 * x) where x = percent v lo hi
+
switchHelper :: VolumeOpts
-> (VolumeOpts -> Maybe String)
-> (VolumeOpts -> String)
@@ -119,9 +123,10 @@ runVolume mixerName controlName argv = do
return (lo, hi, val, db, sw)
p <- liftMonitor $ liftM3 formatVol lo hi val
b <- liftMonitor $ liftM3 formatVolBar lo hi val
+ v <- liftMonitor $ liftM3 formatVolVBar lo hi val
d <- getFormatDB opts db
s <- getFormatSwitch opts sw
- parseTemplate [p, b, d, s]
+ parseTemplate [p, b, v, d, s]
where