Added more dwm-scrips as well as screenshot script making use of maim

zsh
_N0x 3 years ago
parent d586229326
commit c167d62f5a

@ -1,6 +0,0 @@
#!/bin/sh
# get battery percentage and current time remaining
#acpi | awk -F '[, :]' '{print $6 " ~" $8":"$9}'
acpi | awk -F '[, :]' '{ print $6 }'

@ -0,0 +1,7 @@
#!/bin/bash
icon=""
#battery="$(acpi | awk -F '[, :]' '{ print $6 " ~" $8":"$9 }')" # with time remaning
battery="$(acpi | awk -F '[, :]' '{ print $6 }')" # without time
printf " %s %s \\n" "$icon" "$battery"

@ -0,0 +1,11 @@
#!/bin/bash
read cpu a b c previdle rest < /proc/stat
prevtotal=$((a+b+c+previdle))
sleep 0.5
read cpu a b c idle rest < /proc/stat
total=$((a+b+c+idle))
cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))
icon=""
printf " %s %s \\n" "$icon" "$cpu%"

@ -0,0 +1,8 @@
#!/bin/bash
icon=""
hdd1="$(df / | awk '/^\// { print $5 }')"
hdd2="$(df /home | awk '/^\// { print $5 }')"
printf " %s / %s | %s /home %s \\n" "$icon" "$hdd1" "$icon" "$hdd2"

@ -0,0 +1,7 @@
#!/bin/bash
icon=""
mem="$(free -h | awk '/^Mem/ { print $3"/"$2 }' | sed s/i//g)"
printf " %s %s \\n" "$icon" "$mem"

@ -0,0 +1,21 @@
#!/bin/bash
icon=""
iface="enp4s0"
up=""
down=""
R1="$(cat /sys/class/net/$iface/statistics/rx_bytes)"
T1="$(cat /sys/class/net/$iface/statistics/tx_bytes)"
sleep 1
R2="$(cat /sys/class/net/$iface/statistics/rx_bytes)"
T2="$(cat /sys/class/net/$iface/statistics/tx_bytes)"
TBPS="$(expr $T2 - $T1)"
RBPS="$(expr $R2 - $R1)"
TKBPS="$(expr $TBPS / 1024)"
RKBPS="$(expr $RBPS / 1024)"
IPADDR="$(ip a show dev $iface | awk '/inet / { print $2 } ')"
printf " %s [%s] %s %skB/s %s %skB/s \\n" "$icon" "$IPADDR" "$up" "$TKBPS" "$down" "$RKBPS"
#echo "tx $iface: $TKBPS kB/s rx $iface: $RKBPS kB/s"

@ -1,5 +0,0 @@
#!/bin/sh
# simple script to show systemmemory in dwmblocks
free -h | awk '/^Mem/ { print $3"/"$2 }' | sed s/i//g

@ -0,0 +1,3 @@
#!/bin/bash
/usr/bin/maim -s ~/Pictures/Screenshot_$(date +%Y%m%d_%H:%M:%S).jpg
Loading…
Cancel
Save