Add labels for pub-ip script

This commit is contained in:
flyingscorpio@clevo 2022-10-14 15:21:29 +02:00
parent 282674d1dd
commit ed049d62ed
2 changed files with 10 additions and 9 deletions

View file

@ -47,20 +47,22 @@ LABEL=
interval=60
[temperature]
label=<span foreground='#c7505c'>  </span>
label=<span foreground='#c7505c'> </span>
interval=10
[cpu_usage]
interval=10
LABEL=<span foreground='#f59335'>  </span>
LABEL=<span foreground='#f59335'> </span>
[free_disk_space]
interval=10
LABEL=<span foreground='#fec7cd'>  </span>
LABEL=<span foreground='#fec7cd'> </span>
DISK=$HOME
[pub-ip]
interval=5
LABEL_VPN=<span foreground='#8cff8a'>廬 </span>
LABEL_IP=<span foreground='#8ccaff'> </span>
[battery]
THRESHOLD=10
@ -68,7 +70,7 @@ interval=5
[calendar]
interval=60
LABEL=<span foreground='#ffca8c'>  </span>
LABEL=<span foreground='#ffca8c'> </span>
DATEFMT=+ %a %d %b - %H:%M
SHORTFMT=+ %d.%m.%Y
HEIGHT=180

View file

@ -1,13 +1,12 @@
#!/bin/bash
CYAN="<span foreground='#8ccaff'>"
GREEN="<span foreground='#8cff8a'>"
NC="</span>"
LABEL_VPN=${LABEL_VPN:-VPN}
LABEL_IP=${LABEL_IP:-IP}
ip="$(curl ifconfig.me)"
if ip link show tun0 >/dev/null 2>&1; then
echo "${GREEN}VPN:${NC} $ip"
echo "${LABEL_VPN}$ip"
else
echo "${CYAN}IP:${NC} $ip"
echo "${LABEL_IP}$ip"
fi