initial commit

This commit is contained in:
Tristan
2017-06-06 18:02:21 +02:00
commit 178bfef951
481 changed files with 43275 additions and 0 deletions

13
.i3/scripts/wan-or-not.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/zsh
#First arg is icon for WAN IP, Second argument is icon for local IP, third for offline
wanip=$(dig +short myip.opendns.com @resolver1.opendns.com);
if [[ $wanip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
echo "<span foreground='#00CC33'>$1</span>:$wanip"
else
wanip=$(ip addr show dev wlan0 | grep "inet " | awk '{print $2}')
if [[ $wanip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} ]]; then
echo "<span foreground='#3300CC'>$2</span>:$wanip"
else
echo "<span foreground='#CC0033'>$3</span>"
fi
fi