[wifi_dmenu.sh]: add wifi_dmenu.sh
This commit is contained in:
@ -34,3 +34,4 @@
|
|||||||
laptop to my phone.
|
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`).
|
- `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.
|
- `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
7
wifi_dmenu.sh
Executable 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: "))
|
Reference in New Issue
Block a user