aboutsummaryrefslogtreecommitdiff
path: root/extras/HOME/.xmonad/xmobar-wifi
blob: 0422cc590bee5ae1e821093e2c7e60349e02b326 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

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" && -z "$ethernet" ]] ; then
  echo "<fc=#404040>  </fc>"
elif [[ -z "$ethernet" ]] ; then
  name=${wifi/ */}
  echo "<fc=#ffffff>  $name</fc>"
else
  devname=$(echo "$ethernet" | awk '{print $4}')
  echo "<fc=#ffffff> $devname</fc>"
fi