Skip to content

Instantly share code, notes, and snippets.

@jasonrobot
Created April 24, 2018 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonrobot/368cc8e31bc9a0081e69ed5ebb222419 to your computer and use it in GitHub Desktop.
Save jasonrobot/368cc8e31bc9a0081e69ed5ebb222419 to your computer and use it in GitHub Desktop.
Bind this to your media keys to control whatever pulse audio syncs are active.
#!/usr/bin/env fish
set -l current_sinks (pactl list short sinks | grep -i "running" | awk "{ print \$1 }")
for sink in $current_sinks
switch $argv[1]
case mute unmute
echo "toggling mute"
pactl set-sink-mute $sink toggle
case up
echo "volume up"
pactl set-sink-volume $sink +4%
case down
echo "volume down"
pactl set-sink-volume $sink -4%
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment