Connect to wireless network from command line, for wicd

In my personal life, I’m endeavoring to use less and less systemd and its derivatives and relatives and any other *ives (and I’m not even being figurative!).

So, for my devuan installs on my laptop fleet, I’m trying to automate all my installs and configs, because I automate things for work. And part of my documented workflow is to “Add to the wicd interface settings screen device ‘wlan0’ for the wireless nic.” So I wanted to learn how to connect to my wireless network from the command line.

After some research, I discovered a brief way to do it. I hope this helps somebody.

nid="$( wicd-cli -ySl | awk -v "n=${MYNETWORK}" '$NF==n {print $1}' )"
wicd-cli -y -n"${nid}" -p apsk -s "${MYPASSPHRASE}"
wicd-cli -y -n"${nid}" -c

I will explain a few parts briefly, but for more details you should check out the references below.
-y use wireless connection.
-S scan
-l list cached results, so what we just learned from the scan
-n use this network id, which is a number internal to wicd to keep track of the networks it has seen.
-p display a property
-s value, so with a -p SOMETHING and -s VALUE combo, it will set the property for you instead of display it.
-c connect.

In my tests, I discovered that I was unable to implement the saved password with the connect command. So it takes multiple invocations of wicd-cli, but I can live with that.
This for some reason took me way less time to research how to connect with wicd, than with nmcli in the past.



  1. Helped me minimally Wicd tutorial []
  2. what enlightened me about -p SOMETHING -s VALUE as opposed to -s ‘SOMETHING=VALUE’ like I tried at first README.cli []
  3. how I found wicd-cli in the first place: Linux: Can I get the wicd daemon to disconnect my wireless network from the command line? []

Web searches used

  1. wicd-cli connect example [google]
  2. wicd set wireless network from command line

man pages

  1. wicd-cli(8)
  2. wicd(1)

Alternatives and other reading

  1. How to connect and disconnect to a network manually in terminal? []

Fedora and scanners

If you are running Fedora and you want to use a scanner, you probably already have sane (backends at least) and simple-scan installed.

What is incredibly frustrating is when scanimage -L shows you the scanner, but simple-scan does not list it.

What you are missing is

sudo dnf install libnsl

This package is different from libnsl2, which is probably already installed. But some applications must depend on libnsl, including simple-scan. Thanks to suspiciousmilk of Ask Fedora.



  1. Brother scanner driver don’t work []

PolicyKit rule for admins to automatically mount iso files in file manager

If you use a graphical file manager and want to take advantage of automatically mounting .iso files, you might be prompted to authenticate as an authorized user. This interrupts the workflow, and should not happen.

XFCE PolicyKit Agent warning about authentication required to perform an action
Workflow interruption detected! A Linux guru is needed if you want to automate this.

Here is a polkit rule you can make and place in the /usr/lib/polkit-1/rules.d directory. I don’t think freeipa has policykit abilities, so you have to apply this file locally for any system that needs it.

// File: /usr/share/polkit-1/rules.d/mount-iso.rules
// Author: bgstack15
// Startdate: 2018-12-29 19:18
// Title: PolicyKit Rules for Allowing FreeIPA admins to mount loop devices for ISO files
// History:
// Usage:
// Reference:
//    lightdm.rules
// Documentation: comments are C-style
polkit.addRule(function(action, subject) {
    if ( ("org.freedesktop.udisks2.filesystem-mount-system") == 0) || 
         ("org.freedesktop.udisks2.loop-modify-others") == 0) ) {
        polkit.log("action=" + action);
        polkit.log("subject=" + subject);
        if (subject.isInGroup ("wheel") || subject.isInGroup("admins") || subject.isInGroup("cdrom") {
            return polkit.Result.YES;

I realize the logic is crude so if you have any improvements, please share them!

X11 change application titlebar and icon in window manager panel

If you are trying to change the listing of a running application in the window list, regardless if you’re running XFCE or Cinnamon or another display manager, you might want to go down the same line of research I did.

In an upcoming article, I will talk exactly about how I run a game in DOSBox with a wrapping shell script and batch file. But today, this article is about how I rename the window and change its icon.

First, I run the application and I know what the titlebar looks like. I have to learn the window ID to set the icon.

I set the window title to the preferred name, and then use that window name to search and then execute a series of commands, which change the class and redraws the window so the panel learns the correct name.

tid="$( xwininfo -root -children -all | grep -iE "dosbox.*STARTREK" | awk '{print $1}' )"
echo "modifying id ${tid}"
xseticon -id "${tid}" "${ICONFILE}"
xdotool set_window --name "STARTREK" "${tid}"
xdotool search --name "STARTREK" set_window --classname "STARTREK" --class "STARTREK" windowunmap windowmap

I researched on the Internet to discover how to change the application icon. I had to compile a nifty little tool written in C (xseticon), so I bundled it into an rpm. But it does exactly as the description says.
Changing what appears on my Cinnamon panel was a different story, however.
I eventually remembered using xdotool for something in the past, and decided to read its man page. After a lot of experimentation, I got the classname and class adjusted. But it still didn’t do any good.
So I finally tried the windowunmap command, which was recommended after doing some other change. And then I had to hurriedly windowmap it again, so I could see the window. It doesn’t minimize the application; it removed it from the panel and display entirely, even though the process was still running. After the windowmap, it showed the custom icon, and the exact title I wanted!
I learned how to chain the commands together into fewer invocations.


Web links

link to xseticon
compiling xseticon
xseticon source
rpm spec
xseticon rpm in copr

Further reading

Internet searches

xprop change icon of running application

Man pages