updated audioscirpts and xmonad.hs to reflect changes, much finer grain control now
This commit is contained in:
parent
654d7cf14f
commit
eae08b35a4
@ -3,7 +3,7 @@
|
|||||||
default_loc=/tmp/pactl-default-sink
|
default_loc=/tmp/pactl-default-sink
|
||||||
|
|
||||||
if [ ! -f "$default_loc" ] ; then
|
if [ ! -f "$default_loc" ] ; then
|
||||||
/home/solomon/.scripts/set-default-card
|
/home/solomon/.scripts/set-default-sink
|
||||||
fi
|
fi
|
||||||
|
|
||||||
default=$(cat $default_loc)
|
default=$(cat $default_loc)
|
||||||
11
.scripts/dec-source-volume
Executable file
11
.scripts/dec-source-volume
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
default_loc=/tmp/pactl-default-source
|
||||||
|
|
||||||
|
if [ ! -f "$default_loc" ] ; then
|
||||||
|
/home/solomon/.scripts/set-default-source
|
||||||
|
fi
|
||||||
|
|
||||||
|
default=$(cat $default_loc)
|
||||||
|
|
||||||
|
pactl set-source-volume $default -5%
|
||||||
@ -3,7 +3,7 @@
|
|||||||
default_loc=/tmp/pactl-default-sink
|
default_loc=/tmp/pactl-default-sink
|
||||||
|
|
||||||
if [ ! -f "$default_loc" ] ; then
|
if [ ! -f "$default_loc" ] ; then
|
||||||
/home/solomon/.scripts/set-default-card
|
/home/solomon/.scripts/set-default-sink
|
||||||
fi
|
fi
|
||||||
|
|
||||||
default=$(cat $default_loc)
|
default=$(cat $default_loc)
|
||||||
11
.scripts/inc-source-volume
Executable file
11
.scripts/inc-source-volume
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
default_loc=/tmp/pactl-default-source
|
||||||
|
|
||||||
|
if [ ! -f "$default_loc" ] ; then
|
||||||
|
/home/solomon/.scripts/set-default-source
|
||||||
|
fi
|
||||||
|
|
||||||
|
default=$(cat $default_loc)
|
||||||
|
|
||||||
|
pactl set-source-volume $default +5%
|
||||||
@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
choice=$(pactl list short sinks | awk '{print $2}' | dmenu -i -p "which sink should be default?")
|
choice=$(pactl list short sinks | awk '{print $2}' | dmenu -i -p "which sink should be default?")
|
||||||
|
|
||||||
if [ $choice=="" ] ; then
|
if [ -z "$choice" ] ; then
|
||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
rm /tmp/pactl-default-sink --force # to ignore if it isn't there
|
rm /tmp/pactl-default-sink --force # to ignore if it isn't there
|
||||||
echo "$choice" >> /tmp/pactl-default-sink
|
touch /tmp/pactl-default-sink
|
||||||
|
echo "$choice" > /tmp/pactl-default-sink
|
||||||
pactl set-default-sink $choice # make sure that the chosen sink is the
|
pactl set-default-sink $choice # make sure that the chosen sink is the
|
||||||
13
.scripts/set-default-source
Executable file
13
.scripts/set-default-source
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
choice=$(pactl list short sources | awk '{print $2}' | dmenu -i -p "which source should be default?")
|
||||||
|
|
||||||
|
if [ -z "$choice" ] ; then
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
rm /tmp/pactl-default-source --force # to ignore if it isn't there
|
||||||
|
touch /tmp/pactl-default-source
|
||||||
|
echo "$choice" > /tmp/pactl-default-source
|
||||||
|
pactl set-default-source $choice # make sure that the chosen sink is the
|
||||||
11
.scripts/toggle-source-mute
Executable file
11
.scripts/toggle-source-mute
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
default_loc=/tmp/pactl-default-source
|
||||||
|
|
||||||
|
if [ ! -f "$default_loc" ] ; then
|
||||||
|
/home/solomon/.scripts/set-default-source
|
||||||
|
fi
|
||||||
|
|
||||||
|
default=$(cat $default_loc)
|
||||||
|
|
||||||
|
pactl set-source-mute $default toggle
|
||||||
@ -235,16 +235,28 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
|
|||||||
--
|
--
|
||||||
[
|
[
|
||||||
-- decrease volume with mod+f11
|
-- decrease volume with mod+f11
|
||||||
((modm, xK_F11), spawn "/home/solomon/.scripts/dec-default-volume")
|
((modm, xK_F11), spawn "/home/solomon/.scripts/dec-sink-volume")
|
||||||
|
|
||||||
-- increase volume with mod+f12
|
-- increase volume with mod+f12
|
||||||
,((modm, xK_F12), spawn "/home/solomon/.scripts/inc-default-volume")
|
,((modm, xK_F12), spawn "/home/solomon/.scripts/inc-sink-volume")
|
||||||
|
|
||||||
-- toggle mute with mod+f10
|
-- toggle mute with mod+f10
|
||||||
,((modm, xK_F10), spawn "/home/solomon/.scripts/toggle-default-mute")
|
,((modm, xK_F10), spawn "/home/solomon/.scripts/toggle-sink-mute")
|
||||||
|
|
||||||
|
-- decrease volume with mod+f11
|
||||||
|
,((modm .|. shiftMask, xK_F11), spawn "/home/solomon/.scripts/dec-source-volume")
|
||||||
|
|
||||||
|
-- increase volume with mod+f12
|
||||||
|
,((modm .|. shiftMask, xK_F12), spawn "/home/solomon/.scripts/inc-source-volume")
|
||||||
|
|
||||||
|
-- toggle mute with mod+f10
|
||||||
|
,((modm .|. shiftMask, xK_F10), spawn "/home/solomon/.scripts/toggle-source-mute")
|
||||||
|
|
||||||
-- set default sink for pactl to allow above scripts to run
|
-- set default sink for pactl to allow above scripts to run
|
||||||
,((modm .|. shiftMask, xK_F10), spawn "/home/solomon/.scripts/set-sound-card")
|
,((modm, xK_F7), spawn "/home/solomon/.scripts/set-default-sink")
|
||||||
|
|
||||||
|
-- set default source for pactl
|
||||||
|
,((modm .|. shiftMask, xK_F7), spawn "/home/solomon/.scripts/set-default-source")
|
||||||
]
|
]
|
||||||
++
|
++
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user