diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2011-01-15 00:03:43 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2011-01-15 00:03:43 +0100 |
commit | ce23b849f7aff963a1e6a84da5281b6a4aaff241 (patch) | |
tree | 15b49da1d3e30adb5f9a0be06aa34c32543a101e /src/Plugins/Monitors/Volume.hs | |
parent | 6591f7e59909dee011abe1ce9df16d03a797de97 (diff) | |
download | xmobar-ce23b849f7aff963a1e6a84da5281b6a4aaff241.tar.gz xmobar-ce23b849f7aff963a1e6a84da5281b6a4aaff241.tar.bz2 |
Volume monitor: minor linting and file header
Diffstat (limited to 'src/Plugins/Monitors/Volume.hs')
-rw-r--r-- | src/Plugins/Monitors/Volume.hs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/Plugins/Monitors/Volume.hs b/src/Plugins/Monitors/Volume.hs index 380df30..72a9b0e 100644 --- a/src/Plugins/Monitors/Volume.hs +++ b/src/Plugins/Monitors/Volume.hs @@ -1,3 +1,17 @@ +----------------------------------------------------------------------------- +-- | +-- Module : Plugins.Monitors.Volume +-- Copyright : (c) 2011 Thomas Tuegel +-- License : BSD-style (see LICENSE) +-- +-- Maintainer : Jose A. Ortega Ruiz <jao@gnu.org> +-- Stability : unstable +-- Portability : unportable +-- +-- A monitor for ALSA soundcards +-- +----------------------------------------------------------------------------- + module Plugins.Monitors.Volume (runVolume, volumeConfig) where import Control.Monad ( liftM ) @@ -60,9 +74,9 @@ switchHelper :: VolumeOpts -> (VolumeOpts -> String) -> Monitor String switchHelper opts cHelp strHelp = return $ - (colorHelper $ cHelp opts) + colorHelper (cHelp opts) ++ strHelp opts - ++ (maybe "" (const "</fc>") $ cHelp opts) + ++ maybe "" (const "</fc>") (cHelp opts) formatSwitch :: VolumeOpts -> Bool -> Monitor String formatSwitch opts True = switchHelper opts onColor onString @@ -95,7 +109,7 @@ runVolume mixerName controlName argv = do (lo, hi) <- io $ getRange volumeControl val <- io $ getChannel FrontLeft $ value volumeControl db <- io $ getChannel FrontLeft $ dB volumeControl - sw <- io $ getChannel FrontLeft $ switchControl + sw <- io $ getChannel FrontLeft switchControl p <- case val of Just x -> formatVol x lo hi Nothing -> formatVol hi lo hi @@ -105,4 +119,4 @@ runVolume mixerName controlName argv = do s <- case sw of Just x -> formatSwitch opts x Nothing -> formatSwitch opts True - parseTemplate $ [ p, d, s ] + parseTemplate [ p, d, s ] |