mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
20 lines
503 B
Bash
Executable File
20 lines
503 B
Bash
Executable File
#!/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
|