Bug fixes from quality and security audits: - moonarch-capsnote: use value[0] instead of value[2] - moonarch-btnote: guard empty PER_INT before integer comparison - moonarch-clipboard + niri config: use XDG_RUNTIME_DIR instead of UID 1000 - moonarch-waybar-hidpp: use charging icon when charging - moonarch-waybar-gpustat: find gpu_busy_percent dynamically across hwmon* - post-install/transform: use systemctl --user cat for service detection - post-install/transform: install paru from [extra] instead of AUR clone Replace wlogout with moonset in niri keybind and waybar on-click. Remove moonarch-session (dead code, replaced by moonset) and wlogout layout config.
20 lines
547 B
Bash
Executable File
20 lines
547 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# ABOUTME: Shows a notification when toggling Caps Lock.
|
|
# ABOUTME: Intended for keybinding or input event triggers.
|
|
|
|
sleep 0.2
|
|
|
|
value=($(cat /sys/class/leds/input*::capslock/brightness 2>/dev/null | cut -f1 -d,))
|
|
|
|
if [ "${value[0]:-0}" == 1 ]; then
|
|
icon_name="capslock-enabled-symbolic"
|
|
output="caps lock on"
|
|
else
|
|
icon_name="capslock-disabled-symbolic"
|
|
output="caps lock off"
|
|
fi
|
|
|
|
notify-send -e "$output" -i "$icon_name" \
|
|
-h string:x-canonical-private-synchronous:state \
|
|
-h boolean:value:"${value[0]:-0}" -r 555
|