That worst designed thing known as systemd

Maybe systemd was not designed for people who customize their Linux systems a lot. So it must have been designed for the “average” end users, right?

How about something as end-user as switching wifi networks? Switching to a better wifi network is such a common thing you’d want to do (at least for people whose school sabotage their own eduroam connections so that people have to disable it while on campus but reenable it while off campus—yes, I’m talking about my own school, hello OCAD ITS) you’d think systemd must make it easy for the end user? How about easy to automate, as in you can script it?

When I started using Ubuntu a year ago I spent tons of time figuring out how to script Network Manager and all the pages I found suggest this simply can’t be done. You have to use the applet. So much for easy to use.

But nm-applet crashes all the time, and sometimes when you restart it it won’t even work. So what to do?

Just a few minutes ago I discovered that nmcli’s c command actually has an up subcommand, so I thought I discovered the treasure. But how well did it work, like actually?

ambrose@pingu:~$ nmcli c up 'xxxxxxxxxxxxxx 1'
Error: Connection activation failed: No suitable device found for this connection.
ambrose@pingu:~$ nmcli c down xxxxx
Error: 'xxxxx' is not an active connection.
Error: no active connection provided.
ambrose@pingu:~$ nmcli c down xxxxx\ 1
Connection 'xxxxx 1' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/0)
ambrose@pingu:~$ nmcli c up 'xxxxxxxxxxxxxx 1'
Error: Connection activation failed: No suitable device found for this connection.
ambrose@pingu:~$ nmcli c up 'xxxxxxxxxxxxxx 1' ifname wlp3s0
Error: device 'wlp3s0' not compatible with connection 'xxxxxxxxxxxxxx 1'.
ambrose@pingu:~$ 

Hello? How’s a wifi device incompatible with a wifi connection?

Ok, maybe it’s a permissions problem (which means their error messages are crap).

ambrose@pingu:~$ sudo nmcli c up 'xxxxxxxxxxxxxx 1' ifname wlp3s0
[sudo] password for ambrose: 
Error: device 'wlp3s0' not compatible with connection 'xxxxxxxxxxxxxx 1'.
ambrose@pingu:~$ 

Ok, I give up. I really don’t understand why anyone would think this Network Manager thing helps the end user. I had to work with wpa_supplicant directly on the Pi; working directly with wpa_supplicant is way easier than this once you figured out how to work with wpa_supplicant, you can’t even figure out how Network Manager does its thing.