Skip to content

Commit

Permalink
fix: properly display 'no wifi' message
Browse files Browse the repository at this point in the history
  • Loading branch information
cybardev committed Oct 24, 2024
1 parent 53fc145 commit e2462c6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cutefetch
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,16 @@ init() {
readonly kern="$(uname -r | cut -f1 -d '-')"
readonly shell=$(basename $SHELL)
readonly res="$(xdpyinfo | grep 'dimensions' | grep -oE '[0-9]+x[0-9]+' | head -n 1)"
readonly net="$(nmcli -g common | grep -m 1 connected | cut -f4- -d ' ')"
[[ -z $net ]] && readonly net="no wifi"
net="$(nmcli -g common | grep -m 1 connected | cut -f4- -d ' ')"
[[ -z $net ]] && readonly net="no wifi" || readonly net="$net"
;;
Darwin*)
readonly wm="$(get_wm_mac)"
readonly kern="$(uname) $(uname -r)"
readonly shell="$(basename "$SHELL")"
readonly res="$(get_res_mac)"
readonly net="$(ipconfig getsummary en0 | grep "[^B]SSID" | cut -f2 -d ":" | xargs)"
net="$(ipconfig getsummary en0 | grep "[^B]SSID")"
[[ -z $net ]] && readonly net="no wifi" || readonly net="${net:9}"
;;
*)
echo "We do not support $1 yet."
Expand Down

0 comments on commit e2462c6

Please sign in to comment.