This commit is contained in:
2026-02-05 01:58:08 +01:00
parent 96a35f670b
commit b21abf9656
156 changed files with 12298 additions and 0 deletions

27
bin/conky_getactiveinet.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
CFGFILE="$HOME/.config/conky/Network_mbcolor.conkyrc"
rm /tmp/xx*
cd /tmp
csplit -s ${CFGFILE} /conky.text/
#IFACE=$(ip route get 8.8.8.8 | awk -- '{printf $5}')
IFACE=$(ip route get 8.8.8.8 | awk '{for(i=1; i<NF; i++) {if($i=="dev") dev=i+1} print $dev}')
cat <<EOF >> /tmp/xx00
conky.text = [[
\${color0}NETWORK
\${color0}Device \${alignr}\${color1}$IFACE
\${color0}IP \${alignr}\${color1}\${addr $IFACE}
\${color0}Download \${color1}\${downspeed $IFACE} \${alignr}\${color1}\${upspeed $IFACE}\${color0} Upload
\${color2}\${downspeedgraph $IFACE 30,100 -t} \${alignr} \${upspeedgraph $IFACE 30,100 -t}
\${color0}Total Down \${color1}\${totaldown $IFACE} \${alignr}\${color1}\${totalup $IFACE}\${color0} Total Up
\${color0}\${hr}\${color1}
\${execi 30 netstat -ept | grep ESTAB | awk '{print \$9}' | cut -d/ -f2 | sort | uniq -c | sort -nr}
]];
EOF
cat /tmp/xx00 > ${CFGFILE}