dotfiles/stumpwm/stumpwm.d/modeline.lisp

29 lines
679 B
Bash
Executable File

#!/bin/bash
NIC=$(nmcli d status | grep 'enp2s0' | tr -s ' ' ':' | cut -d':' -f3)
WIC=$(nmcli d status | grep 'wlp3s0' | grep -v 'p2p' | tr -s ' ' ':' | cut -d':' -f3)
if [ $NIC == 'conectado' ]; then
NET=ETH:UP
elif [ $WIC == 'conectado' ]; then
NET=WLP:UP
else
NET=NET:DW
fi
echo -e "\
[US:$(mpstat -u | grep all | tr -s ' ' ';' | cut -d';' -f3)%]\
[SY:$(mpstat -u | grep all | tr -s ' ' ';' | cut -d';' -f5)%]\
[MEM:$(free -h | awk 'NR==2{printf $3}')]\
[$(echo $NET)]\
[$(date "+%d/%m/%y")]\
[$(date "+%H:%M")]\
[$(acpi -b |\
cut -d' ' -f3,4 |\
sed s/Discharging,\ /-/ |\
sed s/Charging,\ /+/ |\
sed s/Unknown,\ /\#/ |\
sed s/Full,\ // |\
sed s/,//)]"