diff options
author | Mike Crute <mike@crute.us> | 2022-05-06 16:23:51 -0700 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2022-05-06 16:23:54 -0700 |
commit | 3bfd019a9f90c0a582195c6fc00738fc18df6269 (patch) | |
tree | c1bbe31add2e4499749d629b9731bcaaa8c9898d /bin | |
parent | dd2780deeb2dd12845bd4ac4bf2d22db0d6a00ee (diff) | |
download | dotfiles-3bfd019a9f90c0a582195c6fc00738fc18df6269.tar.bz2 dotfiles-3bfd019a9f90c0a582195c6fc00738fc18df6269.tar.xz dotfiles-3bfd019a9f90c0a582195c6fc00738fc18df6269.zip |
Add Dell monitor brightness script
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/dell-monitor-brightness | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/dell-monitor-brightness b/bin/dell-monitor-brightness new file mode 100755 index 0000000..98d5972 --- /dev/null +++ b/bin/dell-monitor-brightness | |||
@@ -0,0 +1,22 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [ -z $1 ]; then | ||
4 | echo "usage: $(basename $0) <brightness:0-100>" | ||
5 | exit 1 | ||
6 | fi | ||
7 | |||
8 | if (( $1 > 100 )) || (( $1 < 0 )); then | ||
9 | echo "usage: $(basename $0) <brightness:0-100>" | ||
10 | exit 1 | ||
11 | fi | ||
12 | |||
13 | exec &>/dev/null | ||
14 | |||
15 | ddccontrol -r 0x10 -w $1 dev:/dev/i2c-8 | ||
16 | |||
17 | if [ $? -ne 0 ]; then | ||
18 | echo "Error setting monitor brightness" | ||
19 | exit 1 | ||
20 | fi | ||
21 | |||
22 | exit 0 | ||