Add asdcontrol for Apple Display brightness

This commit is contained in:
David Heinemeier Hansson
2025-06-16 14:55:54 +02:00
parent 98e320b8ea
commit 116cab3390
3 changed files with 20 additions and 0 deletions

3
bin/apple-display-brightness Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
sudo asdcontrol $(sudo asdcontrol --detect /dev/usb/hiddev* | grep ^/dev/usb/hiddev | cut -d: -f1) -- "$1"

View File

@ -15,6 +15,7 @@ bind = SUPER, W, killactive,
# End active session
bind = SUPER, ESCAPE, exec, hyprlock
bind = SUPER SHIFT, ESCAPE, exit,
bind = SUPER SHIFT CTRL, ESCAPE, exec, reboot
# Control tiling
bind = SUPER, J, togglesplit, # dwindle
@ -79,6 +80,11 @@ bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bindel = ,XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+
bindel = ,XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%-
# Control Apple Display brightness
bind = CTRL, F1, exec, ~/.local/share/omarchy/bin/apple-display-brightness -5000
bind = CTRL, F2, exec, ~/.local/share/omarchy/bin/apple-display-brightness +5000
bind = SHIFT CTRL, F2, exec, ~/.local/share/omarchy/bin/apple-display-brightness +60000
# Requires playerctl
bindl = , XF86AudioNext, exec, playerctl next
bindl = , XF86AudioPause, exec, playerctl play-pause

11
install/adscontrol.sh Normal file
View File

@ -0,0 +1,11 @@
# Install asdcontrol for controlling brightness on Apple Displays
git clone https://github.com/nikosdion/asdcontrol.git /tmp/asdcontrol
cd /tmp/asdcontrol
make
sudo make install
cd -
rm -rf /tmp/asdcontrol
# Setup sudo-less controls
echo "$USER ALL=(ALL) NOPASSWD: /usr/local/bin/asdcontrol" | sudo tee /etc/sudoers.d/asdcontrol
sudo chmod 440 /etc/sudoers.d/asdcontrol