elenapan/bin/volume-control.sh
elena 199af78429 dotfile overhaul, reorganized directories, updated almost everything, and only kept the most essential
Former-commit-id: 4295c806ec
Former-commit-id: c87f8e56cd2677dbb5a2a15e90f879a9fa1a1a6b
Former-commit-id: 1ad787023efcecb57853b9a5103dff461192e56d
Former-commit-id: 595bf6d1621414a7b6e7d8e9acb374ce52687596
2018-09-28 02:54:28 +03:00

22 lines
665 B
Bash
Executable file

#!/bin/bash
# Control volume
# Requires pulseaudio
# --------------------------
# Steps for raising/lowering volume
STEP=5
BIG_STEP=25
if [[ "$1" = "up" ]]; then
pactl set-sink-mute 0 0 && pactl set-sink-volume @DEFAULT_SINK@ +$STEP%
elif [[ "$1" = "UP" ]]; then
pactl set-sink-mute 0 0 && pactl set-sink-volume @DEFAULT_SINK@ +$BIG_STEP%
elif [[ "$1" = "down" ]]; then
pactl set-sink-mute 0 0 && pactl set-sink-volume @DEFAULT_SINK@ -$STEP%
elif [[ "$1" = "DOWN" ]]; then
pactl set-sink-mute 0 0 && pactl set-sink-volume @DEFAULT_SINK@ -$BIG_STEP%
elif [[ "$1" = "toggle" ]]; then
pactl set-sink-mute 0 toggle
else
echo "No argument."
fi