-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsound
executable file
·30 lines (26 loc) · 1.25 KB
/
sound
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/sh
#-- sound --#
# Script to change sound related settings.
# Dependencies:
# - dunst
# - amixer (alsa-utils)
# ~ ADIGEN
alias amixer='amixer -D hw:1'
case "${1}" in
"increase")
pactl set-sink-volume @DEFAULT_SINK@ +5% && dunstify -t 500 -u low -r '92813' "Volume: $(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' ' '/%/ { print $5 }')"
# amixer sset Master 5%+ && dunstify -t 500 -u low -r '92813' "Volume: `amixer sget Master | awk -F'[][]' '/%/ { print $2 }' | head -1`"
;;
"decrease")
pactl set-sink-volume @DEFAULT_SINK@ -5% && dunstify -t 500 -u low -r '92813' "Volume: $(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' ' '/%/ { print $5 }')"
# amixer sset Master 5%- && dunstify -t 500 -u low -r '92813' "Volume: `amixer sget Master | awk -F'[][]' '/%/ { print $2 }' | head -1`"
;;
"mute")
amixer sset Master toggle
dunstify -t 500 -u low -r '92813' "Volume $(amixer sget Master | awk -F '[][]' '/dB/ {print $6}')"
;;
"mic")
pactl set-source-mute alsa_input.pci-0000_04_00.6.HiFi__Mic1__source toggle && dunstify -t 500 -u low -r '92813' "Mic $(pactl get-source-mute alsa_input.pci-0000_04_00.6.HiFi__Mic1__source)"
#amixer set Capture toggle; dunstify -t 500 -u low -r '92813' "Mic $(amixer get Capture | awk -F'[][]' '/Left:/ {print $6}')"
;;
esac