NAME - UI for selecting and connecting to WLAN access points (APs)

SYNOPSIS -key my_essid=1234567890 -list my_essid


    -help            print help message and quit
    -man             full documentation and quit
    -verbose         more messages, more detailed help output
    -quiet           no messages during operation
    -version         returns version no
    -key             ESSID=wep_key_value pairs
    -passwd          ESSID=password pairs
    -list            specify  ESSID to put at top of list for connect
    -rescan_interval interval (in seconds) to rescan if no APs found
    -rescan_count    number of times to rescan if no APs found
    -quit_on_connect whether to quit program when successfully connected
    -autoconnect     try to connect to any APs listed as good for autoconnect
    -autoconnect_to  give ESSID name of AP for which to try autoconnect 
    -noui            just do autoconnect, don't start UI for connect if fails 
    Options configuration file containing any of the options above in
    format given by Getopts::Argvfile E<lt>www.cpan.orgE<gt> - the
    format is the same as for the command line, but allowing multiple
    lines and comments.


Print a long help message and exit.

Output the man page and exit.

Gives out some extra messages as it works. Adding -verbose to -help outputs more help.

Gives less messages.

Returns version no to the console.

Specify WEP key(s) to use for connecting to a particular ESSID; e.g. -key my_essid=1234567890 -key other_essid=0987654321

Specify password(s) to use for connecting to a particular ESSID; e.g. -passwd my_essid=my_pass1 -key other_essid=my_pass2

Specifies one or more ESSIDs to put at top of list for connect; e.g. -list my_essid -list other_essid

The APs are listed in the order they appear on the command line (or in the options file - see below). APs are only listed if they also appear in the interface scan results. APs not specified using the -list option, but detected by the interface scan, are listed in order of signal strength.

Sets the interval (in seconds) to wait before rescanning for APs, if no APs found (default 2).

Sets the number of times to rescan if no APs found (default 1).

By default, and with the -quit_on_connect option, the program will finish when connection to an AP is successful. To reverse this default (so program does not quit) use the -noquit_on_connect version of this option.

If this option is set, will search for any APs listed as good for autoconnecting (see -autoconnect_to below), and which either do not need encryption, or have passwords / WEP keys given elsewhere in the options (see -key, -passwd). If it finds such an AP, it will try and connect. If the connection is successful, the GUI will not start, and the program stops. If it fails, by default, launches the GUI (see -noui option below).

Give one or many ESSID names of APs for which to try autoconnect; e.g. -autoconnect_to my_essid -autoconnect_to other_essid

If this option is set, the program will only try and autoconnect; if it fails, it will not launch the GUI to select another AP.

CONFIGFILE uses two types of configuration file, a system configuration file (see INSTALLATION below), and option configuration files, described here.

Option configuration files can specify options in the same format as for the command line, except options can be specified across many lines, and comments can be interposed: e.g -verbose @myconfig

where ``myconfig'' might be the following text file

 # Configuration file for wlan-ui perl program
 -key "my_essid"='1234567890'
 -key 'test essid'='0987654321'
 -list my_essid
 -list other_essid
 -autoconnect_to my_essid

This file sets the WEP keys for my_essid and test_essid, puts my_essid and other_essid at the top of listed APs (if they turn up on a scan), and will attempt to connect to my_essid on startup.

Configuration files are read in the following order: in the directory of the script; in your home directory; in the current directory; and any configuration file passed on the command line. Options in files read later override those in earlier files. Options passed on the command line override options passed in files, and any options specified earlier on the the command line than the @configfile item.


You will need various CPAN modules installed <>:



Installation is simple and inelegant. Copy the program file ( to a directory on your path. Next, create a new system configuration file to reflect your system. The system configuration file is different from the options configuration file (@configfile, above). The system configuration file tells the program how to configure the wireless interface, and the options configuration file sets defaults for access points and other things. The default location of the system configuration file is /etc/wlan-uirc; you can change this by editing the contents of the $sys_config variable in the program file. Below is an example file, which uses the ipw2200 module <> as my wireless driver. By default this gives me a network device attached to 'wlan0'.

  # Example system configuration file 
  # Edit and save as /etc/wlan-uirc
  # Wireless driver module to load
  $MODULE = 'ipw2200';
  # Module parameters
  # Wireless network device - e.g. 'wlan0'.
  # If not defined we use /proc/net/wireless to find the device
  $DEVICE = undef;
  # Commands for manipulating wlan module etc
  # We will find unspecified commands from the path
  $CMDS = {'lsmod',  '/sbin/lsmod', 
           'modprobe', '/sbin/modprobe',
           'load',     undef,       # modprobe used by default
           'unload',   undef,       # modprobe -r used by default
           'iwconfig', '/sbin/iwconfig',
           'iwlist',   '/sbin/iwlist',
           'ifconfig', '/sbin/ifconfig',
           'ps',       undef,
           'dhcpcd',   '/sbin/dhclient'};

The 'load' and 'unload' commands are usually left undefined, as above, but if you want to use scripts, you can define them. For example, the driverloader wireless driver <> uses a system init script to start and stop the wireless driver. To make this work, you could try something like:

  $MODULE = 'driverloader';  
  $CMDS = {'lsmod',  '/sbin/lsmod', 
           'modprobe', undef,      # not needed in this case
           'load',     "/sbin/service $MODULE start",
           'unload',   "/sbin/service $MODULE stop", 

Note the quotes (``) around the load and unload command, to allow variable substitution.

If you leave the $DEVICE variable undefined, the script will try and find your wireless network device using the /proc/net/wireless interface. If this fails, you will get messages including ``WLAN device not found'', and will need to set the $DEVICE variable to the name of your wireless interface (e.g. $DEVICE = 'wlan0';).

You can leave $MODULE undefined, in which case the wireless interface is assumed to be always up, and no attempt is made to check, unload etc, and you don't need to define lsmod; modprobe; load; unload. will need root permissions to run the various wireless configuration programs. I do this by giving myself sudo permission to run the script. Here's some excerpts from my /etc/sudoers file:

   # Host alias specification
   Host_Alias   LAPTOP = fetastra
   # User alias specification
   User_Alias   WIRELESS = myself, myfriend
   # Run wlan-ui
   WIRELESS LAPTOP = NOPASSWD: /usr/local/bin/

I can then run with

  sudo /usr/local/bin/

For some security, make sure is writeable only by root.

Note that the system configuration file (/etc/wlan-uirc) can contain commands that will be executed from within the program. You may want to make sure that the configuration file is only writeable by root.

DESCRIPTION is a program to connect to wireless networks. It can be run as a GUI which will offer a list of available networks to connect to. is based on wlan-zenity, written by Mirza Muharemagic <> and released under the BSD license.


See description of options for list of features.


We don't currently use the MAC address of the AP when connecting. This will give odd effects when there is more than one AP with the same ESSID. Search for the get_ap_by_essid function in the file to see where this will cause a problem.


Matthew Brett <matthewb>

Mirza Muharemagic <>


This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License distributed with Perl version 5.003 or (at your option) any later version. Please refer to the Artistic License that came with your Perl distribution for more details.