Skip to content
Browse files

Extract volume changing to tpope-media

  • Loading branch information...
1 parent 9b293e8 commit ab977c59ab41341e8dec5f58adaf920215c6747a @tpope committed Oct 21, 2012
Showing with 25 additions and 9 deletions.
  1. +9 −9 .fvwm/.fvwm2rc
  2. +16 −0 bin/tpope-media
View
18 .fvwm/.fvwm2rc
@@ -981,19 +981,19 @@ AddToFunc FuncCloseXmms
Key bracketleft A 4M Exec exec tpope media prev
Key bracketright A 4M Exec exec tpope media next
Key backslash A 4M Exec exec tpope media toggle
-Key bracketleft A 4 Exec for sink in `pactl list short sinks|cut -f 1`; do pactl -- set-sink-volume $sink -5%; done || exec amixer set Master 5%-
-Key bracketright A 4 Exec for sink in `pactl list short sinks|cut -f 1`; do pactl -- set-sink-volume $sink +5%; done || exec amixer set Master 5%+
+Key bracketleft A 4 Exec exec tpope media softer
+Key bracketright A 4 Exec exec tpope media louder
Key backslash A 4 Exec exec tpope media pause
-Key XF86AudioLowerVolume A A Exec for sink in `pactl list short sinks|cut -f 1`; do pactl -- set-sink-volume $sink -5%; done || exec amixer set Master 5%-
-Key XF86AudioRaiseVolume A A Exec for sink in `pactl list short sinks|cut -f 1`; do pactl -- set-sink-volume $sink +5%; done || exec amixer set Master 5%+
+Key XF86AudioLowerVolume A A Exec exec tpope media softer
+Key XF86AudioRaiseVolume A A Exec exec tpope media louder
Key XF86Standby A A Exec exec xscreensaver-command -activate
-Key XF86AudioStop A A Exec exec media stop
-Key XF86AudioPlay A A Exec exec media toggle
-Key XF86AudioPrev A A Exec exec media prev
-Key XF86AudioNext A A Exec exec media next
-Key XF86AudioMute A A Exec exec media pause
+Key XF86AudioStop A A Exec exec tpope media stop
+Key XF86AudioPlay A A Exec exec tpope media toggle
+Key XF86AudioPrev A A Exec exec tpope media prev
+Key XF86AudioNext A A Exec exec tpope media next
+Key XF86AudioMute A A Exec exec tpope media pause
# }}}2
# }}}1
View
16 bin/tpope-media
@@ -3,6 +3,22 @@
# Provides a standard interface for sending commands to various media players.
+case "$1" in
+ softer)
+ for sink in `pactl list short sinks|cut -f 1`; do
+ pactl -- set-sink-volume $sink -5%
+ done || amixer set Master 5%-
+ exit 0
+ ;;
+
+ louder)
+ for sink in `pactl list short sinks|cut -f 1`; do
+ pactl -- set-sink-volume $sink +5%
+ done || amixer set Master 5%+
+ exit 0
+ ;;
+esac
+
mediaaction() {
if ps x|grep -v grep|grep ' g*mplayer' >/dev/null && [ -p "$HOME/.mplayer/mplayer" ]; then
exec > "$HOME/.mplayer/mplayer"

0 comments on commit ab977c5

Please sign in to comment.
Something went wrong with that request. Please try again.