Created
September 25, 2024 22:55
-
-
Save demostanis/69ed5645428de31e865f59a8dc11cd94 to your computer and use it in GitHub Desktop.
This file contains 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
ssh() { | |
8 command ssh "$*" | |
7 } | |
6 brctl='pkexec /usr/lib/unity-settings-daemon/usd-backlight-helper' | |
5 | |
4 case "$1" in | |
3 s) | |
2 op=${2: -1} | |
1 percent=${2%%%*} | |
10 br=$(ssh $brctl --get-brightness) | |
1 if [ "$op" = + ]; then | |
2 br=$(( br + percent )) | |
3 else | |
4 br=$(( br - percent )) | |
5 fi | |
6 ssh $brctl --set-brightness $br | |
7 ;; | |
8 -P) | |
9 if [ "$2" = g ]; then | |
10 ssh $brctl --get-brightness | |
11 fi | |
12 ;; | |
13 esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment