[wifi_dmenu.sh]: Display error messages in the notification when connection fails

Redirect stderr to stdout so that it appears in the notification
This commit is contained in:
2024-08-23 16:09:49 +01:00
parent ca403122c2
commit eccb7686e8

View File

@ -5,4 +5,4 @@ script_name="$(basename "$0")"
notify-send "$script_name" "Scanning for available networks..." notify-send "$script_name" "Scanning for available networks..."
# cutting the first 9 characters of the nmcli output as it will contain empty fields which will mess up awk parsing # cutting the first 9 characters of the nmcli output as it will contain empty fields which will mess up awk parsing
notify-send "$script_name" "$(nmcli connection up $( nmcli device wifi list | cut --characters=9- | awk '(NR > 1){ print $2}' | sort | uniq | dmenu -p "Connect to network: "))" notify-send "$script_name" "$( nmcli connection up $( nmcli device wifi list | cut --characters=9- | awk '(NR > 1){ print $2}' | sort | uniq | dmenu -p "Connect to network: ") 2>&1 )"