From 8d513837b076b31c131e49b9ee47a5816fef3030 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Sun, 6 Nov 2022 18:15:56 +0530 Subject: wifi-menu notification+icon addition --- .local/share/icons/wifi-slash.svg | 1 + .local/share/icons/wifi-solid.svg | 1 + .scripts/wifi-menu | 10 +++++++++- .xinitrc | 3 +-- 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .local/share/icons/wifi-slash.svg create mode 100644 .local/share/icons/wifi-solid.svg diff --git a/.local/share/icons/wifi-slash.svg b/.local/share/icons/wifi-slash.svg new file mode 100644 index 0000000..7771281 --- /dev/null +++ b/.local/share/icons/wifi-slash.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/.local/share/icons/wifi-solid.svg b/.local/share/icons/wifi-solid.svg new file mode 100644 index 0000000..b421544 --- /dev/null +++ b/.local/share/icons/wifi-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/.scripts/wifi-menu b/.scripts/wifi-menu index 4713c00..df9f9e5 100755 --- a/.scripts/wifi-menu +++ b/.scripts/wifi-menu @@ -5,7 +5,15 @@ choice=$(echo -e "up\ndown\nconnect" | dmenu -p "Do you wish to connect to a wi- case $choice in "up"|"down") ssid=$(nmcli -t -f ssid dev wifi| cut -d\' -f2 | dmenu -p "Select Wifi  " -l 20) - nmcli c "$choice" "$ssid" ;; + nmcli c "$choice" "$ssid"; + if [ "$choice" == "up" ]; then + dunstify "Connected" "You are now connected to $ssid" -i wifi-solid + elif [ "$choice" == "down" ]; then + dunstify "Disconnected" "You have disconnected from $ssid"-i wifi-slash + else + : + fi;; + "connect") bssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | dmenu -p "Select Wi-Fi  :" -l 20 | cut -d' ' -f1) pass=$(echo "" | dmenu -P -p "Enter Password  : ") diff --git a/.xinitrc b/.xinitrc index 56cfb98..5dbaec9 100644 --- a/.xinitrc +++ b/.xinitrc @@ -3,9 +3,8 @@ dunst & sxhkd & setbg & -nm-applet & unclutter & -picom --experimental-backends & +picom & setxkbmap -option caps:escape & dwmblocks & exec dwm -- cgit v1.2.3