diff options
Diffstat (limited to 'extras')
| -rwxr-xr-x | extras/HOME/.xmonad/xmobar-wifi | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/extras/HOME/.xmonad/xmobar-wifi b/extras/HOME/.xmonad/xmobar-wifi index bc55725..0422cc5 100755 --- a/extras/HOME/.xmonad/xmobar-wifi +++ b/extras/HOME/.xmonad/xmobar-wifi @@ -4,11 +4,15 @@ runtime_dir=$XDG_RUNTIME_DIR/rde/vars/ mkdir -p $runtime_dir +ethernet="$(nmcli connection show --active | grep "ethernet")" wifi="$(nmcli connection show --active | grep "wifi")" -if [[ -z "$wifi" ]] ; then +if [[ -z "$wifi" && -z "$ethernet" ]] ; then echo "<fc=#404040> </fc>" -else +elif [[ -z "$ethernet" ]] ; then name=${wifi/ */} echo "<fc=#ffffff> $name</fc>" +else + devname=$(echo "$ethernet" | awk '{print $4}') + echo "<fc=#ffffff> $devname</fc>" fi |