mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
14 lines
551 B
Bash
Executable File
14 lines
551 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Adjust the brightness on Apple Studio Displays and Apple XDR Displays using asdcontrol.
|
|
# omarchy:requires-sudo=true
|
|
|
|
if (( $# == 0 )); then
|
|
echo "Adjust Apple Display Brightness by passing +5000 or -5000 (or any range from 0-60000)"
|
|
else
|
|
device="$(sudo asdcontrol --detect /dev/usb/hiddev* | grep ^/dev/usb/hiddev | cut -d: -f1)"
|
|
sudo asdcontrol "$device" -- "$1" >/dev/null
|
|
value="$(sudo asdcontrol "$device" | awk -F= '/BRIGHTNESS=/{print $2+0}')"
|
|
omarchy-swayosd-brightness "$(( value * 100 / 60000 ))"
|
|
fi
|