added backlight script, updates

This commit is contained in:
Linux User 2022-10-01 06:45:43 +00:00
parent 45e85d932a
commit cf0f9b7279
3 changed files with 29 additions and 2 deletions

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
DD=";"
DELIM=" " DELIM=" "
DELIM_START=0 DELIM_START=0
@ -47,7 +48,9 @@ run
while : while :
do do
stat=$(status | tr -d '\n') stat=$(status | tr -d '\n')
xprop -root -set WM_NAME "$stat" extrabarleft="^b#440044^Status^d^ ^c#ff0000^bar 2^d^"
extrabarright="^b#444400^Right ^b#00ff00^text^d^ ^c#ff0000^pisec ^b#000044^dlinee3bu^d^"
xprop -root -set WM_NAME "$stat$DD$extrabarleft$DD$extrabarright"
sleep 0.1 sleep 0.1
done done

View File

@ -0,0 +1,18 @@
#!/bin/bash
DEVICE="amdgpu_bl0"
COLOR1="#FFF400"
COLOR2="#A39C00"
if [ ! -f "$FILE" ]
then
DEVICE="$(ls /sys/class/backlight/ -1 -t | head -1)"
fi
curr="$(cat /sys/class/backlight/$DEVICE/brightness)"
max="$(cat /sys/class/backlight/$DEVICE/max_brightness)"
echo "^b$COLOR1^^c$COLOR2^  ^c$COLOR1^^b$COLOR2^ $curr/$max ^d^"

View File

@ -1,10 +1,16 @@
#!/bin/bash #!/bin/bash
DEVICE=BAT1 DEVICE="BAT1"
COLOR1="#FF00F4" COLOR1="#FF00F4"
COLOR2="#83007D" COLOR2="#83007D"
if [ ! -f "$FILE" ]
then
DEVICE="$(ls /sys/class/power_supply/ -1 -t | head -1)"
fi
batpercent="$(cat /sys/class/power_supply/$DEVICE/capacity)" batpercent="$(cat /sys/class/power_supply/$DEVICE/capacity)"
if [[ $((batpercent + 0)) -ge 80 ]] if [[ $((batpercent + 0)) -ge 80 ]]