1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-24 20:38:36 -06:00

acpi hook for hdmi_sound_toggle.sh

This commit is contained in:
Sayantan Santra 2022-10-13 19:49:01 -05:00
parent bda0b93eaa
commit 6be3b8527d

View file

@ -6,6 +6,23 @@
# KERNEL=="card0", SUBSYSTEM=="drm", ACTION=="change", RUN+="/usr/local/bin/hdmi_sound_toggle.sh"
# Then run 'udevadm control --reload-rules' and reboot
# Add this to /etc/acpi/handler.sh (make sure acpid is installed and enabled) to pause all media automatically switch to HDMI (if available)
# jack/headphone)
# case "$3" in
# plug)
# logger "Headphones plugged"
# ;;
# unplug)
# logger "Headphones unplugged"
# sudo -u <username> env -i bash -c "DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/1000/bus' playerctl --all-players pause"
# <location-of-this-script>
# ;;
# *)
# logger "ACPI action undefined: $3"
# ;;
# esac
# ;;
export PATH=/usr/bin
USER_NAME=$(who | awk -v vt=tty$(fgconsole) '$0 ~ vt {print $1}')