aboutsummaryrefslogtreecommitdiff
path: root/scripts/.local/bin/personal/volctl
blob: 0a3625f90293c419d8d1dab3b95d760ed5a41f90 (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 list short sinks | grep "pci-0000_00_1b.0" | awk '{print $1}')"
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