[wifi_dmenu.sh]: add wifi_dmenu.sh

This commit is contained in:
2024-08-17 19:15:02 +01:00
parent 4fc2fb0b34
commit df5bc22cda
2 changed files with 8 additions and 0 deletions

View File

@ -34,3 +34,4 @@
laptop to my phone.
- `trippy.sh`: script that displays random visual data to the screen (only works when called from a TTY, by a user who has write access to the `fb0` device, e.g. `root`).
- `webcam.sh`: one-line script that uses the video viewer program `mpv` as a webcam by using `/dev/video0` as its video file source.
- `wifi_dmenu.sh`: script to connect to an available WiFi network with a dmenu prompt.

7
wifi_dmenu.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# Script to connect to an available WiFi network with a dmenu prompt.
notify-send "$(basename "$0")" "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: "))