The i3 and laptop READMEs each pointed at the other for 10-asus.conf and 20-g14.conf, so nobody owned them. The module now writes both (adopted paths, so no duplicate binding breaks i3's config check), ships the scripts they call, runs the media keys with notifications again, and brings back the touchpad reset after resume as a unit the sleep services want. zephyrus_keys answers what each custom key runs; the check flags as-user, thd's account and the resume unit. xorg-xinput is the xorg module's.
21 lines
931 B
Bash
Executable File
21 lines
931 B
Bash
Executable File
#!/bin/bash
|
|
# zephyrus-kbd-notify — shows the keyboard backlight's level when it changes. The level itself is set
|
|
# by the firmware and asusd (Fn+F2/F3), which tell UPower; this only listens and notifies. Started once
|
|
# per session from the module's i3 fragment. Shipped by the mesh's asus-zephyrus-g14 module.
|
|
#
|
|
# One instance per session: i3 runs its `exec` lines again on an in-place restart, and the
|
|
# predecessor's listener ran twice after one, showing every change twice.
|
|
set -u
|
|
here=$(dirname "$0")
|
|
lock="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}/zephyrus-kbd-notify.lock"
|
|
exec 9>"$lock"
|
|
flock -n 9 || exit 0
|
|
levels=(Off Low Med High)
|
|
dbus-monitor --system "type='signal',interface='org.freedesktop.UPower.KbdBacklight',member='BrightnessChanged'" 2>/dev/null |
|
|
while read -r line; do
|
|
if [[ $line =~ int32\ ([0-9]+) ]]; then
|
|
v=${BASH_REMATCH[1]}
|
|
"$here/zephyrus-notify" 5556 "Keyboard: ${levels[$v]:-$v}"
|
|
fi
|
|
done
|