tv xmonad: amixer -> pactl

This commit is contained in:
tv 2018-11-30 16:17:32 +01:00
parent e281308027
commit 08849bbb4e
3 changed files with 12 additions and 8 deletions

View File

@ -96,8 +96,8 @@ in {
]); ]);
}; };
path = [ path = [
pkgs.alsaUtils
pkgs.fzmenu pkgs.fzmenu
pkgs.pulseaudioLight.out
pkgs.rxvt_unicode pkgs.rxvt_unicode
]; ];
serviceConfig = { serviceConfig = {

View File

@ -3,12 +3,12 @@ module Paths where
import Helpers.Path import Helpers.Path
amixer :: FilePath
amixer = findExecutable "amixer"
otpmenu :: FilePath otpmenu :: FilePath
otpmenu = findExecutable "otpmenu" otpmenu = findExecutable "otpmenu"
pactl :: FilePath
pactl = findExecutable "pactl"
passmenu :: FilePath passmenu :: FilePath
passmenu = findExecutable "passmenu" passmenu = findExecutable "passmenu"

View File

@ -147,9 +147,10 @@ myKeys conf = Map.fromList $
, ((_4 , xK_Delete ), removeEmptyWorkspace) , ((_4 , xK_Delete ), removeEmptyWorkspace)
, ((_4 , xK_Return ), toggleWS) , ((_4 , xK_Return ), toggleWS)
, ((noModMask, xF86XK_AudioLowerVolume), amixer ["sset", "Master", "5%-"])
, ((noModMask, xF86XK_AudioRaiseVolume), amixer ["sset", "Master", "5%+"]) , ((0, xF86XK_AudioLowerVolume), audioLowerVolume)
, ((noModMask, xF86XK_AudioMute), amixer ["sset", "Master", "toggle"]) , ((0, xF86XK_AudioRaiseVolume), audioRaiseVolume)
, ((0, xF86XK_AudioMute), audioMute)
] ]
where where
_4 = mod4Mask _4 = mod4Mask
@ -162,7 +163,10 @@ myKeys conf = Map.fromList $
_4CM = _4 .|. _C .|. _M _4CM = _4 .|. _C .|. _M
_4SM = _4 .|. _S .|. _M _4SM = _4 .|. _S .|. _M
amixer args = forkFile Paths.amixer args Nothing pactl args = forkFile Paths.pactl args Nothing
audioLowerVolume = pactl ["--", "set-sink-volume", "@DEFAULT_SINK@", "-5%"]
audioRaiseVolume = pactl ["--", "set-sink-volume", "@DEFAULT_SINK@", "+5%"]
audioMute = pactl ["--", "set-sink-mute", "@DEFAULT_SINK@", "toggle"]
pagerConfig :: PagerConfig pagerConfig :: PagerConfig