A Quick Introduction to StumpWM on Linux

StumpWM is a tiling, keyboard driven X11 Window Manager written entirely in Common Lisp.”

Why Use It

StumpWM will likely cut down a lot of your use of a mouse. There’s many reasons to use the mouse less, such as speed (entering in a key combination is faster than using a mouse), carpal tunnel syndrome, and so forth.

I like StumpWM because it helps keep me on the command line. I’ve had some experience with it’s predecessor, Ratpoison, while trying to set up a C201 with free software last year, and I liked the focus on one application at a time and being able to type in a few keystrokes to move between them. So, I figured StumpWM was worth a try. Recommended, even if you don’t end up sticking with it.

Installing

Within Ubuntu, changing window managers is fairly easy. You just need to install StumpWM with the apt package manager.

$ sudo apt-get install stumpwm

Then, logout and select the gear icon near the enter button and select StumpWM from the drop-down menu and login as usual.

Quick Start

On logging in, you will notice StumpWM strips out most of what is standard in most window managers. There’s no clock. There’s no dock. There’s no background. There’s no list of apps. There’s nothing to navigate multiple desktops. There’s only a blank screen with a box in the upper right corner: “Welcome to Stump Window Manager. / Type C-t ? for help.”

The first thing you’ll want to do when you log in is type: Control-t together then the letter c and the Enter key (or abbreviated: C-t c, same style as in Emacs). This creates a console, and it takes up all the screen real estate. Like Emacs, it is possible to split the screen into a variety of configurations. For simplicity here and due to my preference for dealing with one application at a time, I’ll assume a single application in the screen.

So, if you want to use Firefox, type:

$ firefox &

The &; starts firefox as a background process. You can even change your .bash_aliases file to do this automatically for you.

Of course, there are command keys for other functions: C-t a will give you the time. C-t ; quit, then press Enter to quit.

If you want to switch back and forth between the console and Firefox, you type: C-t C-t. If you have multiple windows, you can see them all and chose them from a drop-down meny by typing: C-t ". Each window also has a number listed, which you can access directly, by typing: C-t 0 (assuming the window is 0).

That’s all you need to get up and running. If you want to start customizing your configuration, I’ve also included a straight-forward .stumpwmrc configuration file below, which among other changes includes replacing C-t with s-t (Windows key + t), which is useful if you want to continue using C-t to open new tabs in Firefox without having StumpWM supersede it.

Also, this configuration file will add back in a mode line, so you can have the time, battery level and option applications with numbers, which can be useful.

;; -*-lisp-*-                                                                  
;; .stumpwmrc                                                                                                                              
                                                                               
(in-package :stumpwm)                                                          
                                                                             
;;; Configuration                                                              
                                                                               
;; Change prefix key to Windows key                                            
(set-prefix-key (kbd "s-t"))                                                   
                                                                               
;; Changing to pointer from X default to standard left                         
(stumpwm:run-shell-command "xsetroot -cursor_name left_ptr")

;; Change prefix key to Windows key                                            
(set-prefix-key (kbd "s-t"))                                                   
                                                                               
;; Changing to pointer from X default to standard left                         
(stumpwm:run-shell-command "xsetroot -cursor_name left_ptr")                   
                                                                               
;; Turn-off start-up message                                                        
(setq *startup-message* nil)                                                   
                                                                               
(stumpwm:run-shell-command                                                     
 "feh --bg-scale ~/path/to/image.jpg")   
                                                                               
;; Start emacs daemon                                                          
; (run-shell-command "emacs --daemon")                                         
                                                                               
;; Start pulseaudio                                                            
(stumpwm:run-shell-command "pulseaudio --start") 

;; Disable system bell                                                         
(stumpwm:run-shell-command "xset b off")                                       
                                                                               
;; Start gnome keyring                                                         
(stumpwm:run-shell-command "gnome-keyring-daemon --start --components=gpg,pkcs\
11,secrets,ssh")                                                               
                                                                               
;; Mode line                                                                   
(defvar *battery-status-command*                                               
  "acpi -b | awk -F '[ ,]' '{printf \"%s%s\", $3, $5}' | sed s/Discharging/\-/\
 | sed s/Unknown// | sed s/Full// | sed s/Charging/+/")                        
                                                                               
(setf *screen-mode-line-format*                                                
      (list "[^B%n^b] %W^>"                                                    
      '(:eval (run-shell-command *battery-status-command* t))                  
      " | %d"))                                                                
                                                                               
(setf *window-format* "%m%n%s%c")                                              
                                                                               
(setf *mode-line-timeout* 1)  

;; Turn on the new mode line.                                                  
                                                                               
(toggle-mode-line (current-screen)                                             
        (current-head))                                                        
                                                                               
;; Launch Terminal at Start                                                    
(stumpwm:run-shell-command "gnome-terminal")                                   
                                                                               
;; Define keys                                                                 
(define-key *root-map* (kbd "c") "exec gnome-terminal")                        

; Emacs is commented out because I prefer to use                               
; it in the terminal.                                                          
;(define-key *root-map* (kbd "e") "exec emacs")  

(define-key *root-map* (kbd "f") "exec firefox")                               
(define-key *root-map* (kbd "v") "exec eog") ; Eye of Gnome                    
(define-key *root-map* (kbd "t") "exec thunderbird")                           
(define-key *root-map* (kbd "k") "exec keepassxc")                             
(define-key *root-map* (kbd "g") "exec gimp")                                  
(define-key *root-map* (kbd "r") "exec rstudio")                               
                                                                               
;; Functions                                                                   
                                                                               
(defun browse-url (url-string)                                                 
  "Browse url using WEB-BROWSER"                                               
  (check-type url-string string)                                               
  (run-shell-command (concat WEB-BROWSER "\"" url-string "\"")))

;; For connecting to emacs see:
;; http://www.kaashif.co.uk/2015/06/28/hacking-stumpwm-with-common-lisp/index.html

Tech Veganism

“One place where the veganism metaphor breaks down is that, although nearly anyone can be a vegan, tech veganism is mostly practiced by those who are expert enough or privileged enough to learn the elaborate workarounds to avoid the GAFAMs of the world. Setting up an Ubuntu laptop, a LineageOS phone, a Fastmail account, and wiring it all together so that you actually get calendar notifications is no easy feat. You will probably have to get your hands dirty on the command line.

I find that there’s a bit of a ‘let them eat cake’ attitude among tech vegan boosters, because they often discount the sheer difficulty of all this stuff. (‘Let them use Linux’ could be a fitting refrain.) After all, they figured it out, so why can’t you? What, doesn’t everyone have a computer science degree and six years experience as a sysadmin?”

-Nolan Lawson, “Tech Veganism.” nolanlawson.com. May 31, 2019.

Reposting my comment here:

The point that a lot of people miss is that there are two tech revolutions going on.

On one end, there’s the application, end-user technology that is designed to fit some specific need and be easy to use. Ideally, it’s just tapping buttons on a screen.

These tend to follow direct physical analogs of specific, single purpose tools: Search/Keep replaces the file cabinet, Maps replaces maps, YouTube is mobile television, Play is mobile board games, News replaces the newspaper, Gmail is mail, Contacts replaces the Rolodex, Drive replaces the suitcase, calendar replaces the Day Planner, Translate replaces the foreign language phrase book, Photos replaces the photo album, etc.

They do one thing. They do it well. They are useful. And they are all being combined in one device. But, they aren’t the standard by which every tool needs to be judged.

Some tools are general tools that can be applied to a wide variety of problems. Any idiot can pick up an arc welder or write a Python script. But, it takes time to learn how to use these general purpose tools well. They’re never going to be easy in the way that using email is easy. And there is no need to use Python or an arc welder on your phone.

Should TeX be compared to Word? It’s apples and oranges. How much does that Venn diagram overlap, regardless of definition?

Emacs is as different from a word processor as a word processor is from the legal pad. There’s inherent capability that doesn’t reduce down to the level of a pull-down menu or button. As soon as you make ease of use the defining feature, you narrow down capability to what a pull down menu can handle.

Most people aren’t solving problems that require training A.I.s, collaboratively writing programs with a tool like Git, making CGI movies with Renderman, etc. So, they have no need to learn these tools, and these tools do not need to simplified to suit them. They are what they are. OpenBSD is about security, not being “user-friendly” to the novice user. If you want “user-friendly,” use what everyone else uses.

“Tech vegans,” as you describe them, have different needs and different values. Some day, it would be nice if a LineageOS device were available at your telephone carrier’s store, Google didn’t mess with ad blocking extensions in their browser to make more money, and so forth. But, the incentives are what they are. Opting out of the default is hard by design. That’s not only a technology problem. It’s also an economic one.

Webster’s Revised Unabridged Dictionary (1913) on StarDict on Ubuntu/Debian

So, after reading “You’re probably using the wrong dictionary,” I thought I would give installing Webster’s Revised Unabridged Dictionary (1913) on a Debian-flavor of Linux a try and write it up the process and some observations of its use.

Installation on a Debian-flavor of Linux is straight-forward:

$ sudo apt-get install stardict
$ cd Downloads
$ wget https://s3.amazonaws.com/jsomers/dictionary.zip
$ unzip dictionary.zip
$ cd dictionary
$ tar -xvjf stardict-dictd-web1913-2.4.2.tar.bz2
$ cd stardict-dictd-web1913-2.4.2/
$ sudo mv *.* /usr/share/stardict/dic/
$ stardict

This launches the main application. There is also a mini-window that can be moved to where you like and then you can use it with other applications by highlighting text. Here’s a screenshot of this article:

When you highlight a word, it will automatically be searched for and displayed in the mini-window.

Entries include pronunciation, etymological origin, related words, definition and an example of usage, often from literature. I can imagine this being a very useful tool. It might be worth checking if my writing from this date changes in an appreciable way and whether it is an improvement or not. I suspect it will be very useful.

Setting DNS Manually on Ubuntu Linux

Introduction: Domain name servers (DNS) provide the numerical addresses for sites on the Internet. When you type cafebedouin.org into your browser, your computer queries a DNS name server to get a numerical address. This numerical address is then used to contact the site.  Normally, configuring DNS is handled behind the scenes by Dynamic Host Configuration Protocol (DCHP) automatically.

For some situations, you’ll want to set a different DNS server than the one set by DCHP. Maybe your Internet Service Provider (ISP) uses their own DNS server that is slower than Google’s DNS server. Maybe you use a Virtual Private Network (VPN) and want to stop DNS leaks to your ISP.

In Linux and other UNIX-like operating systems in the past,  you would change configuration files, such as /etc/resolv.conf or /etc/dchp/dhclient.conf, to set DNS manually. 

The problem: Changing resolv.conf and dhclient.conf configuration files does not work in Ubuntu.

The solution: Starting with 17.10, Ubuntu uses netplan to set DNS. On my test machine, netplan’s configuration file looks like this:

version: 2
   renderer: NetworkManager

It is possible to manually do the job of DCHP in netplan, but it’s complicated. If your objective is to just change the DNS servers, there is an easier way to do it. Use Network Manager.

There are files in the directory /etc/NetworkManager/system-connections that define how DCHP should work for each network connection. To the files listed in that directory, add the following with DNS server IP addresses under [ipv4]:

dns-search=
method=auto
dns=84.200.69.80;84.200.70.40;45.33.97.5;
ignore-auto-dns=true

The DNS servers in this example are from FreeDNS and DNS Watch.

After adding the DNS IP addresses, separated by a semi-colon, then from the command line, do: sudo service network-manager restart

Once completed, you should be on your DNS server of choice. It’s a little inconvenient to have to add these lines to each network-connection file, and there might be a better way. But, this will work.

Freedom & Limits: The ASUS C201 with libreboot and Parabola Linux

Unfree BIOS Software

Surfing the web one day, I came across a mention of libreboot, a free software replacement for BIOS firmware used to load and run operating systems that’s been around since December 12, 2013. For many years, the only system you could buy with a free BIOS that could run free software was the Lemote Yeelong. Prior to that, every system ran nonfree BIOS system to initialize the computer prior to starting the operating system.

Unfree Software Everywhere

Unfree BIOS software is not a unique problem. Most elements of a computer are run using software that’s secret. For instance, none of the modems that are responsible for cell phone network communications run on free software. No one knows exactly what that software does, except, perhaps, the people that created it.

Same is true of wifi. There are also only two wifi chips with free software drivers. The rest require blobs. Blobs are black boxes. You can know what goes in. You can know what comes out. But, you’re not entirely sure what happens in the middle.

Controller firmware, CPU microcode, graphic acceleration and many other elements of a modern computer system are almost always proprietary. Unfree software is the norm.

Free Software: Who Cares?

If it is a norm, why should anyone care about free software? People in the free software world often talk about free as in beer, i.e., it does not cost anything, opposed to free as in freedom, which enables people to do things they otherwise wouldn’t be able to do.

One example is a car. All modern cars have a series of electronic systems that control every facet of the car’s operation. When those electronic control systems are proprietary, it can mean that owners of the car can be compelled to see an auto mechanic rather than repair the car themselves. Or worse, a manufacturer could decide to not share information with auto mechanics and establish a system where car owners would have to go to a dealer to get their car repaired.

Proprietary software puts the owner of the software’s copyright in control. Free software, at minimum, reliquishes the copyright and gives that control over to the user of the software or the hardware it powers. In some cases, it tries to exert control over the process, making it a requirement that improvements also have to be shared under the same conditions that the original software was shared.

Free software is fundamentally about empowering people. You might not care about the code running your car, but you likely do care if that code limits the supplier of repair services to a monopoly that charges significantly more than it would if it had competition.

Enter libreboot

Looking over the libreboot site, it is clear the BIOS problem persists. There are a handful of systems that can run libreboot. Most computer systems run a lot of proprietary software, e.g., BIOS, device drivers – such as wifi, controller firmware, CPU microcode, graphics acceleration hardware, etc. Under these conditions, is it even possible to run free software? If there is going to be compromises, what is an acceptable level? How much inconvenience will it entail?

Freedom always comes at a cost. In the modern world, the cost is often in convenience or capability. But, the reality is that we often have no idea what something costs us, as individuals or as a society. It’s not until we struggle with a different, perhaps even radical position, that the standard quo has a foil to make these costs visible.

I found such a foil while looking at the libreboot site and read this quote in the documentation for the only ARM laptop compatible with libreboot, the ASUS C201:

In practise, you can (if you do without the video/wifi blobs, and replace ChromeOS with a distribution that respects your freedom) be more free when using [an ASUS C201 than other libreboot systems that are Intel based].

What does “more free” mean? On the ASUS C201, the embedded controller firmware is free software, and there is no microcode. On ARM CPUs, the instruction set is implemented in circuitry, without microcode. If you choose not to use the wifi/video blobs, you can make the system about as free as is possible in the modern computing landscape.

Getting There From Here

It’s a bit of work to make the ASUS C201 run with free software. I bought one with faulty wifi from eBay for $52 dollars and a wifi dongle with a free Artheros chipset for $31 from Think Penguin. I then got the low end iFixit tool set to take apart the laptop for $25, removed the write protection screw, installed libreboot, installed Arch Linux on a SDCard I bought for $20 and then converted Arch Linux into Parabola by switching the depositories. For ~$130, there was a lot of educational value in the exercise, and the end result was a usable laptop that is my daily driver. Not bad. But before you go off and try it yourself, let me share some of the bad news.

All the instructions mentioned the possibility of making the computer unusable or damaging it while installing libreboot. In my case, I did manage to put a small crack in the top of the laptop in the course of prying it open. I ended up covering it with a sticker. Problem solved.

It is also possible to make a mistake flashing the firmware with libreboot and “bricking” the machine, which is always a possiblity when flashing firmware. It didn’t take the first time for me, but it didn’t seem to cause any problems either.

There are also other issues that can come up. For example, if you are not familiar with the command line and mounting usb or sdcards, you might not know that you need to use a set of commands like the following to transfer the libreboot files from a usb drive to the C201 in the first place, which the instructions assume you know how to do and don’t specify:

# cd /
# mkdir libreboot
# mount /dev/sdb1 /libreboot
# cp /libreboot/libreboot.img /

You can also make mistakes when installing the operating system, such as missing part of the long command to partition the table properly. Assuming you can get the whole thing to boot, then you have to set-up the Arch Linux distribution from scratch.

Arch Linux starts with a minimal distribution, and it is built around the idea of you create the distribution you want, with only the most up-to-date software. Prior to this experiment, I used primarily Debian. Arch Linux showed me was how many decisions Debian was making for me during the installation process. You could say that Debian is more focused on stability and ease of use.

July 2019, Update: After installing Arch, Parabola and Devuan on my ASUS C201 machine. I finally got the Debian-based distribution PrawnOS working from internal storage. At this point, this is the distribution I would recommend for this machine.

So, the initial process was reevaluating software. On Debian, Gnome is the default, but it will not run on an ASUS C201 because it doesn’t have the video acceleration required to run it well. I found myself trying a number of window managers and eventually settled on ratpoison, a tiled window manager, that would work well with the limitations that free software on the ASUS C201 required. Hot tip: “ctrl-t :” will bring a text box up in the corner, then you can type “quit”, without quotes to exit. It took me a bit to learn that detail.

The graphics limitations of the ASUS C201 tended to encourage the use of the command line, just as working with OpenBSD did. The command line is something every user of a UNIX derivative should know in some detail, including Macs.

Debian also does some of the basic set-up for you, such as creating users, installing base software like sudo, or getting wifi to work. Arch Linux largely doesn’t, although setting up wifi through wifi-menu was easy.

Then, there is switching your distribution from Arch, which allows some proprietary drivers, to Parabola, which doesn’t. This leads to additional issues, like an update of the machine made a fully-functional touchpad useless. Was it a software upgrade of X or a firmware upgrade to the touchpad driver? Probably the latter, but the end result is that I try to keep to the command line where using a mouse isn’t necessary.

Another thing cutting down on my use of graphics? Apparently, the icu package (International Components for Unicode) updates every 3 months, but it breaks iceweasel, the only free software graphical browser that will run javascript and render pages correctly. I’ve since learned how to downgrade packages from cached packages on the machine. However, in the process of learning, I cleared the cache. I ended up having to wait six weeks to get an unbroken graphic browser package. Part of the delay is because the dependencies in the browser are written for specific versions of icu, and so they break every time it is updated. Part is because the ARM architecture doesn’t get the same kind of support as other architectures, because the number of people using it is much smaller.

The Point

So, what’s the point of this long litany of issues with making an ASUS C201 a free software machine? I think the main value is the exercise of rejecting the default option and choosing for ourselves. That’s what free software offers. You may not want the freedom, but sometimes just making an effort in that direction helps us to evolve into people that appreciate options beyond those that are offered by default.

In this case, the default is to use ChromeOS. It provides a safe, relatively secure computing environment where people can browse the web, read email, use networked Google software applications and such, and the price for the machine is minimal. However, there is a price to be paid in freedom. Convenience is offered in exchange for agreeing to become the commerical product of Google. For some people, this doesn’t bother them. They might even view it as a benefit. Since Google knows so much about them, the advertising driven by Google might help them to make better purchasing decisions.

Trying to swim against the default stream, whether it is the defaults of Google or a particular Linux distribution such as Debian, means a lot of work. It also means inconvenience, where hardware doesnt work like it should or graphical browsers remain broken for months. But, I would argue that taking the risk of bringing your computer, accepting a restraint like “free software only”, having to try new alternatives, etc., all leads to a mindset worth cultivating.

Even if you think concerns about free software is a kind of zealotry, there are kinds of knowledge that only a zealot can know because they are willing to accept limits others will not. There’s an education to be obtained in doing it. The only question is whether it is worth it to you.

Tarsnap – Online Backups for the Truly Paranoid

“Tarsnap is a secure, efficient online backup service:

  • Encryption: your data can only be accessed with your personal keys.

We can’t access your data even if we wanted to!

  • Source code: the client code is available.

You don’t need to trust us; you can check the encryption yourself!

  • Deduplication: only the unique data between your current files and encrypted archives is uploaded.

This reduces the bandwidth and storage required, saving you money!

Tarsnap runs on UNIX-like operating systems (BSD, Linux, MacOS X, Cygwin, etc).”

https://www.tarsnap.com/

Swimming Against the Stream of Convenience

A year ago, I deleted my Facebook account. It was a bit of a watershed moment for my digital life because it was the start of a process, where I took a hard look at my use of the “free” services offered by Facebook, Google, Microsoft, Amazon and Apple and tried to assess whether other alternatives, particularly paid ones, were better based on factoring in other considerations than cost.

Facebook was the obvious starting point. On the plus side, it helped me to keep in touch with my extended family, a few groups I liked to participate in use the platform, and the calendar of events integration into Google calendar made it very easy to plan and take advantage of all the events my city has to offer.

On the negative side, those benefits came with a cost to my well-being and to society at large. During the U.S. election, it gave me a window into the thought-processes of people in my extended social circle, and I found I started liking them a lot less. It was obvious to me that people were being manipulated, less obvious to me is that I was one of those people. Reading “The Data That Turned The World Upside Down,” I had a realization that Facebook was manipulating everyone’s thoughts and interactions that used it, and by continuing to use it, I was essentially saying it was alright. It wasn’t.

But, once your mind goes down that route, then you can’t stop. You have to look at everything. Google has more than double the advertising revenue of Facebook. Yet, I used Google for almost everything, such as email, photo storage, contacts, etc. And, the influence they have, such as the companies that surface when using search, maps, or their other products is profound, but the algorithm is even more opaque than Facebook’s. You really have no idea what kind of influence Google is having over your choices, and it is impossible to have any transparency about what is going on behind the scenes and the intent behind it. Again, using Google means you agree the convenience is worth being manipulated. For me, it wasn’t worth it.

I changed my search engine to DuckDuckGo. I switched off of Gmail to one email provider then another. I switched off Google Drive to NextCloud, a free software cloud storage solution. With Nextcloud, I was able to migrate documents, pictures, contacts and notes off of Google’s servers. Some services, such as managing RSS feeds, were also part of NextCloud, which Google chose to no longer support when they retired Google Reader.

And once you go this far, it’s a short step to look at things like Wallabag to replace Feedly. Or eliminating other social media applications that are affiliated with feudal Internet companies, such as Instagram, Whatsapp, Hangouts, etc.

Once there, I was able to take bigger steps, such as installing LineageOS onto my android phone and Linux on the desktop to replace Microsoft Windows. Or using free alternatives to apps, such as those in F-Droid over those in Google Play or LibreOffice instead of the Microsoft Office suite. These moves were organic extensions of the thought processes quitting Facebook began.

Still, some things have no ready replacements. If you don’t use Google Maps, what are the alternatives? Those that exist are objectively nowhere near as good.

Choosing to not use Amazon is possible, but it comes with significant inconvenience, trade-offs and costs. Is it better to go to Wal-Mart rather than order from Amazon? What about paying 20% more by shopping elsewhere? Consider that over half of U.S. households have a subscription to Amazon Prime. Shipping costs alone make shopping for some products online prohibitive.

For Amazon, I’ve stopped buying ebooks from them. There is a lot of reading material to choose from in this world. I try to stick to DRM free books, but failing that, I try to use services that are not Amazon and available via the library, such as OverDrive. While OverDrive is not as good from a reading experience perspective, it does have the advantage of not being part of the feudal Internet.

The only Apple product I have ever used is iTunes and iPod related devices. I find other programs integrating my music collection to be easier to use. So, my exposure to Apple is negligible.

Being against the feudal Internet is swimming against the stream of convenience. It means more cost, more aggravation, and more of your time troubleshooting problems that would “just work” if you let Google, Apple or Microsoft manage everything for you.

Looking back after a year, choosing the path less travelled by has indeed made all the difference. Not everyone can do it — due to financial, time, or other constraints — but it is worth doing, if you can.