diff --git a/i3/run.sh b/i3/run.sh index 7fb0d56..99b046d 100755 --- a/i3/run.sh +++ b/i3/run.sh @@ -70,3 +70,17 @@ fi if [ "$1" = "paste" ]; then DISPLAY=:0.0 xdotool type --clearmodifiers --file <(xsel) fi +if [ "$1" = "ip" ]; then + shift + local RET=0 + if [ "$(hostname)" = "MMLin" ]; then + if grep -q "$1" < <(ifconfig enp2s0f0); then + RET=1 + fi + elif [ "$(hostname)" = "G2" ]; then + if grep -q "$1" < <(ifconfig enp1s0;ifconfig wlp2s0); then + RET=1 + fi + fi + echo $RET +fi