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