From 344ffcb005409bf71f39458d410c3a920ad12eb0 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sat, 17 Aug 2024 23:00:45 +0100 Subject: [PATCH] [wifi_dmenu.sh]: add notification of result of connection attempt --- wifi_dmenu.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wifi_dmenu.sh b/wifi_dmenu.sh index 130d9ee..fa25cc7 100755 --- a/wifi_dmenu.sh +++ b/wifi_dmenu.sh @@ -1,7 +1,8 @@ #!/bin/sh # Script to connect to an available WiFi network with a dmenu prompt. -notify-send "$(basename "$0")" "Scanning for available networks..." +script_name="$(basename "$0")" +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 -$(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: "))"