update scripts

This commit is contained in:
BitHeaven-Official 2023-03-02 14:37:56 +05:00
parent dd5cfd84fa
commit db2199c05b
6 changed files with 62 additions and 35 deletions

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,6 +1,6 @@
#!/bin/bash
DEVICE=wlan0
DEVICE=wlp2s0
COLOR1="#FF9B00"
COLOR2="#A16200"
@ -16,8 +16,7 @@ done
if [ $good -eq 0 ]
then
echo "Change DEVICE in ~/.local/scripts/0010_1_network"
grep ":" /proc/net/dev | awk -F: '{print $1}' | sed s@\ @@g
echo "0010"
exit 1
fi
@ -47,25 +46,8 @@ TXNET_BIT=`echo $line | awk '{print $9}'`
echo $RXNET_BIT > $HOME/.local/tmp/.tmp_RXNET_BIT
echo $TXNET_BIT > $HOME/.local/tmp/.tmp_TXNET_BIT
if [ $inbound -gt $((1024*1024)) ]
then
inb=$(printf "%.2f MB/s" $(echo "scale=2; $inbound / 1024 / 1024" | bc))
elif [ $inbound -gt 1024 ]
then
inb=$(printf "%.2f KB/s" $(echo "scale=2; $inbound / 1024" | bc))
else
inb=$(printf "%i B/s" $inbound)
fi
inb=$(printf "%.0f MB/s" $(echo "scale=2; $inbound / 1024 / 1024" | bc))
if [ $outbound -gt $((1024*1024)) ]
then
outb=$(printf "%.2f MB/s" $(echo "scale=2; $outbound / 1024 / 1024" | bc))
elif [ $outbound -gt 1024 ]
then
outb=$(printf "%.2f KB/s" $(echo "scale=2; $outbound / 1024" | bc))
else
outb=$(printf "%i B/s" $outbound)
fi
outb=$(printf "%.0f MB/s" $(echo "scale=2; $outbound / 1024 / 1024" | bc))
echo "^c$COLOR1^^b$COLOR2^ In: $inb ^b$COLOR1^^c$COLOR2^  ^c$COLOR1^^b$COLOR2^ Out: $outb ^d^"
echo "^c$COLOR1^^b$COLOR2^ $inb ^b$COLOR1^^c$COLOR2^  ^c$COLOR1^^b$COLOR2^ $outb ^d^"

View File

@ -3,6 +3,8 @@
COLOR1="#990057"
COLOR2="#FF00B2"
usage=$(cat <(grep 'cpu ' /proc/stat) <(sleep 1 && grep 'cpu ' /proc/stat) | awk -v RS="" '{print ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}' | cut -d'.' -f1)"%"
load1="$(grep 'cpu ' /proc/stat)"
load2="$(sleep 1 && grep 'cpu ' /proc/stat)"
usage=$(echo "$load1 \n $load2" | awk -v RS="" '{print ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}' | cut -d'.' -f1)"%"
echo "^c$COLOR1^^b$COLOR2^  ^b$COLOR1^^c$COLOR2^ $usage ^d^"

View File

@ -0,0 +1,24 @@
#!/bin/bash
COLOR1="#AE8BF9"
COLOR2="#773DF5"
cputemp=$(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000))
if [ $cputemp -ge 90 ]
then
tempicon=""
elif [ $cputemp -ge 75 ]
then
tempicon=""
elif [ $cputemp -ge 60 ]
then
tempicon=""
elif [ $cputemp -ge 45 ]
then
tempicon=""
else
tempicon=""
fi
echo "^b$COLOR1^^c$COLOR2^ $tempicon ^c$COLOR1^^b$COLOR2^ $cputemp ^d^"

View File

@ -6,7 +6,7 @@ COLOR2="#005083"
power=$(nmcli -f IN-USE,SIGNAL,SSID device wifi | grep "*" | cut -d' ' -f8)
name=$(nmcli -f IN-USE,SIGNAL,SSID device wifi | grep "*" | cut -d' ' -f14)
if [[ ! $name ]]
if [ ! $name ]
then
echo "^b$COLOR1^^c$COLOR2^  ^c$COLOR1^^b$COLOR2^  ^d^"
else

View File

@ -1,40 +1,41 @@
#!/bin/bash
DEVICE="BAT1"
DEVICE="BAT0"
COLOR1="#FF00F4"
COLOR2="#83007D"
if [ ! -f "$FILE" ]
if [ ! -f "/sys/class/power_supply/$DEVICE/capacity" ]
then
DEVICE="$(ls /sys/class/power_supply/ -1 -t | head -1)"
echo "0185"
exit 1
fi
batpercent="$(cat /sys/class/power_supply/$DEVICE/capacity)"
if [[ $((batpercent + 0)) -ge 80 ]]
if [ $batpercent -ge 80 ]
then
icon=""
elif [[ $((batpercent + 0)) -ge 60 ]]
elif [ $batpercent -ge 60 ]
then
icon=""
elif [[ $((batpercent + 0)) -ge 40 ]]
elif [ $batpercent -ge 40 ]
then
icon=""
elif [[ $((batpercent + 0)) -ge 20 ]]
elif [ $batpercent -ge 20 ]
then
icon=""
else
icon=""
fi
chrg=$(cat /sys/class/power_supply/$DEVICE/status)
chrg="$(cat /sys/class/power_supply/$DEVICE/status)"
if [[ "$chrg" == "Charging" ]]
if [ "$chrg" = "Charging" ]
then
icon=""
elif [[ "$chrg" == "Full" ]]
elif [ "$chrg" = "Full" ]
then
icon=""
fi