Created
May 10, 2023 09:11
-
-
Save y4my4my4m/f97d39b0488c2208146b1002bfe8aa4e to your computer and use it in GitHub Desktop.
Asus Zenbook Duo screenpad brightness control on linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/acpi/events/asus-keyboard-backlight-up | |
# This is called when the user presses the key brightness | |
# up button and calls /etc/acpi/asus-keyboard-backlight.sh for | |
# further processing. | |
# sudo ln -s /path/to/file /etc/acpi/events/asus-brightness-down | |
event=video/brightnessdown BRTDN 00000087 00000000 | |
action=/etc/acpi/asus-brightness.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/acpi/events/asus-keyboard-backlight-up | |
# This is called when the user presses the key brightness | |
# up button and calls /etc/acpi/asus-keyboard-backlight.sh for | |
# further processing. | |
# sudo ln -s /path/to/file /etc/acpi/events/asus-brightness-up | |
event=video/brightnessup BRTUP 00000086 00000000 | |
action=/etc/acpi/asus-brightness.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DEC_BRIGHTNESS=$(cat /sys/class/backlight/intel_backlight/brightness) | |
DEC_BRIGHTNESS=$(echo "$DEC_BRIGHTNESS * 0.64" | bc) | |
DEC_BRIGHTNESS=$(echo "${DEC_BRIGHTNESS%.*}") | |
HEX_BRIGHTNESS=$(printf '%02x' $DEC_BRIGHTNESS) | |
echo $HEX_BRIGHTNESS > /home/MYUSER/temp.log | |
if [ $(cat /home/MYUSER/zbpd14/dual) -eq 1 ] | |
then | |
if [ $DEC_BRIGHTNESS -eq 256 ] | |
then | |
echo "MAX BRIGHTNESS $DEC_BRIGHTNESS" | |
echo "\_SB.ATKD.WMNB 0x0 0x53564544 b32000500FF000000" | sudo tee /proc/acpi/call | |
else | |
echo "NOT MAX BRIGHTNESS $DEC_BRIGHTNESS" | |
echo "\_SB.ATKD.WMNB 0x0 0x53564544 b32000500${HEX_BRIGHTNESS}000000" | sudo tee /proc/acpi/call | |
fi | |
fi | |
# sudo ln -s /path/to/file /etc/acpi/asus-brightness.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Modified version of: https://github.com/njm2015/zbpd14 thanks to @njm2015