This repository has been archived on 2024-09-01. You can view files and clone it, but cannot push or open issues or pull requests.
al-skel/home/.config/polybar/scripts/network.sh

14 lines
238 B
Bash
Raw Normal View History

2017-10-16 14:38:02 -05:00
#!/usr/bin/env bash
online=$(ip addr | grep "state UP" | cut -d ":" -f2)
#connected=""
#offline=""
2017-10-23 18:35:35 -05:00
connected=""
offline=""
2017-10-16 14:38:02 -05:00
if [[ "$online" ]]; then
2017-10-23 18:35:35 -05:00
echo ${connected}
2017-10-16 14:38:02 -05:00
else
2017-10-23 18:35:35 -05:00
echo ${offline}; sleep 0.6; echo ${connected}
2017-10-16 14:38:02 -05:00
fi