This script is meant to provide a simple way to connect to wi-fi networks without the need for something like NetworkManager. Its precise mechanisms for doing this are outlined in the comments at the top of the script. There is a little bit of setup to get it working seamlessly:
- First, compatibility. This script assumes a system that has/uses
wpa_supplicant
,iw
, anddhcpcd
. All of these are pretty common packages, but some minimal distributions may not ship with all of them. Additionally, a build of dmenu with the password patch is required. - To make the calls to
wpa_supplicant
andiw
, the script has to be provided with the name of your computer's wi-fi device. To find this, runip link
to list out all of your network devices. The one you're looking for probably looks something like "wlp2s0" or "wlan0". Once you find it, set it as the value ofDEVICE
at the top of the script. - Because the wi-fi commands used in the script have to talk directly to
the hardward, many have to be run as root. If there's a clean fix for this
using a udev rule or something, I haven't found it. My preferred solution
at the moment is to set the whole script to require root privileges,
then carve out a password exception
for it in
/etc/sudoers
.
- When you tell
dmenu_wifi
to remember a wi-fi network, it will write a config file for it and store it in/etc/wpa_supplicant/known_networks/
. dmenu_wifi
currently does not have any way of knowing on its own whether a network requires a password, so it will prompt you to tell it whether to collect one or not whenever you connect to a new network.