Add new display widget for the bar

This commit is contained in:
David Heinemeier Hansson
2026-05-17 17:29:52 +02:00
parent cf4935f964
commit 540aaf956d
10 changed files with 471 additions and 13 deletions
+2 -10
View File
@@ -21,21 +21,13 @@ runtime_dir="${XDG_RUNTIME_DIR:-/tmp}"
exec 9>"$runtime_dir/omarchy-brightness-display.lock"
flock -n 9 || exit 0
# Start with the first possible output, then refine to the most likely given an order heuristic.
device="$(ls -1 /sys/class/backlight 2>/dev/null | head -n1)"
for candidate in amdgpu_bl* intel_backlight acpi_video*; do
if [[ -e /sys/class/backlight/$candidate ]]; then
device="$candidate"
break
fi
done
if omarchy-hyprland-monitor-focused-apple; then
omarchy-brightness-display-apple "$step"
exit
fi
device="$(omarchy-hw-display)" || exit 1
# Current brightness percentage
current=$(brightnessctl -d "$device" -m | cut -d',' -f4 | tr -d '%')