]> git.armaanb.net Git - bin.git/blob - setter
Fix small man issues
[bin.git] / setter
1 #!/usr/bin/env sh
2 # Sends a notification with the time, battery level, and volume
3
4 pkill -SIGUSR1 herbe
5 if [ "$1" = "status" ]; then
6                 herbe "$(date "+%A %Y-%m-%d, %r")" \
7                                         "$(acpi | tail -c +12)" \
8                                         "$(amixer sget Master | tail -n 1 | cut -d " " -f 7-)"
9 elif [ "$1" = "audio" ]; then
10                 if [ "$2" ]; then
11                                 amixer sget Master | tail -n 1 | grep "off" && \
12                                                 pactl set-sink-mute 0 toggle
13                                 pactl set-sink-volume 0 "$2%"
14                 else
15                                 pactl set-sink-mute 0 toggle
16                 fi
17
18                 herbe "Volume" "$(amixer sget Master | tail -n 1 | cut -d " " -f 7-)"
19 elif [ "$1" = "brightness" ]; then
20                 brightnessctl set "$2"
21                 herbe "Brightness" "$(brightnessctl | grep % | tail -c +22)"
22 else
23                 echo "setter: unknown subcommand"
24                 exit 1
25 fi