move files
This commit is contained in:
71
.local/scripts/status/0010_1_network
Executable file
71
.local/scripts/status/0010_1_network
Executable file
@ -0,0 +1,71 @@
|
||||
#!/bin/bash
|
||||
|
||||
DEVICE=wlan0
|
||||
COLOR1="#FF9B00"
|
||||
COLOR2="#A16200"
|
||||
|
||||
good=0
|
||||
for gooddev in `grep \: /proc/net/dev | awk -F: '{print $1}'`
|
||||
do
|
||||
if [ "$DEVICE" = $gooddev ]
|
||||
then
|
||||
good=1
|
||||
break
|
||||
fi
|
||||
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
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f $HOME/.local/tmp/.tmp_RXNET_BIT ]
|
||||
then
|
||||
RXNET_BIT=0
|
||||
TXNET_BIT=0
|
||||
|
||||
echo $RXNET_BIT > $HOME/.local/tmp/.tmp_RXNET_BIT
|
||||
echo $TXNET_BIT > $HOME/.local/tmp/.tmp_TXNET_BIT
|
||||
fi
|
||||
|
||||
RXNET_BIT=$(cat $HOME/.local/tmp/.tmp_RXNET_BIT)
|
||||
TXNET_BIT=$(cat $HOME/.local/tmp/.tmp_TXNET_BIT)
|
||||
|
||||
line=`grep $DEVICE /proc/net/dev | sed s/.*://`
|
||||
rx=`echo $line | awk '{print $1}'`
|
||||
tx=`echo $line | awk '{print $9}'`
|
||||
|
||||
inbound=$(($rx-$RXNET_BIT))
|
||||
outbound=$(($tx-$TXNET_BIT))
|
||||
|
||||
line=`grep $DEVICE /proc/net/dev | sed s/.*://`
|
||||
RXNET_BIT=`echo $line | awk '{print $1}'`
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
|
||||
echo "^c$COLOR1^^b$COLOR2^ In: $inb ^b$COLOR1^^c$COLOR2^ ^c$COLOR1^^b$COLOR2^ Out: $outb ^d^"
|
8
.local/scripts/status/0020_1_ram
Executable file
8
.local/scripts/status/0020_1_ram
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
COLOR1="#C700FF"
|
||||
COLOR2="#590073"
|
||||
|
||||
mem="$(free -h | awk '/Mem:/ {print $3 "/" $2}')"
|
||||
|
||||
echo "^b$COLOR1^^c$COLOR2^ ^c$COLOR1^^b$COLOR2^ $mem ^d^"
|
8
.local/scripts/status/0030_0_cpu
Executable file
8
.local/scripts/status/0030_0_cpu
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
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)"%"
|
||||
|
||||
echo "^c$COLOR1^^b$COLOR2^ ^b$COLOR1^^c$COLOR2^ $usage ^d^"
|
14
.local/scripts/status/0040_1_wifi
Executable file
14
.local/scripts/status/0040_1_wifi
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
COLOR1="#009CFF"
|
||||
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 ]]
|
||||
then
|
||||
echo "^b$COLOR1^^c$COLOR2^ ^c$COLOR1^^b$COLOR2^ ^d^"
|
||||
else
|
||||
echo "^b$COLOR1^^c$COLOR2^ ^c$COLOR1^^b$COLOR2^ $name $power ^d^"
|
||||
fi
|
9
.local/scripts/status/0050_5_disk
Executable file
9
.local/scripts/status/0050_5_disk
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
COLOR1="#00FF90"
|
||||
COLOR2="#00A45D"
|
||||
|
||||
used=$(echo $(df -h / | sed -n '1!p') | cut -d' ' -f3)
|
||||
total=$(echo $(df -h / | sed -n '1!p') | cut -d' ' -f2)
|
||||
|
||||
echo "^b$COLOR1^^c$COLOR2^ ^c$COLOR1^^b$COLOR2^ $used/$total ^d^"
|
21
.local/scripts/status/0180_0_pulse
Executable file
21
.local/scripts/status/0180_0_pulse
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
COLOR1="#FF0000"
|
||||
COLOR2="#700000"
|
||||
|
||||
SND=$( pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
|
||||
|
||||
if [ $SND -ge 67 ]
|
||||
then
|
||||
glyph=""
|
||||
elif [ $SND -ge 34 ]
|
||||
then
|
||||
glyph=""
|
||||
elif [ $SND -ge 1 ]
|
||||
then
|
||||
glyph=""
|
||||
else
|
||||
glyph=""
|
||||
fi
|
||||
|
||||
echo "^b$COLOR1^^c$COLOR2^ $glyph ^c$COLOR1^^b$COLOR2^ $SND% ^d^"
|
18
.local/scripts/status/0183_0_backlight
Executable file
18
.local/scripts/status/0183_0_backlight
Executable 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^"
|
||||
|
44
.local/scripts/status/0185_10_bat
Executable file
44
.local/scripts/status/0185_10_bat
Executable file
@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
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 ]]
|
||||
then
|
||||
icon=""
|
||||
elif [[ $((batpercent + 0)) -ge 60 ]]
|
||||
then
|
||||
icon=""
|
||||
elif [[ $((batpercent + 0)) -ge 40 ]]
|
||||
then
|
||||
icon=""
|
||||
elif [[ $((batpercent + 0)) -ge 20 ]]
|
||||
then
|
||||
icon=""
|
||||
else
|
||||
icon=""
|
||||
fi
|
||||
|
||||
chrg=$(cat /sys/class/power_supply/$DEVICE/status)
|
||||
|
||||
if [[ "$chrg" == "Charging" ]]
|
||||
then
|
||||
icon=""
|
||||
elif [[ "$chrg" == "Full" ]]
|
||||
then
|
||||
icon=""
|
||||
fi
|
||||
|
||||
batpercent="$(echo $batpercent)%"
|
||||
|
||||
echo "^b$COLOR1^^c$COLOR2^ $icon ^c$COLOR1^^b$COLOR2^ $batpercent ^d^"
|
8
.local/scripts/status/0190_0_lang
Executable file
8
.local/scripts/status/0190_0_lang
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
COLOR1="#FF5800"
|
||||
COLOR2="#973400"
|
||||
|
||||
lang=$(xkblayout-state print %s)
|
||||
|
||||
echo "^b$COLOR1^^c$COLOR2^ ^c$COLOR1^^b$COLOR2^ $lang ^d^"
|
8
.local/scripts/status/0200_60_date
Executable file
8
.local/scripts/status/0200_60_date
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
COLOR1="#17FF00"
|
||||
COLOR2="#0EA100"
|
||||
|
||||
date=$(date +"%d.%m.%y")
|
||||
|
||||
echo "^b$COLOR1^^c$COLOR2^ ^c$COLOR1^^b$COLOR2^ $date ^d^"
|
8
.local/scripts/status/0210_1_time
Executable file
8
.local/scripts/status/0210_1_time
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
COLOR1="#00E9FF"
|
||||
COLOR2="#008592"
|
||||
|
||||
time=$(date +"%H:%M:%S")
|
||||
|
||||
echo "^b$COLOR1^^c$COLOR2^ ^c$COLOR1^^b$COLOR2^ $time ^d^"
|
Reference in New Issue
Block a user