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
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
# omarchy:summary=Print the most likely display backlight device.
# omarchy:examples=omarchy-hw-display
# 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 [[ -n $device ]]; then
printf '%s\n' "$device"
else
exit 1
fi