Write a simple tool for connecting to WiFi

This commit is contained in:
Ohad Livne 2025-06-04 22:45:32 +03:00
parent 1a46c725ca
commit c6f0f4d1c7
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D
2 changed files with 16 additions and 0 deletions

View file

@ -76,6 +76,9 @@ input type:touchpad {
bindsym $launch+f exec firefox --private-window
bindsym $launch+Shift+f exec firefox
# Switch WiFi network
bindsym $launch+Equal exec .wifi-wizard
# Kill focused window
bindsym $wm_mod+q kill

13
.local/bin/.wifi-wizard Executable file
View file

@ -0,0 +1,13 @@
#! /usr/bin/sh
ssid=$(nmcli --fields SSID,RATE,SIGNAL,BARS device wifi list | fuzzel --dmenu --width 40 | awk '{print $1}')
if [ -z "${ssid}" ]; then
exit $?
fi
password=$(fuzzel --dmenu --password)
if [ $? -ne 0 ]; then
exit $?
fi
nmcli device wifi connect "${ssid}" password "${password}"