From cf0f9b7279de0e2ee4fefb9598b30f2890696eb4 Mon Sep 17 00:00:00 2001 From: Linux User Date: Sat, 1 Oct 2022 06:45:43 +0000 Subject: [PATCH] added backlight script, updates --- .local/bin/dwmbar | 5 ++++- .local/scripts/0183_0_backlight | 18 ++++++++++++++++++ .local/scripts/0185_10_bat | 8 +++++++- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .local/scripts/0183_0_backlight diff --git a/.local/bin/dwmbar b/.local/bin/dwmbar index c06d352..306346b 100755 --- a/.local/bin/dwmbar +++ b/.local/bin/dwmbar @@ -1,5 +1,6 @@ #!/bin/bash +DD=";" DELIM=" " DELIM_START=0 @@ -47,7 +48,9 @@ run while : do 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 done diff --git a/.local/scripts/0183_0_backlight b/.local/scripts/0183_0_backlight new file mode 100644 index 0000000..02a4fad --- /dev/null +++ b/.local/scripts/0183_0_backlight @@ -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^" + diff --git a/.local/scripts/0185_10_bat b/.local/scripts/0185_10_bat index 8c8bb26..201e247 100755 --- a/.local/scripts/0185_10_bat +++ b/.local/scripts/0185_10_bat @@ -1,10 +1,16 @@ #!/bin/bash -DEVICE=BAT1 +DEVICE="BAT1" + COLOR1="#FF00F4" 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)" if [[ $((batpercent + 0)) -ge 80 ]]