diff options
author | Timmy Keller <tjk@tjkeller.xyz> | 2022-03-16 23:37:09 -0500 |
---|---|---|
committer | Timmy Keller <tjk@tjkeller.xyz> | 2022-03-16 23:37:09 -0500 |
commit | 3d3d79a57fb6d0a5728e0070475f05d1699f0818 (patch) | |
tree | b141cba678d6bb9821bb33b0dd7c7f1ca31b2c6a /keyboard | |
parent | d51fa1bdda79b8589ddf0002fc4b54aac6ce8354 (diff) | |
download | scripts-3d3d79a57fb6d0a5728e0070475f05d1699f0818.tar.xz scripts-3d3d79a57fb6d0a5728e0070475f05d1699f0818.zip |
move a lot of scripts around and make a bunch of minor changes. once again i am too lazy to document the changes properly since im never going to read these commit messages anyways
Diffstat (limited to 'keyboard')
-rwxr-xr-x | keyboard/bl | 30 | ||||
-rwxr-xr-x | keyboard/mounter | 2 |
2 files changed, 1 insertions, 31 deletions
diff --git a/keyboard/bl b/keyboard/bl deleted file mode 100755 index 2bbd951..0000000 --- a/keyboard/bl +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -xbacklight -$1 $2 -time 50 -steps 5 2>/dev/null && exit - -red=16 -green=18 -blue=1A -getbl() { bl=$(doas ddcutil getvcp $red | sed 's/.*current value =\s*\([0-9]*\).*/\1/'); } # Get brightness of red channel so we only have to grab one -case "$1" in - dec) - getbl - [ $bl = 0 ] && exit - bl=$(( bl - $2 )) - [ $bl -lt 0 ] && bl=0 - ;; - inc) - getbl - [ $bl = 100 ] && exit - bl=$(( bl + $2 )) - [ $bl -gt 100 ] && bl=100 - ;; - set) - bl=$2 - [ $bl -lt 0 ] || [ $bl -gt 100 ] && echo "Invalid value" && exit - ;; - *) - echo "Invalid option" && exit - ;; -esac -for color in $red $green $blue; do doas ddcutil setvcp $color $bl; done -#dwmsbup 20 diff --git a/keyboard/mounter b/keyboard/mounter index 49d0b76..90c6caf 100755 --- a/keyboard/mounter +++ b/keyboard/mounter @@ -57,7 +57,7 @@ umnt() { || $notify "Error Unmounting Device \"$part\" from \"$mp\"" "$umountout" # Remove mp directory if it is in mps - [ "$(dirname "$mp")" = $mps ] && rm -rf "$mp" + [ "$(dirname "$mp")" = $mps ] && [ ! "$(ls -A "$mp")" ] && rm -rf "$mp" } case $1 in |