aboutsummaryrefslogtreecommitdiff
path: root/scripts/.local/bin/personal/volctl
blob: 8a02d1bf842f4a311c0a9eb4bc44f019116a8c7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# A script to manage the volume on my system universally

sink="$(pactl get-default-sink)"
volume="$(pamixer --get-volume)"

if [ "$1" = "increase" ]
then
  pactl set-sink-volume "$sink" +5%
elif [ "$1" = "decrease" ]
then
  pactl set-sink-volume "$sink" -5%
elif [ "$1" = "mute" ]
then
  # TODO: Make this a toggle with memory
  pactl set-sink-volume "$sink" 0%
elif [ "$1" = "check" ]
then
  printf "%s\n" "$volume"
else 
  printf "[ Error ] Not enough arguments.\n"
fi