Created
March 18, 2019 17:40
-
-
Save pbrisbin/7329a06030b9704814bf3efea54128b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
amixer_() { | |
# Workaround | |
amixer -c 0 sset Headphone unmute | |
amixer -c 0 sset Speaker unmute | |
amixer "$@" | |
} | |
notify() { | |
/home/patrick/.local/bin/runx notify-send "$@" | |
} | |
logger -t acpid "$*" | |
case "$1" in | |
battery) notify "Battery Event" "$(acpi)" ;; | |
button/f20) amixer -c 0 sset Capture toggle ;; # mic mute | |
button/mute) amixer_ -c 0 sset Master toggle ;; | |
button/volumedown) amixer_ -c 0 sset Master '3%-' ;; | |
button/volumeup) amixer_ -c 0 sset Master '3%+' ;; | |
video/brightnessup) | |
read -r val < /sys/class/backlight/intel_backlight/brightness | |
echo $((val+77)) > /sys/class/backlight/intel_backlight/brightness | |
;; | |
video/brightnessdown) | |
read -r val < /sys/class/backlight/intel_backlight/brightness | |
echo $((val-77)) > /sys/class/backlight/intel_backlight/brightness | |
;; | |
#*) notify "ACPI Event" "$(printf "%s\n" "$@")" ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment