From 3cd9138c9d8fb9be248c75330cca9da47f4d2e8a Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Sun, 10 May 2026 22:57:02 +0200 Subject: added a whole bunch of scripts --- dwm-status | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'dwm-status') diff --git a/dwm-status b/dwm-status index 7674482..e95dad3 100755 --- a/dwm-status +++ b/dwm-status @@ -1,5 +1,4 @@ #!/bin/sh - while true; do datetime="$(date '+%d %a %H:%M')" @@ -19,13 +18,19 @@ while true; do net="offline" fi - # VPN (tun0 / wg0 / proton0 – adjust to match your system) - if ip link show tun0 >/dev/null 2>&1 || ip link show wg0 >/dev/null 2>&1 || ip link show proton0 >/dev/null 2>&1; then - vpn="VPN on" + # CPU usage + cpu="$(top -bn1 | awk '/^%Cpu/{print int($2+$4) "%"}')" + + # Memory + mem="$(free -m | awk '/^Mem/{print $3 "M"}')" + + # VPN status + if ip link show wg-vps >/dev/null 2>&1; then + vpn="VPS on" else - vpn="VPN off" + vpn="VPS off" fi - xsetroot -name "VOL $vol | NET $net | $vpn | $datetime " + xsetroot -name "$datetime | CPU $cpu | MEM $mem | VOL $vol | NET $net | $vpn " sleep 5 done -- cgit v1.3