Make i3blocks pub-ip a script
This commit is contained in:
parent
bfffc1f961
commit
8a0b0aedef
3 changed files with 16 additions and 1 deletions
|
@ -357,6 +357,9 @@ i3blocks:
|
|||
- symlink:
|
||||
- dotfiles/i3/scripts/free_disk_space
|
||||
- ~/.config/i3blocks/scripts/free_disk_space
|
||||
- symlink:
|
||||
- dotfiles/i3/scripts/pub-ip
|
||||
- ~/.config/i3blocks/scripts/pub-ip
|
||||
|
||||
markdown viewer:
|
||||
- write:
|
||||
|
|
|
@ -77,7 +77,6 @@ interval=900
|
|||
|
||||
[pub-ip]
|
||||
interval=5
|
||||
command=echo "IP: $(curl ifconfig.me)"
|
||||
|
||||
[battery]
|
||||
command=echo " $(upower -d | grep 'percentage' | awk '{print $2}' | head -n 1) ($(upower -d | grep 'time to empty' | awk -F: '{print $2}' | awk '{print $1,$2}' | head -n 1))"
|
||||
|
|
13
dotfiles/i3/scripts/pub-ip
Executable file
13
dotfiles/i3/scripts/pub-ip
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
CYAN="<span foreground='#8ccaff'>"
|
||||
GREEN="<span foreground='#8cff8a'>"
|
||||
NC="</span>"
|
||||
|
||||
ip="$(curl ifconfig.me)"
|
||||
|
||||
if ip link show tun0 >/dev/null 2>&1; then
|
||||
echo "${GREEN}VPN:${NC} $ip"
|
||||
else
|
||||
echo "${CYAN}IP:${NC} $ip"
|
||||
fi
|
Loading…
Add table
Reference in a new issue