script to controll brightness. Changes user to avoid sudo needs
This commit is contained in:
parent
d2d606417f
commit
7ab4d72769
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
input=$1
|
||||
input=${input%\%}
|
||||
re_num='^100$|(^[0-9]{1,2}$)' #100 nebo [0-9] jednou az dvakrat
|
||||
[[ $input =~ $re_num ]] && val=$(($input*240)) || echo "NavN"
|
||||
|
||||
su -c "sudo brightnessctl s $val" bash >/dev/null
|
||||
|
||||
#echo "brightness set to $val"
|
Loading…
Reference in New Issue