🏠 About Now Archive Tags RSS

Posts tagged "gnulinux":

Fix error with Cider Clojure REPL in Emacs on Guix

I am currently reading Clojure for the brave and true by Daniel Higginbotham and in Chapter 2 about how to use Emacs for Clojure, there are instructions on how to set up Emacs with Cider, a Clojure REPL. I tried installing the package with a use-package configuration with :ensure t and I got the package. However, when I tried using it as the book instructed, I just got an error. I then realised the need for OpenJDK and Clojure and installed those with my home-config.scm file in Guix. I tried again and I still got the same error. I then tried installing emacs-cider from Guix as well with the hope that maybe there was some kind of incompatibility between OpenJDK, Clojure and Cider that was ironed out in the guix package. It still did not work.

I tried looking up the error and found a blog post that suggested installing OpenJDK non-Guixily by downloading a binary and adding it to the $PATH which solved the problem for that user. I did not really want this, since I really like the idea of installing my whole system with a scheme file or two in a reproducible way. (I'm not there yet, but I hope to get there over time. I just started using Guix as my main distro a few weeks ago. For now, after installing Guix System or Guix on another distro, I do some manual work and then run a Shell script to set up a few folders and run the command that applies my home-config.)

Tonight, a day later, I DuckDuckWent again and found another blog post about Clojure that told me that since there are three outputs for the openjdk package, to get everything I would need for Clojure, I should install openjdk:jdk, not simply openjdk which would give me openjdk:out. In addition, I also added openjdk:doc since I am a fan of having as much documentation as possible available on my local machine. I saw a video where that documentation was read from inside Cider a couple of days ago, so I thought it might come in handy. Come to think of it, maybe that was accessed over the internet, not from the local machine. Anyway, it doesn't hurt to have some documentation.

And now, everything just works. Turns out the problem was just user error. Whenever there are multiple outputs of a package in Guix, it is important to know what you get with each output and choose accordingly. As someone who just recently switched my main machine to Guix, this is very useful information that I had not seen before. I thought I would write this up in a blog post so people out there trying to fix the same problem have a chance of finding a solution faster than I did, and for my own future reference.

Adventures in Guix

I have been interested in the Guix functional package manager and GNU distribution for a long time. It has some brilliant features like being able to roll-back to a previous generation of your system if an update fails, easy spinning up of development containers where you can functionally and reproducibly install the dependencies you need for your project and you can configure your whole system with Guile Scheme (a dialect of Lisp). I have tried Guix from time to time with varying results. Since I have been busy the last few years learning technologies I need at work, haven't had the time to learn Guix as well until now. However, I have found some time and energy lately to play with Guix and when I did, things seemed to work a lot better than my previous attempts. Spending the time to read up on the documentation helped, in addition to the many contributions by the Guix community to improve the distro / package manager since my previous attempts.

I have just started to use Guix on my main machine. As with anything new and different, there has been some hiccups along the way. For example, hunspell-nb which is the spell checker I use for Norwegian BokmÄl isn't packaged for Guix. However, aspell-nb is and the only reason I switched from aspell to hunspell was that I also use Emacs on Windows at work (native Windows Emacs since WSLg doesn't work properly and I need GUI Emacs) and native aspell-nb is hard to get on Windows, but Hunspell-nb can be used if you install LibreOffice and copy some files after installing hunspell from chocolatey (where of course hunspell-nb is not packaged either). I prefer not having if-statements in my Emacs config if I can avoid it, so I switched to hunspell on GNU/Linux as well, but since it is not pacakged in Guix, I reverted the config back to when I used aspell on GNU/Linux and Hunspell on Windows.

However, that did not work. At every startup, Emacs complained that it could not read the nb dictionary from the address to the aspell-package in my current home-config. I tried everything, but it just didn't work. I then tried M-x ispell-change-dictionary and hit tab to have a look at the suggested dictionaries. Turns out that aspell-nb on Guix supplies a dictionary it calls no, unlike on every other distro, where it is called nb. This makes absolutely no sense since there are two Norwegian written languages, Norwegian BokmÄl (nb) and Norwegian Nynorsk (nn), but no written language called just Norwegian (no). Packages that supply both tend to be called no, like hunspell-no which supplies nb_NO and nn_NO. It is easy to change my config to use the no dictionary and my emo-ispell-toggle function to toggle between no and british on GNU/Linux. I had a look at the package definition for aspell-nb, but it seemed to just supply the upstream package as far as I could tell as a very inexperienced Guix-user.

Another strange thing is that mpc mode in Emacs does not want to speak with mpd. It also took me a while to understand that mpd was packaged for Guix since I looked for mpd, but the package is called mpd-mpc in Guix. The strange thing is that my own emo-play-album function in Emacs that uses mpc shell commands work fine from the same Emacs that give me an error that it could not communicate with mpd when I try to show the songs in an album in mpc mode. I use the same mpd config file as on other distros where it does work. I tried changing some settings in the config file to see if I was able to fix it, but no luck thus far.

I also miss the frogr package for easy uploading of photos and adding of metadata to Flickr. When I get a bit more experienced, maybe I can contribute a package definition for it?

Another thing I have noticed is that Guix calls my locale in the LANG environment variable nb_NO.utf8, not nb_NO.UTF-8 like every other distro. I wonder if this might break localisation in programs that use the environment variable $LANG to choose which localisation to use, but I don't really know how this works so this might not be a problem at all. It seems strange and random, but maybe there are good reasons for it that I don't know.

Except for these new user problems, the experience is nice. After some tweaking and trial and error, I now have a very simple and basic system config that just installs the absolute minimum I need to have at the system level, and then I use Guix home to deploy my user packages and services. I have some Bash scripts in my installscripts repository as well as my Scheme config files that I can use to set up a system, either on Guix or on a "foreign distro" after an install with just basic system tools. Ideally, I would do that with Scheme in the system config, but I don't know Guix and Scheme well enough to do that yet. I'll get there over time. Using Guix as a package manager on top of another distro can be useful if I need to use Secureboot which Guix does not support, for example for a dual boot with Windows 11 which demands Secureboot. I really like that Guix adheres to the Free Software Foundation's Free System Distribution Guidelines, but when used on hardware I have not chosen myself, it can be useful to have another distro underneath that supplies non-free drivers for that hardware as well as support for Secureboot. I am slowly climbing up the freedom ladder in my personal computing and at every step, there is less lock-in, privacy invasion and enshittification, and more freedom and empowerment.

Boot RaspberryPi OS on an NVME larger than 2TB

RaspberryPi OS boots from an EFI partition. On other hardware, an EFI partition is used with UEFI which demands that your disk is GPT-partitioned or a hybrid GPT with MBR. However, the RaspberryPi imager and the installer you get when pressing Shift at boot uses MBR. MBR is a way to partition a disk that we used in the 1980s and that made sense back then, but it has the unfortunate limitation that it cannot use disks larger than 2 TB. So when I bought my 4 TB NVME to use with my Raspberry Pi 5, I was unpleasantly surprised that after installing RaspberryPi OS light, I could only see a 2 TB disk.

There are various solutions floating around the internet to get around this problem, but most of them are unnecessarily complex. The RaspberryPi 5 can boot from a disk partitioned with a GPT partition table just fine. The problem is just to get the right partitions with the right data onto the disk since the installer insists on using 1980s technology which means that you cannot use it on large disks. In the early 80s, a large hard drive had 40 MB capacity, so 2TB seemed like science fiction. Who would need all that space when Macintosh System Software, a few programs like MacWrite and MacDraw and a dozen files could fit on a 800kB diskette? (The Double Density 3.5 inch floppy disks that gave 720kB space on MS-DOS delivered 800kB on a Mac.)

In addition to your NVME, you will also need a USB stick and an SD card. If you use a case like my Argon Neo, installing the NVME and SD-card demands a bit of disassembly. The reason we need two other devices is that we need to clone one of them to the NVME and to do that we need to boot from the other. Here is what you need to do to your NVME working:

  1. Insert the SD-card and the NVME in your case or hat or whatever you use and insert an ethernet cable connected to your router.
  2. Boot your RaspberryPi while repeatedly pressing down the shift key until you get to the Raspberry Pi screen that downloads the installer.
  3. Install RaspberryPi OS (light) on the SD card.
  4. Boot from the SD card. If the boot order is set to boot from NVME first, you may have to press Space when booting to get to the boot order screen first. Since RaspberryPi OS reboots once as part of the isntallation, you may have to go through the boot order screen twice, so be ready to press space again after the first boot. After the second boot, the SD card has got RaspberryPi OS and the root partition (/) has been expanded.
  5. Insert your USB stick into one of the blue USB3 ports.
  6. Boot your Raspberry Pi again and repeatedly press down shift until you get to the screen that downloads the installer.
  7. Install RaspberryPi OS on your USB-stick.
  8. When the Pi reboots, press space repeatedly to get to the boot order screen and select USB and boot.
  9. Be ready to press space repeatedly again since the Pi reboots once as part of the installation process and choose USB again to boot the USB stick and let it expand the root partition.
  10. When you have booted into the USB stick for the second time after the root partition has been expanded, open a terminal (or use the TTY if you used RPi light).
  11. Write sudo fdisk /dev/nvme0n1 to partition the NVME with fdisk.
  12. Press g to make a new GPT partition table. You may have to confirm that you want to remove an MS-DOS (MBR) partition table already there.
  13. Press n to make a new partition.
  14. Choose the default as the first sector by pressing return.
  15. Write +512M to make the size of the partition half a Gigabyte.
  16. Press t to change a partition.
  17. Choose the default 1 as the partition you want to change.
  18. Set its type to 1 (EFI System).
  19. Make a new partition with n.
  20. Accept the defaults since it will use the rest of the disk.
  21. Press w to write your changes to the disk.
  22. Write dd if=/dev/mmcblk0p1 of=/dev/nvme0n1p1 && sync and press return. This will clone the first partition, the EFI partiont, of the SD card onto the first partition of the NVME.
  23. Write dd if=/dev/mmcblk0p2 of=/dev/nvme0n1p2 && sync and press return. This will clone the second partition, the root partition, of the SD card onto the second partition of the NVME.
  24. Write sudo mount /dev/nvme0n1p1 /mnt to mount the EFI partition of the NVME to /mnt on your running system (from the USB stick).
  25. Write lsblk -f to get the UUID of the root partition of the NVME (/dev/nvme0n1p2).
  26. Open the file /mnt/cmdline.txt with sudo in a text editor. (I prefer to combine step 25 up to and including 33 since Emacs has a built in terminal multiplexer and tiling window manager, and it is easier to copy the UUID from one window in Emacs to another window than to try to remember a UUID from lsblk -f from before I opened Emacs. I also use tramp inside Emacs to open the files with sudo instead of opening emacs with sudo. If you use another text editor in a TTY, then you probably have to write the UUID down after running lsblk -f since your text editor will hide the output from that command when you launch it to edit the file, unless you use GNU screen or tmux.)
  27. Change where it says root=PARTUUID=somenumber to root=UUID= and write or paste the UUID from lsblk -f for /dev/nvme0n1p2.
  28. Save the file and exit the text editor if you use a TTY editor without a built in terminal multiplexer.
  29. Write sudo umount /mnt and press return to unmount the first partition.
  30. Write sudo mount /dev/nvme0n1p2 /mnt to mount the root partition from the NVME to /mnt on your running system (the USB stick). If it tells you the disk is busy, wait for it. It means that the disk is still writing even if it has tld the OS it has finished. If you fail to wait, then you cannot boot.
  31. Write lsblk -f again and note down the UUID of both /dev/nvme0n1p1 (the EFI partition) and /dev/nvme0n1p2 if you did not already note it down. (Or use a terminal multiplexer or Emacs to copy it over when you need it.)
  32. Open the file /mnt/etc/fstab in a text editor with sudo.
  33. Replace the part of the line that says PARTUUID=somenumber on the line where it says /boot/firmware with UUID= and write or paste the UUID number for /dev/nvme0n1p1 (the EFI partition).
  34. Do the same with line where it says /, but use the UUID for /dev/nvme0n1p2 (the root partition).
  35. Save the file and exit your text editor.
  36. Wait for a while to allow time for the nvme to write out the change. Turn off the RaspberryPi.
  37. Remove the SD card and the USB stick.
  38. Reboot the Raspberry Pi. It should now boot from the NVME. If the boot order is set to boot USB or SD Card first, you may have to press space when booting to boot from the NVME. In such a case, you should write sudo raspi-config in a terminal and go to Advanced Options, choose A4 Boot order, and choose B2 NVME/USB Boot … and then press OK and finish and reboot. It should now boot from the NVME. If something went wrong and you end up in an emergency shell, then reboot, insert the USB and SD card again, press space and try again.

I now have a 4TB NVME that boots my RaspberryPi 5. I also tried booting from SD card and using the NVME only as storage for a while, but it was slow and annoying, so it is really worth spending some time to get the Pi booting from the NVME. Hopefully, the RaspberryPi devs will change the imager and installer so they use the GPT partition scheme in the future. There is no reason to use MBR in the 21st century.

Rethink about the prefix for my Emacs keymap

I wrote a blog post about binding <menu> as the prefix key to my own Emacs keymap and swapping CapsLock for Menu on GNU/Linux and its closest equivalent, <apps> on Windows. (I have deleted that blog post since I realised doing that was dumb, and I don't want to steer others down that path.) It worked as long as I used Emacs in its GUI on Windows 11 or Wayland. However, when I installed Guix on my laptop and was trying to figure out how to get Sway running on Guix, I naturally used Emacs in the TTY where it works just as well as in a graphical session except some limitations around showing pictures, using multiple faces and keybindings. TTYs and graphical terminals doesn't send through every key to Emacs and one of the many newer keys they don't send to Emacs is <menu>. So I was left with none of my own keybindings. It made me realise that using any special key not usable in a TTY for my own keymap is not very smart.

There is always M-x, so I could do everything I wanted to do, but without using my own keymap. The advantage of having a keymap that works everywhere is that it makes using commonly used functions a lot faster than using M-x. If the keymap isn't available everywhere, the advantage of having a keymap at all is severely limited and you have to think about in which situations it is usable and in which it isn't. Training oneself to remember the keychords through muscle memory also make little sense if it is only available some of the time.

I had a quick think about which possible prefix keys I could use that would work everywhere and in theory, every combo with ctrl or meta is usable except a few that has special meaning in a terminal like C-i and C-m. However, it is important not to remove a keychord I already use a lot for its original functionality to use it as the prefix for my own keymap instead, and I don't want a situation where a keychord both has its own functionality that I sometimes use and also is the prefix key for my keymap. That would be confusing and annoying to work with. I don't use C-z to iconify GUI Emacs or stop TTY Emacs, so I thought it was a keychord I could unbind and then use as my prefix.

Below is the code from my Emacs config for my keymap. It has just a few functions I use often that doesn't have a keybinding by default and a few of my own functions. Using it makes me faster than using M-x.

(global-unset-key (kbd "C-z"))
(define-prefix-command 'emo-map)
(global-set-key (kbd "C-z") 'emo-map)
(define-key emo-map (kbd "a") 'tempo-complete-tag)
(define-key emo-map (kbd "b") 'tempo-backward-mark)
(define-key emo-map (kbd "c") 'org-insert-structure-template)
(define-key emo-map (kbd "d") 'org-display-inline-images)
(define-key emo-map (kbd "e") 'elfeed)
(define-key emo-map (kbd "C-e") 'eshell)
(define-key emo-map (kbd "f") 'tempo-forward-mark)
(define-key emo-map (kbd "h") 'emo-hjemmeside)
(define-key emo-map (kbd "i") 'emo-ispell-toggle)
(define-key emo-map (kbd "l") 'org-toggle-link-display)
(define-key emo-map (kbd "m") 'mu4e)
(define-key emo-map (kbd "o") 'emo-dired-convert-to-org)
(define-key emo-map (kbd "C-s") '(lambda () (interactive) (emo-present 'toggle)))
(define-key emo-map (kbd "s") 'shell)
(define-key emo-map (kbd "t") '(lambda () (interactive) (ansi-term "bash")))
(define-key emo-map (kbd "y") 'emo-systemcrafters)

Man pages are not the real manuals on GNU/Linux

Youtubers like Luke Smith and DistroTube have said for years that the man pages are the manuals for command line programs on GNU/Linux. That is not true. On the BSDs and other Unixes, it is true that your best manual is the man page, but on GNU/Linux distros, man pages are just short summaries of the manual to remind you how to use them while the real manual can be read with the GNU Info reader by writing info and the name of the program. All GNU programs and many others have info manuals that gets installed with the program by your package manager.

If you read the man pages for GNU programs, you will be underwhelmed if you want to read an actual manual, but if you read the info manual, you will find that most GNU programs are very well documented. I didn't know about info manuals before I started using GNU Emacs a couple of years ago, and I suspect many other newer GNU/Linux users don't know about the info manuals, so I thought it was a good idea to write about it. Maybe someone will discover the real manuals by reading this?

It is a good idea to start with "info info" to read the manual for the info reader to learn how to use it. On some distros, you have to install the info package before using it just like you have to install man-db to read man pages. If you use GNU Emacs, there is a better info reader with a nicer GUI built into Emacs which is used to read the Emacs manual, the Emacs Lisp reference, the Emacs Lisp introduction, manuals for all Emacs packages that supply one (which are most of them whether they are built-in or come in a package repository) and the info manual for every program on the GNU/Linux distro that supply one. There is a lot of good information in the manuals if know how to read them.

Convert any file pandoc can read to org

I got an idea from an EmacsElements video by Raoul Comninos where he converts docx and odt files he finds with dired to org format with two separate functions. Doc-view mode is nice for viewing files from MS365 and LibreOffice and other programs that use Open Document Format with the help of unoconv (which comes with LibreOffice), but you cannot edit the files. So he made these two functions to convert it to Org markup which Emacs edits well in Org mode. After editing, he can export a .docx or .odt through ox-pandoc to send back to the people that sent him the original file.

I have experienced the same need at work where most documents coming from others are .docx even if all my own documents are pure text files. I thought that I could convert any file format to org by using its extension as the from format for pandoc instead of having separate functions for different file formats. It seems to work. My function will either convert the file if pandoc can use it as input or give an error. I bound the function to C-z o to make it easy to convert and open a file from dired.

(defun emo-dired-convert-to-org ()
  "Converts files pandoc can convert to org files for easy editing. Use in dired."
  (interactive)
  (let ((endelse (file-name-extension (dired-get-file-for-visit)))
        (filnavn (dired-get-file-for-visit))
        (buffernavn (concat (file-name-nondirectory (dired-get-file-for-visit)) ".org")))
     (with-output-to-temp-buffer buffernavn
       (princ (shell-command-to-string (concat "pandoc -f " endelse " -t org --wrap=none \"" filnavn "\""))))
     (switch-to-buffer-other-window buffernavn)))

Why I replace Bash scripts with Elisp functions

Lately, I have spent some time replacing my Bash scripts with Emacs Lisp functions inside my Emacs configuration. I like programming and I haven't really gotten deeper into Elisp, so one reason was just to learn more Elisp and have some fun. Another reason is that replacing the Bash Shell scripts with Elisp functions removes the need to clone down an extra repository when I install a new system to get things up and running. It simplifies my installscripts a little.

Another advantage of having useful functionality inside my Emacs config is that whatever window manager or maybe even operating system I use, I can still use my functions from inside Emacs. Bash Shell scripts only run on GNU/Linux and POSIX Shell scripts only run on POSIX systems. But Emacs functions can be run inside Emacs on every platform it is available for without any external configuration. I might have to change my settings for wallpaper-command and wallpaper-command-args if I use another window manger, desktop environment or operating system, but most things will just work no matter where I am. Having the functionality in Emacs makes it easier if I ever were to change window manager from Sway as well.

The scripts I was able to replace with Emacs functions this weekend was my radio stream script, my two tv scripts for watching the latest news or satire broadcast from NRK, and my two wallpaper setting scripts, one that goes to the next file in a folder and sets it as the wallpaper so I can cycle through (and also around again when I get to the end) and another one that picks a random wallpaper from within the same folder. During the weekdays I was able to make a script to update my homepage and copy a youtube RSS feed link from a yewtu.be URL in primary selection. It was a lot of fun to dive into Elisp even if it took a lot of time since I was constantly searching for functions I could use for my purposes, both within Emacs and online.

I can still launch my scripts with keyboard shortcuts from my Sway config with emacsclient -e '(functionname)'. I start an Emacs server when I launch Sway, so I can always rely on having Emacs running. For the scripts that need user interaction in an Emacs frame, I can add -r to either reuse an open frame or make a new one.

Insecure sudo settings in RaspberryPi OS

I have a RaspberryPi 5. Since Debian does not supply an image for use with the RPi5 and Ubuntu Server comes with a lot of software I do not want preinstalled, I use RaspberryPi OS Lite and run my own script to set it up with Sway and the other packages I like. It is very similar to Debian even if it adds an extra repo, some settings that are different and a few programs for changing settings, both directly related to the hardware and some that replicate standard tools like localectl, passwd, systemctl enable etc in a more convenient TUI.

For a while, I have wondered why I only needed to write my password once when using sudo and then never again. It means that if you are logged in as your user, you have all the privileges of root if you just once wrote your password. It is convenient, but it is like logging in with the root user which is not a very good idea.

I had a look at visudo, the command to change the settings for sudo and everything looked quite normal. Except that in the end, the file sources any file in the directory /etc/sudoers.d/. So naturally, I had a look in that directory. There are some files there that cause problems. The first one is 010_pi-nopasswd which sets up sudo to never time out the sudo password typed by the first user created on the system.

Another is that sudo isn't per shell, terminal or tty, but global. This is in the file /etc/sudoers.d/010_global_tty. Usually, you would have to type your password to get sudo privileges in each terminal, shell or tty, but on RaspberryPi OS, sudo accepts the password I typed once in tty1 in every shell, terminal or tty.

Finally, there is a file called 010_proxy which accepts sudo from any proxy logged in as the first user, ie since I typed a password once in tty1, any proxy logged in as me doesn't have to type a password ever again to escalate privileges with sudo. Not the best setting either.

To mitigate the problem, you should make sure you are added to the sudo group by typing sudo usermod -aG sudo username in a terminal and press return, but replace username with your actual username. This is because we are going to delete the file that lets your users type your sudo password only once, but still want your user to be able to use sudo. The sudoers file on RaspberryPi OS is set up so users in the sudo group can use sudo.

Then you should write sudo rm /etc/sudoers.d/010_pi-nopasswd and return to delete the file that gives your user the ability to only type your password once. Continue with sudo rm /etc/sudoers.d/010_global-tty and return to remove the settings that doesn't ask for a new password in every tty, terminal or shell. Go on with sudo rm /etc/sudoers.d/010_proxy and return to avoid proxies not having to write a password. Finally, write sudo visudo and look for a line that says Defaults env_reset. Move your cursor to the end of that line with the cursor keys and hit return to get a new line. Write Defaults timestamp_timeout=5 to get a five minute timeout for sudo. Then press ctrl-o, return when it asks for a filename to save to and then ctrl-x to quit Nano. (RaspberryPi OS does not respect your settings for $EDITOR and will use Nano.)

My installscript for Debian checks if I am on RaspberryPi OS and does the things I have listed above, except add the timeout in the sudoers file. It is supposed to be edited only with visudo, so I tell the user to do this manually in the end of my script. (It also checks if the user is on Debian or RaspberryPi OS and installs Firefox on RaspberryPi OS and Firefox-ESR (Extended Support Releas) on Debian. (I tried installing Firefox from Debian Unstable first, but there were dpendency problems with that approach.) Emacs is installed from Backports to get then newest one backported to work with Debian Stable, whether you are on RaspberryPi OS or Debian. In the past, I used the Emacs snap, but Emacs from backports is faster and I trust the Debian maintainers more than the proprietary Snap Store. Since Debian has a stricter interpretation of what Free Software is than the FSF, I also have to install the non-free repos to install Emacs documentation.)

DOSbox and SDL error on Wayland

I tried installing DOSbox tonight to run some old games from the 90s. On first run, I got Exit to error: Can't init SDL No available video device as output in my shell (Shell mode in Emacs). I looked up the SDL packages I had installed and seemed to have everything needed. After an extensive search that did not really give me any solution, I tried something someone in a forum had tried, but in a slightly different way than they did and it worked.

I echoed out $SDL_VIDEODRIVER and got wayland as my answer since I run the tiling window manager Sway. I checked to make certain I had xwayland installed and then tried launching DOSbox again with SDL_VIDEODRIVER=X11 dosbox in a terminal and it worked. It will probably work for other programs that use SDL that won't launch on Wayland as well.

My search for solutions found a lot of users of different programs that used SDL that had trouble with getting their programs to run and with no credible solution given in any of the forums I visited. I hope this blog post will help people in that situation. Since most of the major desktop environments use Wayland by default now and some of us tiling WM users also use it, these kinds of problems should hopefully be eliminated by developers of most FOSS projects in the not too distant future. X11 has not been under active development since 2012 except for security updates, and Wayland is no longer the future, but has been the present for a long time.

Setting the background wallpaper for Sway and managing music with Emacs

I just watched an old video by Luke Smith which gave me the idea that it would be cool to change background in Sway from Emacs. I thought I would use dired and either open an image to see how it looks directly or use image-dired to get a preview of all the images in a folder. I would probably have to make a shell script to do the work and launch it with async-shell-command from an elisp function. It turns out I don't have to do anything. The functionality is already built into Emacs and it even gets which window manager or desktop environment is in use and selects the correct command to change the background for that WM or DE. The documentation tells me this functionality came with Emacs 29.1, at the same time a lot of other improvements were made to image-dired and opening images in general. I used image-dired in 28.2 and the improvements with 29.1 were many and greatly appreciated!

Moon_blue.jpg

A few months ago I did the same type of discovery. I was looking for a way to interact with mpd, the music player daemon, possibly through the command line tool mpc from within Emacs. EMMS and Bongo are often mentioned by people in the Emacs community and I have tried both, but they are both unable to list albums with many artists and/or many recording years as one album. All other mpd players I have tried, both TUI and GUI-based have the same problem, so this is not a unique shortcoming in these packages. Until recently, I have relied on a shell script I wrote that lists all the albums in the mpd database with fzf and lets me select the one I want to play. However, sometimes I don't want to play a whole album, but I still want my music sorted by album since I have been carefully tagging my files so I can easily find music by album.

(I kind of had to make a system for album names since having 11 albums named "Bach cello suites" doesn't really help me find the one I like to listen to when I have six different recordings, they usually span two albums and two recordings are by the same artist at different times. Hence, I have made a system that is fine grained enough for me to find the right album without being too detailed to avoid too long album names. For instance, I don't include first name initials of the composer in the album name when I only have one composer with that last name in my database (even if more exist), and I don't list artist in the album name when I have only one recording of a work. Every time I ripped an album, I manually changed the tags to match my system even if MusicBraniz through Rhythmbox and earlier, iTunes, often gave me terrible album names for classical albums when I ripped them, otherwise I would not be able to find anything.)

A few months ago, I discovered a built-in mpc mode in Emacs that gave me exactly what I wanted. I could continue to use mpd and mpc to manage my music playback and use mpc mode which looks very much like Rhythmbox, but has the advantage of having all of Emacs' superior keyboard centricity and text handling. I can easily search with C-s for an album name, add it to the playlist and start playing it and then q to quit out of that mode with the music still playing and I am back at whatever I was doing in Emacs before, all without having to lift my hands from the keyboard. It is really convenient. In mpc mode, the albums are correctly listed even when there are many artist and/or years on the same album. Since I can sort my music by album, I can easily also find a single track if I am so inclined.

These kinds of discoveries make me love Emacs and the Emacs community. Emacs is hackable enough that if you want some functionality, you can get it. And since the project wasn't started yesterday, someone has often already thought of my use-cases and spent some of their spare time to code up that functionality and often also even gone to the trouble to include it in the editor itself. Thank you!

Rapid Photo Downloader Error on Wayland on Arch

If you try to run rapid-photo-downloader on Arch on Wayland, you get this error message:

qt.qpa.plugin: Could not find the Qt platform plugin "wayland-egl" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Fatal Python error: Aborted

Current thread 0x00007fa0cd669740 (most recent call first): File "/usr/lib/python3.11/site-packages/raphodo/ui/viewutils.py", line 975 in any_screen_scaled_qt File "/usr/lib/python3.11/site-packages/raphodo/ui/viewutils.py", line 991 in any_screen_scaled File "/usr/lib/python3.11/site-packages/raphodo/rapid.py", line 7489 in main File "/usr/bin/rapid-photo-downloader", line 33 in <module>

Extension modules: PyQt5.QtCore, gi._gi, zmq.backend.cython.context, zmq.backend.cython.message, zmq.backend.cython.socket, zmq.backend.cython._device, zmq.backend.cython._poll, zmq.backend.cython._proxy_steerable, zmq.backend.cython._version, zmq.backend.cython.error, zmq.backend.cython.utils, psutil._psutil_linux, psutil._psutil_posix, gphoto2._widget, gphoto2._version, gphoto2._result, gphoto2._port_log, gphoto2._port_info_list, gphoto2._list, gphoto2._filesys, gphoto2._file, gphoto2._context, gphoto2._camera, gphoto2._abilities_list, PyQt5.QtGui, PyQt5.QtWidgets, PyQt5.QtNetwork, tornado.speedups, PyQt5.QtXml, PyQt5.QtX11Extras, PyQt5.QtWebChannel, PyQt5.QtTest, PyQt5.QtSvg, PyQt5.QtSql, PyQt5.QtQml, PyQt5.QtQuick, PyQt5.QtQuickWidgets, PyQt5.QtPrintSupport, PyQt5.QtPositioning, PyQt5.QtLocation, PyQt5.QtOpenGL, PyQt5.QtDBus (total: 42) Avbrutt (SIGABRT) (kjerne lagret i fil)

Reinstalling the program does nothing. It turns out that there is a missing dependency. I have spent a lot of time trying to figure this out, but finding the information is hard, so I thought I would help my future self and maybe some others by supplying the fix I have found. It is not, as many suggest online, enough to install Python-PyQt5. It is already a dependency and installed. You need to install qt5-wayland to get it to work. On some distros, you also need to install egl-wayland, while on others, it comes as a dependency of qt5-wayland.

This is not just a problem with rapid-photo-downloader. There is a lot of discussion online about this error message with other Qt5 and Qt6 packages from different distros like Debian, Ubuntu and Arch. qt5-wayland is a dependency only if you run Wayland, so maybe that is why it does not come with the package as a dependency even if I think it should. Now that the larger desktop environments are all Wayland by default, I would guess X11 users are the minority of GNU/Linux users. Therefore, Wayland dependencies should come with all packages that need them. Legacy X11 users would probably not worry too much if a small extra package they do not need is installed. If they really worried about bloat, they would not have used X11 in the first place since it is a baroque collection of legacy cruft.

Update August 6th, 2023: I have experienced the same issue with Kdenlive on GNU Guix as well. It turns out that both Qt5-wayland (qtwayland@5.15.8 on Guix) and egl-wayland are missing dependencies for Kdenlive for Wayland users.

Maximize screen real estate

Real estate is expensive. Bad room layout can make a large flat seem small. A space with too much furniture can seem small even if it is large and a place with just a few select pieces of furniture can seem large even if it is small. All of this also applies to screen real estate. Especially with smaller laptops with lower resolution displays, it is nice to get as much space as possible for the actual content and waste as little as possible on distracting UI elements that makes the screen seems smaller than it is. By having more space for the actual content, you also minimize scrolling.

I achieve max pixel efficiency by using the tiling Window Manager Sway. Since it is a tiler, it automatically places windows in a tiled layout. Compared to working in a floating WM or Desktop Environment, I save a lot of mousing around to move my windows. I have a nice wallpaper, but no icons that clutter up my desktop. I have set up Sway to have 2 pixels of border around each window and no title bar on top to get as much space as possible for the programs I work in. The two pixels are needed to see where one window ends and another starts and also to distinguish between the active window with a red border and the inactive window(s) with a blue border. One pixel was hard to see, so I went for the somewhat wasteful setting of two pixels in stead.

I have also set smart_borders on which means that if I have only one window on a virtual desktop, it is without any border at all. This saves four pixels in both directions and looks nicer. I use a small 12 inch Thinkpad X230 with an internal 1366 x 768 pixel display as my main machine and usually just one program per virtual desktop, so the smart_borders make a difference. On my external 2560 x 1440 pixel 25 inch wall mounted screen behind my standing desk, I am more inclined to have two programs side by side if I am actively working on something in one window and just need to look something up or do a related task in another window. Humans are generally worse at multitasking than we think, so I like to separate different tasks on different virtual desktops even on large screens to not get distracted.

I do not use a panel on the top or bottom of my screen since this wastes pixels in the directions most screens have the fewest (height). I have set up the built-in Swaybar to autohide. I use scripts launched with keyboard shortcuts for the few things I need that most people keep in their bar or panel, like getting battery status in a notification or turning wifi or bluetooth on or off. A benefit of using scripts launched by the keyboard in stead of a bar with lots of information or system tray applets is that I save mousing around in submenus of my system tray or clicking on my panel to get things done. Since Sway implements the system tray of Swaybar in an xdg standards compliant way, but most programs still use a legacy Gnome implementation, most tray applets do not work anyway and this is what forced me to think closer at what functionality from the system tray I actually needed in the first place.

Over time, I have gradually switched out some of the larger GUI programs I used with smaller, simpler, more customizable and easily scriptable tools. Some of them are terminal programs, some are Emacs packages and some are small GUI programs. Many of the small GUI programs also have a minimal GUI that only present a few very useful elements and is otherwise controlled through keyboard shortcuts, like zathura or mpv. By having very few user interface elements, these programs give more room to the actual content you read or watch. The same applies to the TUI programs and Emacs packages I use.

Since switching from vim to Emacs, I have integrated some of the tasks I used to do in separate programs into it. Emacs is very efficient since it is so keyboard and text centric and by having fewer programs, I save the cycles my brain would use for context switching with different keyboard shortcuts for different programs. Emacs also has the ability to run both in a GUI which is what I normally use (since it adds support for different fonts in different contexts, pictures and PDFs), but can also be used in a terminal emulator or the tty with most of the same functionality. An example of how I gradually have integrated my workflows into Emacs is that I recently stopped using PCManFM as my file manager and instead now use Emacs' dired and the GNU coreutils in a terminal (inside or outside Emacs).

To save space in Emacs, I turn the menubar, toolbar and scrollbar off which saves some pixels on the top and right side of every window. I instead use F10 for the occasional dive into the menu and keyboard shortcuts like C-v and M-v to scroll down or up and M-< and M-> to go the the start or end of a document. I also turn on showing column and line numbers in the modeline and do not turn on line numbers on the start of every line since I can easily find the right line with the modeline if I am debugging something with an error on a specific line. It looks a bit cleaner and saves some space on the left of the screen. Usually, this does not matter much since screens are generally wider than they are tall, but when having three windows with code side by side on a small laptop screen, it can be the difference between having to scroll horizontally or not.

All in all, by saving some pixels here and there, I get more space for the content I work with, watch or read while also reaping the efficiency benefits of a more text and keyboard-centric workflow that came as a consequence of having fewer visual clues on screen and using the mouse less. A lot of functionality is not obvious at first sight, but since I have set this up myself and know my keybindings and the available functionality, it works well for me. Sometimes less really is more.

Offline dictionary lookups within Emacs

There is a dictionary-mode in Emacs. It used to be a separate package, but now comes as part of Emacs. The usual way to use it is to (setq dictionary-server "dict.org") in init.el (or equivalents) to tell Emacs to look up dictionary definitions from the internet when used. There are a lot of dictionaries in dict.org. The availability of the full text of the Webster 1913 dictionary within it has been much lauded in the Emacsphere by wordsmiths eager to vary their outpourings' formulations. However, I am not always online. I like to keep as much functionality as possible available to me offline to not become over-reliant on the internet or loose functionality when the internet is unavailable.

The solution is simply to install the dictd server and the dictionary packages you want on your computer. In Debian, these are available as dictd and a number of packages that supply dictd-dictionary for it. In Arch, dictd is an ordinary package in the community repo, but the dictionaries has to be added through the AUR. The dictd server and related dictionary files are however not available yet for GNU Guix. The Arch Wiki has an excellent page on dictd if you want more information on its usage. Once installed, you can just change the aforementioned dictionary-server variable from "dict.org" to "localhost" and Emacs will find your installed dictionaries. Depending on the distro, you may also have to systemctl enable dictd.service and systemctl start dictd.service to make certain dictd runs at every startup as well as immediately.

The selection of freely available Norwegian BokmĂ„l dictionaries is rather slim. I only found an English - Norwegian dictionary that seemed slightly useful to me. I wish there was as Norwegian BokmĂ„l - English dictionary as well since that would sometimes be useful for me even if I have a decent English vocabulary. There are some dictionaries from other European languages to Norwegian BokmĂ„l, but I seldom use other languages than English these days. (I used to play opera, cantatas and masses and then those would have been useful to me.) There is also a Norwegian Nynorsk - Norwegian BokmĂ„l dictionary by freedict. It could occasionally be useful when I read very old Nynorsk (Landsmaal). I wish there were a comprehensive Norwegian BokmĂ„l dictionary with word definitions, synonyms, IPA pronunciation, example of usage and expressions. I would use it especially for synonyms and spelling. Since I have lived and worked some years in Denmark and Sweden, my BokmĂ„l spelling isn't as good as it used to be, and ten years of using English as my working language after I returned to Norway did not really improve it either. I naturally blame the morons in the government of Denmark-Norway that decided to support Napoleon for all my current spelling troubles. Or maybe the Swedes that broke up the Kalmar Union should ultimately be to blame? Ok, maybe I need to take some responsibility myself as well…

American English is well covered by the GNU version of the Collaborative International Dictionary of English (dict-gcide) that includes the full text of the 1913 Webster's Unabridged Dictionary, the 1906 Century Dictionary and some other additions. I also installed WordNet (dict-wn) for synonyms. There are also some good computer term dictionaries like the Jargon File (dict-jargon), Virtual Entity of Relevant Acronyms (dict-vera) and the Free On Line Dictionary of Computing (dict-foldoc) available. I miss a dictionary with both British and American spelling and also IPA pronunciation since I try to stick with British spelling and RP. It is a pity that Oxford University Press do not release the Oxford English Dictionary or my favourite, the Oxford Advanced Learner's Dictionary, under a free culture license so it could be included as well. I have the Advanced Learner's Dictionary as a paperback in my bookshelf, and there is a website with it available gratis, but leaving Emacs breaks my flow when writing, the internet is not always available and my paperback is only available in my home. In my opinion, a university should use free culture and software licenses for everything they produce since when public money is used, it is only fair that the tax-payers get access to the works they funded. Also, the freedom to use, study, modify and share information should be the core values of any school or university.

I use both M-x dictionary-search and M-x dictionary-lookup-definition. The former lets you write in a search term while the latter looks up the word at point. The latter is obviously very useful while reading while the former may be more useful when writing, except if you want to find a synonym while revising your text where the latter becomes useful again. There is no need to change dictionary language for dictionary-mode unless you have installed too many dictionaries or dictionaries of languages with a lot of collision of vocabulary and spelling. Norwegian and English share a lot of vocabulary, but seldom collide in spelling, so I see no need to exclude any of the relevant dictionaries in either language. If you are overwhelmed with hits, it is possible to change dictionary inside the dictionary-mode buffer to limit the number of entries you get.

Combined with recently setting up flyspell-prog-mode for prog-mode and flyspell-mode for text-mode and (setq ispell-dictionary "british") in my init.el, I now feel more confident than before when writing text in Emacs, whether in code or not. (Dictionaries for lookup with dictionary mode and dictionaries for spell checking are separate and aspell or hunspell has to be installed with relevant dictionaries on your distro for ispell-dictionary to be set to the language you want for spell checking.) It's nice with spell checking for variable names and comments. Maybe I should add a toggle function with a keybinding for ispell-local-dictionary between "british" and "nb" to avoid having to use ispell-change-dictionary.

I Love Free Software Day

I want to thank all the developers, contributors, translators, designers and project leaders who have given me so much great software on I Love Free Software Day! I also want to thank a harpsichordist from Bergen who many years ago showed me that GNU/Linux was a good alternative to Windows or MacOS. Even though I did not do anything about it at the time, some years later, curiosity led me to try out various GNU/Linux distros in VirtualBox on my Mac and that was the start of a gradual transition from Mac OS to GNU/Linux. I already used some free software like LibreOffice, Firefox and Thunderbird on my Mac and that helped ease the transition.

Free Software is about freedom. In practical terms for a normal user, it is very obvious how the users' interests is important for free software projects while non-free software often is more about forcing the users into usage patterns that strengthen the corporate interests of their creators even if it makes for a worse user experience. An example is how Microsoft tries to force people to use Bing, Edge and MSN by not respecting the user's browser and search engine settings when doing a web search from the start button in Windows 11. It makes advertising money for Microsoft, but it is very user-hostile, especially since the users already paid for Windows as part of the cost of their machine. This is just one small example, but there are many more.

I also like how I can help improve free software by contributing to projects I like. I have contributed money, bug reports, translations, feature requests and a bit of very simple code, and hope to do more of this in the future. It is also possible to influence the direction of a free software project by contributing to it. This puts the most active users in the driving seat. In a worst case scenario where a project goes in a direction people dislike, it is possible to create a fork since free software licenses give the freedom to modify a program and distribute your changes. A famous example is how OpenOffice was forked to create LibreOffice which is now the default Offie suite on most GNU/Linux distributions. (OpenOffice is no longer actively maintained.)

I also like how Free Software empowers me as a user to customize it to my liking and learn how to programme in the process. With Free Software, my computer is personal again. Not only can I choose between a lot of desktop environments or window managers to match my preferred workflow, I can also customize these further to my liking. While I prefer a tiling window manager with a keyboard-centric workflow without any panel or bar for maximum screen real estate for my programmes and a minimum of mouse clicks and movement to get things done, other people prefer a full desktop environment either of the more traditional type or a reimagination with new user interfaces like Gnome. GNU/Linux is modular enough to give us those choices by design.

GNU Emacs is another piece of software that is very customizable and when you customize it, you also learn how the code of the program itself works since you customize it in the same language as it is made with by adding your own functions and modifying built-in variables. The documentation of the program is very helpful for learning how to do this. It was the first programme made by the GNU project and a prime example of the freedoms of free software put into practice.

All in all, free software has empowered me as a technology user and put me in control of my own use of technology. It has also freed me from giving up my privacy, which is usually the cost of "free" non-free software.

Happy I Love Free Software Day!

Elfeed with useful scripts

Elfeed is an RSS feed reader package for GNU Emacs. RSS is a standard for getting content like podcasts, video channels from LBRY and Youtube, Mastodon and Twitter, blog entries, news articles etc from the web without using a browser. Before I started using elfeed, I used Newsboat, a terminal program, as my RSS reader. I was inspired by Napoleon Wils0n to add scripts to Newsboat so I could launch videos from RSS feeds directly in mpv or download them with youtube-dl (and later yt-dlp). After I started using Emacs, I wanted to try to integrate most of my computing into it and I looked at the two built in feed readers before trying the highly recommended elfeed package. I liked it, so the next step was to find a way to get the same functionality I had in Newsboat in elfeed.

I don't know Elisp well enough to script this myself yet, so I looked online. I read up on the documentation for elfeed on GitHub and also found some inspiration on Reddit that I tweaked to make some elisp scripts to be able to hit m if I want to watch a video in mpv and M if I want to download it with yt-dlp to my "Nedlastinger" (Downloads in Norwegian) folder. I tried a couple of different solutions before I was able to get what I wanted. The suggestion from Reddit was to use start-process to launch an external process with the url from the entry as its argument. That worked well with mpv. For yt-dlp that was less successful and I also wanted to change directory to ~/Nedlastinger before launching the yt-dlp process so I read up on how to run shell-commands asyncronously and used that functionality instead. I also made certain that any shell command run asyncronously doesn't display a new window. (A "window" is a split within an Emacs "frame" (an X11 window) in Emacs parlance. Emacs is from before the Macintosh introduced the desktop metaphor's now common vocabulary (that Microsoft later copied in Windows), so it uses its own vocab for these concepts.) The reason why there are two scripts for each functionality is that I can use those keyboard shortucts both inside the view where you show the specific entry and in the view where you see all entries while one is selected.

;; Dette gjør at Async Shell Command ikke vises hver gang man kjører en shell kommando med & fra inne i Emacs 
(add-to-list 'display-buffer-alist
  (cons "\\*Async Shell Command\\*.*" (cons #'display-buffer-no-window nil)))

;; Gir meg muligheten til å bruke m i elfeed for å åpne en rss entry i mpv
(defun browse-url-mpv (url &optional single)
  (start-process "mpv" "*mpv*" "mpv" url))

(defun elfeed-show-mpv-open (&optional use-generic-p)
  "open with mpv"
  (interactive "P")
  (let ((browse-url-browser-function #'browse-url-mpv))
    (elfeed-show-visit use-generic-p)))

(defun elfeed-search-mpv-open (&optional use-generic-p)
  "open with mpv"
  (interactive "P")
  (let ((browse-url-browser-function #'browse-url-mpv))
    (elfeed-search-browse-url use-generic-p)))

(define-key elfeed-show-mode-map (kbd "m") 'elfeed-show-mpv-open)
(define-key elfeed-search-mode-map (kbd "m") 'elfeed-search-mpv-open)

;; Gir meg muligheten til å bruke M i elfeed for å åpne en rss entry i yt-dlp
(defun browse-url-ytdlp (url &optional single)
  (shell-command (concat "cd ~/Nedlastinger &&" "yt-dlp -f 'bestvideo[height<=720]+bestaudio/best' " url " &")))

(defun elfeed-show-ytdlp-open (&optional use-generic-p)
  "open with ytdlp"
  (interactive "P")
  (let ((browse-url-browser-function #'browse-url-ytdlp))
    (elfeed-show-visit use-generic-p)))

(defun elfeed-search-ytdlp-open (&optional use-generic-p)
  "open with ytdlp"
  (interactive "P")
  (let ((browse-url-browser-function #'browse-url-ytdlp))
    (elfeed-search-browse-url use-generic-p)))

(define-key elfeed-show-mode-map (kbd "M") 'elfeed-show-ytdlp-open)
(define-key elfeed-search-mode-map (kbd "M") 'elfeed-search-ytdlp-open)

Those scripts worked fine for video channels from LBRY and Youtube, but not for podcasts which use an enclosure url to give the url to the actual episode's video or audio while the general url field in the RSS entry is used for show notes. I tried searching for variables within elfeed with the built in self-documenting features of Emacs, but did not fully understand how to find the enclosure url. After some searching aorund the internet, I found a way to get the enclosure-url and recycled most of my previous code again with the new url to make two functions making it possible for me to listen/watch a podcast with mpv by hitting P and downloading it with yt-dlp with K. I only implemented this for one of the two views.

;; Gir meg muligheten til å bruke P i elfeed for å åpne en podcast (enclosure) i mpv
(defun elfeed-show-play-enclosure (enclosure-index)
  (interactive (list (elfeed--enclosure-maybe-prompt-index elfeed-show-entry)))
  (let ((url (car
              (elt
               (elfeed-entry-enclosures elfeed-show-entry)
               (- enclosure-index 1)))))
    (start-process "mpv" "*mpv*" "mpv" url)))

(define-key elfeed-show-mode-map (kbd "P") 'elfeed-show-play-enclosure)

;; Gir meg muligheten til å bruke K i elfeed for å laste ned en podcast (enclosure) med yt-dlp
(defun elfeed-show-dl-enclosure (enclosure-index)
  (interactive (list (elfeed--enclosure-maybe-prompt-index elfeed-show-entry)))
  (let ((url (car
              (elt
               (elfeed-entry-enclosures elfeed-show-entry)
               (- enclosure-index 1)))))
    (shell-command (concat "cd ~/Nedlastinger &&" "yt-dlp -f 'bestvideo[height<=720]+bestaudio/best' " url " &"))))

(define-key elfeed-show-mode-map (kbd "K") 'elfeed-show-dl-enclosure)

I have set my default browser with my environment variables to Firefox and even though I like Emacs' built in browser eww a lot for text-based content with the occasional picture, I want to keep Firefox as my default browser for now. However, when I read an RSS entry in elfeed and it does not supply the full blog post, it is nice to stay within Emacs and read the linked blog post with eww instead of launching a heavy external browser. So I had to make two functions for the two view modes for that as well. So for those RSS feeds that do not supply the full content, I just hit B and the content opens up in eww. There is built in functionality to open the linked content in the default browser by hitting b in elfeed, so whenever I want or need to open the content in Firefox, I just hit b. For some content that is dependent on JavaScript or is full of media, I sometimes use that built in function, but usually, I use B instead.

;; Gir meg muligheten til å bruk B i elfeed for å åpne en rss entry i eww
(defun elfeed-show-eww-open (&optional use-generic-p)
  "open with eww"
  (interactive "P")
  (let ((browse-url-browser-function #'eww-browse-url))
    (elfeed-show-visit use-generic-p)))

(defun elfeed-search-eww-open (&optional use-generic-p)
  "open with eww"
  (interactive "P")
  (let ((browse-url-browser-function #'eww-browse-url))
    (elfeed-search-browse-url use-generic-p)))

(define-key elfeed-show-mode-map (kbd "B") 'elfeed-show-eww-open)
(define-key elfeed-search-mode-map (kbd "B") 'elfeed-search-eww-open)

Comparing my present elfeed setup with my former Newsboat setup, one thing that is much nicer with these scripts and elfeed is that I don't have to use an external program for podcasts. Newsboat comes with podboat which is intended for use as a podcatcher after you have qued up the content within Newsboat. That process always felt cumbersome and I actually didn't use it because of that. With elfeed and a few scripts, I have all kinds of feeds within the one reader and use a few different keyboard shortcuts to get everything done that I want. Another nice thing with elfeed is its search functionality which is very powerful.

My Emacs journey is still in its infancy, but the more I delve into Emacs, the more I like it. It's powerful, personal and pleasant. Emacs extends the hackability of GNU/Linux further by allowing you to tweak not only your DE or WM through configuration and shell scripts, but also the program you do most of your tasks inside. Integrating more functionality into Emacs means less friction and context switching between different tasks. Thus far, I have only integrated RSS reader, email, pdf document creation (org mode with latex export to pdf), blogging (org mode and org-static-blog), some web browsing (Firefox is still my default browser, but I use eww more and more), note-taking in org mode (I used to use vim and markdown) and of course general text-editing.

It's interesting how much faster for instance navigating around my emails is in mu4e within Emacs than in Thunderbird which was my previous email program. I think the reason is that Emacs is both text and keybord-centric (while also allowing for mouse use if you are so inclined). Elfeed has also become more useful than Newsboat used to be for me since I now also use it for podcasts. The hackability of Emacs means you can add functionality you want or customize things to your own preferences easily. Emacs also uses less system resources than other programs while doing more. Fewer resources means less power use and longer battery life on laptops. You can save money and possibly also CO2 emissions if your electicity is produced in environmentally unfriendly ways.

I see Emacs as the ultimate step in my gradual move towards less resource usage for my computing that started when I switched from Mac OS X to GNU/Linux in 2011, moved to a light-weight desktop environment (LXDE and later LXQt), then to even lighter weight window managers, gradually switched some GUI programs with terminal programs and scripts and then in the end the gradual integration of many tasks into Emacs. (I did this mainly out of curiosity, but I have reaped other rewards like less resource usage and more freedom as well.) If you see Emacs as only a text editor, then it is more resource hungry than vim (but less than VSCode), but if you see it as what it is: an integrated, hackable computing environment, then it is less resource hungry than the combination of programs you would use to do the same tasks. It is also the ultimate expression of the FSF's ideal of empowering users through the use of free software. I am definitively going to delve deeper into Emacs in the months to come.

Vim vs Emacs for fast text editing

vimvsemacs.jpg

Introduction

I used vim for 2 years and got it into my muscle memory before my Emacs curiosity led me to try out GNU Emacs in the spring of 2022. Many people say vim is the faster text editor, but Emacs is wonderfully extensible. After having used both, I don't think vim is faster than Emacs, so I am going to show how many consecutive key presses you need to accomplish some common tasks in both and compare. Of course, you can use evil-mode in Emacs and edit text the vim way, but I am comparing the usual non-evil default keybindings of Emacs with the defaults in vim. There is also the common halftruth about crazy key chords in Emacs contra simple one-key presses in vim. This is true for many workflows, but not so much for actual text editing. For text editing, the keyboard shortcuts in Emacs are usually just a modifier key plus an alphanumeric key.

I believe that pressing two keys at once takes the same amount of time as pressing one key. I call both "a keypress". On the other hand, pressing three keys consecutively takes three times longer than pressing three keys at once because you have to depress one key, lift up your finger, then depress the next key, lift your finger and then depress the next key and lift your finger. Therefore the actual speed of editing is determined by the number of consecutive keypresses to get something done, not the total number of keys depressed. As an example, I often press C-c C-, s (Ctrl-C Ctrl-, s) to insert a code block in org mode which is three consecutive key presses and a total of four keys (I hold Ctrl down from the time I start pressing c until I have finished pressing ,). This could have been faster if it involved fewer consecutive keypresses even with the same amount of totalt keys, like for instance the keypress C-M-S-, (Ctrl-Alt-Shift-,) which is just one keypress, but also four total keys. My point is that when thinking about the speed of editing, it is the number of consecutive keypresses that matter, not how many keys you press at once (although fewer is less akward for the hand).

In this blog post, I will use Emacs symbols for keybindings in Emacs where C = Ctrl, M = Meta (Alt or press and release Esc), S = Shift and s = super (Windows/Tux/Purism/Apple Commmand Key/…). Emacs keybindings are generally written with a dash when pressed together and with a space in between when consecutive, for instance M-b C-p means Alt and b pressed at the same time and then Ctrl and p pressed at the same time. When the same modifier key is used for two consecutive key presses, it does not have to be released like the example above with C-c C-, s shows. When writing about Vim, I will use Esc for Escape and use no space between consecutive keypresses which is the usual vim way, for exampel 2gj for the three consecutive keypresses 2, g and j. All other glyphs just represent themselves.

Comparison of keypresses for common editing tasks

Before starting to write anything in vim, you have to press i (or a or o etc). In Emacs, you just start writing. That's one keypress for vim and zero for Emacs. After you have written a sentence, maybe you want to move back and do an edit. Let's say you want to move to the start of the sentence you just wrote and add something in front of the first sentence. In vim you would press Esc to get to normal mode and then 0 to move to the start of the line (not necessarily the line you see on screen, but the start of the chunk of text since the last newline character) and then you would have to press i. In Emacs, you would press C-a (or M-a if the sentence is longer than one visual line) and start to write. In vim, you would need three consecutive key presses and in Emacs one before you started to write your new first sentence. After you have written your new sentence, maybe you want to go to the end of your paragraph and add something. In vim, you would press Esc, then A and then start to write. In Emacs, you would press C-} and then start to write. Again, vim has two consecutive keypresses and Emacs has one before writing.

Maybe we want to move two visual lines up and correct the misspelling of the word "icnonsequently" next. The word is two visual lines up, but starts four columns (four letters) to the left of where we are now. In vim, you would press Esc to get to normal mode, then 2gk (that is not one keypress, but three consecutive key presses) and then 3h (two key presses), then d, l, i and c, which is 1 + 3 + 2 + 1 + 1 + 1 + 1 = 10 consecutive key presses. In Emacs, you would press C-2 C-p (or C-p C-p) (two consecutive key presses to move up two visual lines since Emacs works on those), then C-2 C-b, then C-t (to use the function transpose chars with the cursor at the third letter), ie 5 consecutive key presses.

I could probably think of more examples, but the point is that for most edits, Emacs demands fewer consecutive key presses than vim. You can check out Emacs Rocks' episode 3 and 4 where Emacs is faster than vim for a couple of Vim golf tasks. Protesilaos Stavrou has also made a video where he shows off Emacs Macros for solving Vim Golf tasks. I think most of these are faster than vim as well. There are probably more examples floating around the internet if you care to find them.

How can vim be slower than Emacs? Everyone think it is the opposite…

The reason why we get more consecutive key presses and spend more time to get from one point to another and start writing in vim is because of the modal editing. Since we constantly have to hit Esc to get to normal mode before moving around and then hit a, o, i, r, c, A, O, C or I before actually getting to start typing our text, we generally need two or at least one (when combining movement and getting into insert mode like with A) more consecutive keypresses for moving around and starting to write in vim than in Emacs. Even if you count the total number of keys depressed and disregard that it is faster to press two keys at once than to press the same two keys after each other, Emacs usually ends up with fewer total number of keys pressed for doing the same edits.

Modal editing, as shown above, is slower since you have to go in and out of modes. In addition, it is very unlike any workflow most of us have ever used before, which means that it takes more time to learn text editing in vim than to learn text editing in Emacs. As someone who has spent time learning both vim and Emacs, I found vim to have a much steeper learning curve for text editing. The people that say vim is intuitive on the internet are lying to seem leet. Emacs can also do everything else than text editing, so you can continue to learn Emacs after your muscle memory has adjusted to its text editing workflow and that is the reason why many people think Emacs is hard to learn, but for text editing, it is easier to learn than Vim. Most Emacs users were (Neo)Vim users in the past, but there are very few (Neo)Vim users that were Emacs users. I think this means that when Vim users try Emacs, they never go back.

Both vim and Emacs have good tutorials that you should spend some time with when trying them out for the first time, but for vim, I felt like I had to go back to the tutorial a lot of times before I really mastered the concepts of modal editing and the keyboard shortcuts for doing things. When I finally made my own vim cheat sheet for my Norwegian keyboard layout and hung it on the wall underneath my screen, I finally started to get its keyboard shortcuts into my muscle memory. With Emacs, I felt that the text editing keyboard shortcuts were more intuitive and easier to learn and remember since many of them are mnemonic.

Conclusion

The joke that Emacs is a good operating system that just lacks a good editor is just a joke. It is a slightly faster text editor than vim and it is easier to learn for text editing because of its non-modal nature. There are other reasons for choosing a text editor than text editing speed, like using the same tool as your colleagues or fellow students, having the possibility to do more things within a hyper-efficient text-centric interface or having a tool that is very minimal. I think both (Neo)vim and Emacs are good choices for investing some time into learning since they both have strong communities that will make sure they will be around for fitfy years more. Even if you use a GUI-centric editor as your main editor, you will probably be in a situation where you need to edit a configuration file from at tty and then vim and Emacs are readily available where the GUI-centric editors are unusable. Nano is an option, but it is very inefficient compared to vim and Emacs, although it is a lot more noob-friendly since it lists the most used keyboard shortcuts inside the window.

Both editors demand a bit of configuration and going through a tutorial to learn how to do basic text editing in them which is a different approach than many of the newer GUI-centric editors with more of a one-size-fits-all approach with or without extensions that may tweak things a little, but not a lot. I think those editors are short term solutions that will disappear when the priorities of the companies or individuals who make them change, like Atom exemplified. Another reason they are not long-term solutions is that they will get enshittified by the companies that make them to nudge/force you to use their other services or to harvest your data. An example is how VSCode integrates with GitHub, but not other git forges, how it gathers telemetry (probably for LLMs as well as for usage statistics) and how it promotes GitHub Copilot over other LLM tools. Microsoft's marketing of it as open source is of course a lie. Long term Emacs users remember other editors coming and going while Emacs and ed forks (ex, vi, vim, NeoVim…) where always there. In the end, you choose the tools that work the best for you. Just don't lie and say you use vim because it is faster if you haven't given Emacs with default keybindings a try.

A script to play radio streams through mpv

Update 2022: You can find this script as well as some others at https://codeberg.org/einar/scripts/.

In this video, I show a script I have made to play radio channels through mpv after having selected which channel to listen to through bemenu.

Emulating a G4 Mac on GNU/Linux

In this video, I show you how to emulate a G4 Mac on GNU/Linux by using QEMU.

My minimal Sway desktop

I have made a video where I show off my minimal sway desktop.

My Openbox Desktop

I used to use LXDE and later LXQt as my desktop environment on Linux, but recently, I have switched to the Openbox Window Manager instead. I made a video about how I use it that I uploaded to LBRY. There are lots of videos of how people use tiling WMs. Most videos with Openbox uses it in a #!-inspired way with tint2 and conky, but since my use of it is quite different, I thought I would share how I use it and maybe someone might be inspired to use it the same way.

In the video, I don't go into the rc.xml since the default is quite good and I have only added a few things to get volume keys and brightness keys to work in addition to a few keyboard shortcuts, but I show how you can use synapse for launching apps through the keyboard and stalonetray for a systemtray in the built in "dock" feature of Openbox.

Link to video here.

How to install Steam on Ubuntu

For some strange reason, installing Steam directly from the Software Centre doesn't always work, and I have often had to look it up. Someone needs to put in the logic to add i386 repositories and enable the partner repositories before trying to install Steam from the Software Centre.

There are lots of different advice out there and not all of it actually works, so I thought I would write a blog post to remember how to do it and possibly help others with the same problem. This worked for me in Ubuntu 19.10 and Ubuntu 18.04 and it will probably work in future versions like Ubuntu 20.04 as well.

For any of this to work, you have to have enabled repositories from Cannonical partners in your Software Sources control panel since Steam is in those.

Then open a terminal and execute the following:

sudo dpkg --add-architecture i386
sudo apt update
sudo apt install steam-installer

The first command adds the i386 architecture to your repositories. This is important because most Steam games are i386, not AMD64, so you need to get the i386 versions of libraries for things to work properly. Notice that before add, there are two dashes (they just look like a long dash here.=

The second command updates apt's list of packages available. You should always do this after adding an architecture or a repository.

The third command installs the steam-installer. When you run this later on, it downloads the newest update to the Steam runtime and installs Steam properly.

Since Steam uses the Microsoft Arial font a lot, you might also want to install the Microsoft fonts with this command:

sudo apt install ttf-mscorefonts-installer

You may also just use the Liberation Fonts since those are free software and are made to match the Microsoft Fonts without any of the license restrictions of the MS Fonts.

Another option is to not just install the Microsoft fonts, but all of the Ubuntu restricted extras while you are at it for better DVD-reading/ripping support and such:

sudo apt install ubuntu-restricted-extras

How to calibrate the screen on a Thinkpad X230 on Linux

If you run Gnome or KDE Plasma as your desktop environment, there are built in tools for you to calibrate your screen. You just need to find an .icm or .icc profile file that matches your screen to calibrate it. The best is to make one yourself with a hardware calibrator, but if you do not have a calibrator you may get close by using a profile another user of the same screen has made even if it will be slightly less accurate. (See below to find one that matches the X230 with the IPS screen.)

I have run LXDE up to now and have just switched to LXQt. Neither of these lighter and smaller desktop environments have a built in screen calibrator, so I needed to find another solution. The solution I found will work in any desktop environment or window manager as long as you use X11.

Flower.jpg
Figure 1: Flower

On the Arch Wiki I found a good solution called xcalib. This is a command line tool that takes an .icc colour profile and calibrates the screen with it. I tried with the .icm profile I had extracted from a Windows executable supplied by Lenovo on their site and it didn't work. I then DuckDuckWent and found on a Thinkpad forum that there was a colour profile for the X230 available in the Display section of a review of the X230 on notebookcheck.net. The profile is hidden on the bottom of a table with technical info on the right of a picture with the text "distribution of brightness" underneath. (If it should ever disappear, contact me through my contact page and I will happily email you a copy.)

I downloaded the .icc profile file and fed it to xcalib and the colours changed. I also have a Thinkpad W520 with a calibrated screen and know how my pictures on Flickr should look from seeing them on that screen, so I took a look at the same pictures on the X230 screen and they looked as they should as far as I was able to ascertain. It was really obvious that they did not look right before the calibration, but after the calibration, they looked alright.

To make this change permanent, all you need to do is to execute the xcalib command with the .icc profile file that fits the screen at the start up of your desktop environment or window manager. In LXQt, you can use the Session Settings to autostart xcalib thenameoftheprofile.icc. In LXDE, you can use the LXsession session manager to do the same. I put the .icc profile file in my home folder to be certain I back it up properly.

To me, getting the screen calibrated was the one missing piece to make the Thinkpad X230 an excellent ultraportable machine that can replace my Thinkpad W520 as my main machine. I like the small and light 12 inch form factor, the IPS screen, the excellent keyboard, the relatively powerful i7 M-class processor, the long battery life and the generous selection of ports.

The advantages of Linux seen from a Mac user's perspective

WelcometoUbuntu.png
Figure 1: Welcome to Ubuntu

Lately, many Mac users have been disappointed in the hardware and to a lesser degree also the software that Apple makes. It seems like Apple is focused mainly on iOS since their earnings mainly stem from it. Some of the core Mac users in creative industries that have used Macs since the 80s are now leaving or thinking about leaving since it seems like Apple no longer makes the best hardware for these use-cases. For video editors that need the ultimate in processing power, graphics processors, RAM and storage space, there hasn't been a good Mac since 2013. Therefore, some companies like Pixar that traditionally used Macs have been using System76 machines with Ubuntu for some years now.

For long time Mac users, Windows 10 doesn't necessarily look like a good alternative to macOS. Linux is the lesser known alternative, but it is in many ways more similar to macOS than Windows, although there are of course a lot of differences as well. Since I have gradually switched from Macs to Linux over the last few years, I thought it would make sense for me to share some of my thoughts about the main advantages of Linux seen from a Mac user's perspective.

Choose the hardware that best fits your needs

The main advantage of Linux is freedom of choice. Since Linux runs on a vast range of hardware from embedded devices to supercomputers, you can choose whatever hardware suits your needs when using Linux. With Macs, you have to live with the machines Apple make, or you can hack together a useable, but often not upgradable hackintosh solution that will usually be a hassle to maintain. Windows is also installable on lots of different computers, but Windows limits your choices in other ways. Read about desktop environments, the influence you have over software projects, the Unixy goodness and the choice of Linux distribution to understand what Windows lacks that Linux has.

With Linux, the easiest way to get good hardware support is to buy hardware with Linux preinstalled. However, building a desktop computer yourself from parts may give you more freedom of choice as to what to prioritise, and buying new or second-hand computers that originally came with Windows will give you many more models to choose from, but no customer support from the vendor. On most hardware, Linux just works, especially if you use one of the more newbie-friendly distributions (distros) like Ubuntu and derivatives (Mint, Ubuntu MATE, Lubuntu, Xubuntu, KDE Neon, Elementary OS…), PCLinuxOS or Manjaro. To avoid buying hardware that is less than ideal on Linux, if you do not buy hardware with Linux preinstalled, you should do some research before buying. So, when it comes to hardware, you have more choice with Linux than with macOS.

Choose the core technologies you prefer

Unlike on macOS, where you have a couple of supported versions of the same operating system, on Linux, you have hundreds of Linux distributions (distros) to choose from. Some are tailored to special use cases like media production, security audits, servers without a GUI, education… while others are more general-purpose desktop distributions. Some come with long term support and stay on the same version numbers of software while delivering security updates for five (Ubuntu LTS) or ten years (CentOS, Red Hat, Ubuntu LTS if you pay for extended support), while others churn out new versions every 6 months (Ubuntu non-LTS, Fedora) or at other regular intervals. Some distros only have new releases when they are absolutely certain the next version is stable and ready for use (Debian, Makulu) and yet again others are continually rolling out updates after a short period of testing so that you never have to reinstall (Arch, PCLinuxOS, Solus, Manjaro). Some distros focus on a particular technology, while others focus on designing a pleasant user interface with tailor-made apps to suit the desktop environment.

The abundance of choice is sometimes portrayed as a problem by non-Linux users, but in reality, it means that no matter what sort of user you are, you will find a distro that suits your needs and wants. The many distro projects also contribute free and open source code to the wider free and open source software ecosystem which means that even if an app, a library, a command line tool or a desktop environment was made for one particular distro, it will often find its way to other distros if it becomes popular among users. With the GPL licences giving people the freedom to use and change the software at will, every good idea that comes along can be furthered by everyone else to fit their needs or tastes. This sharing is one of the core philosophies of free software and the GNU/Linux world.

Although the many possible choices may be intimidating for a new user, starting out with a user friendly distribution with good hardware support and a pleasant desktop environment will give you all of the benefits of the wider Linux ecosystem, while keeping things easy to manage. If you or your company then over time learn that there are particular tools available in another distro, or maybe you prefer another desktop environment or other core technologies, then it is usually easy to change from on distro to another. The hardest part is to switch from Mac OS X to Linux. Once on a Linux distro, there are very few lock-ins, so it is usually easy to change distro. Some do this so often that they are considered "distro hoppers".

Choose the desktop environment you like

On macOS and Windows, you either have to use the graphical user interface your operating system (OS) delivers or use another OS. On Linux, most distributions (distros) have lots of desktop environments and window managers (lower weight and simpler desktop environments) to choose from. If you like the core technologies of a distro, but dislike its desktop environment (DE), then you can install another DE instead. Some distros come with only one desktop environment by default (elementaryOS with the Pantheon DE). Other distros ship more than one desktop environment that the user can choose at install time (Antergos, Debian, Arch…) while others have different editions with different DEs (Manjaro, Linux Mint). Yet again other distros come with one official desktop environment, such as Ubuntu (with Unity), but with official and/or unofficial community projects, flavours or respins that deliver other desktop environments like Lubuntu (with LXDE), Xubuntu (with XFCE), Ubuntu MATE (with MATE), Ubuntu Gnome (with Gnome), Kubuntu (With KDE), Ubuntu Budgie (with Budgie).

elementaryOS.png
Figure 2: elementaryOS

Even where only one desktop environment is available in a distro, other desktop environments and window managers are usually available in the software repositories, and it is trivial to install your favourite. This also means that if a family shares a desktop computer, the mother might like to use KDE, the father might prefer Unity, the oldest daughter might like LXQt while the youngest son enjoys Joe's Window Manager. These different desktop environments and window managers will happily live on the same system and with multiple users logging into their favourite. It is also possible to use Gnu/Linux without a user interface at all and just log into the command line interface. Most servers (whether on real hardware or in virtual machines) are setup this way.

Use familiar Unix command line tools

Just like macOS and the BSDs, Linux has its roots in Unix. Unix had multi-user environments, networkability and stability as some of its strengths. The Linux kernel itself was originally made by Linus Torvalds to make a usable Unix system out of a desktop PC, even if it is now used on a vast range of devices and hardware architectures. Many of the command line tools used in Mac OS X are the same or have the same name as the GNU utilities used in Linux. That is why Linux distros are also called GNU/Linux or GNU+Linux. This means that if you used Unix back in the day, or if you have become familiar with the Mac OS X terminal, most of that knowledge is usable on Linux as well. So, for macOS power users, the Linux terminal will be a cosy and familiar place.

Linux is the natural choice when operating system does not matter

Sometimes, the operating system does not matter at all, and the choice is more down to economics and practicalities. In these cases Linux is a natural choice as it runs well on lots of different hardware, can be used cheaply, gives you better security than Windows during the supported lifespan of your distro while giving you maximum flexibility. This is the case when you use software that is running in "the cloud", such as Microsoft's Office 365, Google Docs, Visma Enterprise… The trend is that many programs that used to be native to Windows or macOS, but did not ship a Linux version is now available in the cloud through any browser. This means that some software that in the past was unavailable to Linux users (or at least only available through the use of Wine or a virtual machine that ran Windows) is now available. If you prefer to continue to use MS Office even after trying LibreOffice, Calligra and WPS Office, then you can use Office 365 in the cloud. Or you could continue using Office 365 while gradually checking out and getting used to the alternatives. For some users, this takes care of their "I would use Linux if only X was available" problem.

You could argue that when using web based software, then ChromeOS might be the natural choice, but the advantage of using a better Linux distro than ChromeOS (ChromeOS is actually based on Gentoo Linux with a custom made desktop environment and Chrome) is that in addition to the cloud services and web apps, you can also run desktop software and if you are a developer or sysadmin, you have access to the terminal. A Linux distro gives you everything ChromeOS does and runs just as great on the same type of low end hardware that ChromeOS runs on, but gives you a lot more flexibility and freedom of choice. ChromeOS also has the disadvantage of being tied into the Google ecosystem, which means that you have no privacy, as Google's business model is to learn as much about you as possible and use this information to give you targeted ads. You can run the same webapps on any Linux distro as on ChromeOS, but block ads and spyware if you like.

In addition to cloud services, there are also more traditional scenarios where the operating system does not matter, like for instance when a developer uses her laptop just as a terminal to gain access to the server where all the code is hosted and the software is built or a system administrator just needs a machine with SSH to monitor all his virtual servers in the cloud or machines at different locations. Many of the more technical, newer Mac users that came to Mac OS X in the early 2000s was enticed by the Unix underpinnings and the Aqua interface on top and the shiny hardware, but have recently found macOS to be gradually more locked down and less Unixy while the hardware have become less good (for instance with keyboards that makes your fingers hurt like on the new MacBook and MacBook Pros). At the same time as Macs have become less enticing, Linux distributions have become more user friendly and Linux desktop environments have become more polished. Combined with great hardware now on offer, many of these users now embrace ultrabooks with Linux preinstalled. Dell has specifically targeted developers in its line of Developer Edition computers with Ubuntu and this bet seems to be paying off for them. System76 and Entroware also have a great offering of high end laptops and desktops for pro users and are selling even more Linux machines than Dell.

Open standards without lock-in

Most programs you run on a Linux system use open standards for organising and saving documents. This means that if you want to switch from one photo library program to another one, you probably do not need to spend a lot of time exporting pictures or rearranging folders or anything like that. Just install the new software and start using it. The same applies to other categories of software like music players, word processors, spreadsheet programs, presentation software… Some programs like the GIMP or OpenShot use their own document formats, but they usually also open and export all the open standard formats in addition to a few well known non-open standard formats.

The use of open formats give you more freedom of choice. If you dislike the direction a program is going in, then you may switch to another program without any hassle. This is much harder if you are using programs with proprietary document formats (like MS Office), or where the content is stored inside a database you have to import or export from (like iPhoto). Once you have transitioned from the lock-in of the non-open formats to the open formats, you can continue to use these documents with whatever software you like for years to come, but if you stay with the non-open formats, those have a tendency to change every now and then, not because there is a need for change, but because Microsoft, Apple and others like to make it impossible for people with an older version of their software to open documents made in newer versions, and thus force people to pay once more for the same programs in a new version.

With more and more countries and regions switching to open standard formats like Open Document Format on their official websites, the future of these formats are much more guaranteed than the proprietary, ever-changing, non-open formats of Microsoft Office and others. Even if you use MS Office, iWork or Google Docs, you probably have to exchange documents with people that do not use the same programs as you, and the use of open standard document formats guarantees a higher rate of success, since most programs imports and exports them.

Economic advantages

Depending on what you use your computer(s) for, the use of Linux instead of Windows or macOS may save you some money. Most distros include a lot of free and open source software both preinstalled or in their software repositories. Much of this software can handle tasks you might have had to buy software to do on a Mac or Windows PC just fine. Most free and open source software is initially free of cost, but if you use the software, you are encouraged to contribute back either monetarily or by helping develop the software further through coding, design, translations or documentation or by simply spreading the word about it. This means that you can evaluate software without buying it, and when you decide which software you will continue using, you are free to postpone contributing back until you have the money, knowledge or time to do so. You are also in a position where you can influence the direction of a project by taking part in it.

Even if you primarily use paid for software (whether open source or closed source) and are a decent person contributing to your distro of choice, you may end up saving some money by getting hardware that is more future-proof or suited to your needs than what a Mac might deliver. With Apple going in the direction of non-upgradable hardware with built in forced obsolesensce and a focus on thinness over functionality, especially users which need high-end GPUs, CPUs, lots of storage and RAM or writers depending on good keyboards, will probably be better off economically by buying more upgradable hardware from other vendors. And you can choose the hardware you want, not the hardware Apple thinks you should want.

Macs have traditionally been more expensive, but you used to get a longer life-span out of the machines than their PC counterparts, but now, they are more expensive, but with the same standard PC parts as other X86 PCs, but with less future-proof designs. A high end laptop from Entroware, System76 or Dell beats a MacBook Pro both on price, raw performance, customisability and longevity, and thus delivers lower cost of ownership per year. Apple is also notorious for charging a lot for built to order options, even if these options are the only way to future proof a machine that is not user upgradable. If you use Linux, you can choose whatever hardware you like, and many vendors cater for both high end, mid-range and low end use cases.

Ubuntu1404MacBook.png
Figure 3: Ubuntu 14.04 on a MacBook2,1

If you do not need high-end hardware, the choice in low-end hardware for reasonable prices for Linux use is much greater than on macOS. Older Macs that no longer get security updates to their installed Mac OS X version and that are unable to be upgraded to later versions of Mac OS X can run many Linux distros just fine. (I used to run Ubuntu side by side with Snow Leopard on my late 2006 white MacBook.) For really low-end needs like thin clients, any used netbook, desktop or laptop from the last ten years will work fine. Just use a lightweight Linux distro like Lubuntu, Peppermint OS, Puppy Linux or AntiX. Even PowerPC Macs are still usable with Linux. And for digital signs, media centres, routers, firewalls, DNS servers and other low power needs, a Raspberry Pi or Intel Compute Stick works well. I use a Raspberry Pi3 with LibreElec for my entertainment system. It cost less than half of an Apple TV and does everything the Apple TV does and more.

Free and open source software gives you influence

With Apple, what you get is what you get. You can choose to postpone to upgrade, but at some point in time, you will no longer get security updates and you need to move on. Many long time Mac users have been bitten by Final Cut or Mac OS X updates that went against their wishes. Sometimes, Apple discontinue software either to replace it with something else that is worse (iPhoto) or not at all (ClarisWorks/AppleWorks, HyperCard, FrontRow). If these programs were open source projects, the code would be available and the users that relied on them could influence what features were implemented and what features were removed. In worst case scenario, they could fork the projects.

If you are dependent on a particular free and open source software, you might want to participate in the project. You can do this by donating money, report bugs and missing features, make translations or take part in the coding of the software. When you do that, you also get the power to influence the direction of the project together with other users. This means that if you need the software to work in a certain way, you can make that happen through participation. Often one user with good ideas can have tremendous influence on a project if she engages with the community in a friendly way. Most projects consists of users of the software, and more often than not, there are many people which want the software to fulfil the same needs. Most projects welcome constructive feedback that will help them towards being more useful for more people.

If the project nevertheless goes ahead in another direction than you wish, if the software is free and open source software, then you have the right to fork it. Forking software means that you make a new project based on the source code of the other project, and develop it further in the direction you and your like-minded would like it to go. It is a huge undertaking to fork a large project, but sometimes the fork becomes more popular than the parent project if enough people are onboard. A famous example of such a fork was when OpenOffice forked into LibreOffice and Apache OpenOffice. LibreOffice became the more popular fork and is now the standard office suite on many Linux distros as well as hugely popular on Mac and Windows as it has better compatibility with foreign file formats and many more features than OpenOffice.

This might all sound a bit theoretical. Most people are not programmers and do not have the knowledge or time to fork software projects. However, if you work for a firm that relies heavily on a particular software project, knowing that the source code for the program is available and that the licence allows you to fork means that you could put an in-house developer or an external contractor to work if you find that the project is moving in a direction that is bad for your business. This ability empowers users to make of the software what they want. It also ensures that open source projects do not become like the proprietary software makers that first and foremost think about how they can sell you more software as often as possible with new versions with change for the sake of change (often to the detriment of functionality) and new document formats that are incompatible with the old in an attempt to force people to update to be compatible with the rest of the world. Free and open source software is there for their users, not for the sake of a company, a project or a foundation.

MacOS 9 in QEMU on GNU/Linux

This is a video where I show how you can run Mac OS 9 in QEMU on GNU/Linux. I followed the documentation on the Arch Wiki and on the QEMU website to get things going.

How to scale LibreOffice to work better on the M10 FHD Ubuntu tablet

The M10 FHD has a 1920 x 1200 resolution on a 10 inch screen. By default, LibreOffice is installed as one of the Xapps, but it is not scaled, so it looks tiny on the high resolution display. I used to scale the documents themselves by using the slider in the lower right corner in LibreOffice Writer, but this was a bit annoying since even if the document was scaled, the user interface was not.

I have found that by simply choosing “Options
” from the “Tools” menu and selecting the “View” tab, it is possible to choose scaling of the whole programme. As with Firefox, I have found that 180% works well. This makes LibreOffice the same size it would be on a 1067 x 667 screen of 10 inches and that works fine. Everything is large enough to be easily viewed, but at the same time there is enough space for content.

I also like to remove the toolbars by deselecting “Formatting” and “Standard” in View > Toolbars and in stead drag the Sidebar out from the right to show more options and be more useful. With the tablet in landscape orientation, this gives me the most space for contents on the page as long as the document is in portrait orientation (which almost all LibreOffice Writer documents are). It gives the least amount of scrolling and the largest possible view of the page. Especially on smaller screens, making the most of the available space is really nice (but I also do this on my 24 inch desktop screen).

Fun with the iBook Clamshell G3 300MHz

I made some videos in 2016 about fun things you can do with an iBook Clamshell G3 300MHz like switch out the hard drive with a CF-card, max the RAM and install Debian 7 on it. I orginally posted these videos to vid.me and later when they disappeared moved on to LBRY and Odyssee. Since I have room to spare on my website and this is a place I have control over myself, I thought I'd post them here now.

In the first video, I show how you can install Debian 7 on the iBook. In the second video I show you how I maxed the RAM and exchanged the ancient and clicking hard drive in my Blueberry iBook with a CF-card and CF-to ATA board. In the third video, I show how the iBook runs after the upgrades from the second video.

How to watch YouTube channels in gPodder

This video shows how you can subscribe to a Youtube channel with gPodder.

Update 2020 This method no longer works, but it is possible to find and RSS feed from a youtube-channel at yewtu.be and copy that link into your RSS reader.

How to use an Apple remote with KODI on Ubuntu on an Intel NUC

I use an Intel NUC i5 as my desktop computer. With Ubuntu 16.04 and KODI (formerly XBMC) it also doubles as a home theatre PC. To make this media centre really usable, I was plannig to use an infrared remote to control KODI. It’s much more practical when sitting at a distance than using a wireless keyboard or trackpad. Most (if not all) of the Intel NUCs have an infrared sensor.

I happen to have a white Apple remote that I got with my white MacBook in 2006. It’s a really minimalist infrared remote control that originally was meant for use with FrontRow before Apple discontinued it when they launched the Apple TV and Mac OS X 10.7 “Lion”. It is literally made for controlling media playback.

I found an excellent guide on how to set it up that worked very well for me, so I wanted to share it and write it down here to remember where I found it for later reference. It’s not too hard to follow and after setting it up with the correct addresses for each key, I am now able to remote control KODI. 🙂

2 Comments on How to use an Apple remote with KODI on Ubuntu on an Intel NUC

Carlos Santos 3rd August 2016 at 12:35 pm

Thanks for the reference 😉

Reply Einar 3rd August 2016 at 2:21 pm

Thank you for finding the information in the first place! It’s easy to follow your guide, but it must have taken a lot of time to figure it all out. 🙂

Second impressions of Ubuntu touch on the BQ M10

With OTA 12 and many app updates, Ubuntu touch is gradually improving. Last time I travelled, I did not take my laptop, and I could do everything that I needed with the tablet. All the basic needs like email, web browsing, chatting, podcasts, watching TV series, listening to music
 The BQ M10 is good enough for it now.

The most important fix in OTA 12 for me was that alt gr now works on external keyboards. This means that with an external keyboard, I can write just like on the desktop in LibreOffice and Firefox. However, there is still a bug with accented characters in native apps (but not the traditional X apps) and this is a bummer, especially for people using languages like French, Spanish, Portugese, etc that use accented characters a lot. Special glyphs that you get to with alt gr work fine, but accented characters do not in the native apps. Hopefully, this will be fixed soon.

As I have used the tablet more recently, I have noticed some more bugs and missing features. In the music player app, I found some minor annoyances such as albums with more than one artist showing up as more than one album in the album view, that there is too little space for album and artist names in album view and artist view and that I would like to have a list view for easier navigation with a lot of music.

After OTA 12 shipped, I also noticed that traditional X apps disappear from the launcher after a restart. This is a bit annoying, as it is easier to get to the launcher than to go to the Xapps scope to launch a traditional app like Firefox.

There are probably a number of small changes in OTA 12 that I have not noticed or tried yet. For instance, I know that it is now possible to use Aethercast to connect to an external screen from my M10, but since I don’t have an Aethercast-compliant Miracast dongle, I haven’t tried it. I haven’t used the tablet much with external screens this far (I have a desktop computer at home), but I have tried it and it worked fine. For presentations, lectures or just watching films at a hotel room, the Aethercast support is cool, but if you really want to be certain that you will be able to connect, an HDMI cable seems a safer bet, since not all Miracast devices support Aethercast.

Another missing feature in Ubuntu touch at the moment is the ability to choose default browser. I would like to be able to set Firefox as my default browser on Ubuntu touch, since I use some add ons and syncing in Firefox that I would rather not be without. With no such setting, any links from any app will open in the Ubuntu touch browser.

Another small annoyance is that it is presently impossible to copy and paste between traditional X apps and the native Ubuntu touch apps. Especially since Firefox is not the default browser and clicking a link opens it in the Ubuntu touch browser, I would like to be able to copy it from there and paste it into Firefox, but there seems to be no way of doing this presently. A bug is open, and it seems to be fixed for the libertine sandbox X apps run inside, but not in all the other projects needed for it to work. So, this will probably be fixed soon.

Some of the other important bugs for everyday use, such as calendar syncing and contacts syncing have not been fixed yet. This is disappointing, but given time, I am certain someone will fix it. Syncing through Google works, but standards compliant ways of syncing or importing/exporting to other services do not. Since Google is not exactly the FOSS enthusiasts’ most obvious choice of syncing service, as their business model is to use all your private data for advertising purposes, it seems strange that the Ubuntu touch developers found time to implement Google syncing, but not syncing to other more privacy respecting services through standards like iCal and CalDAV, since most Ubuntu touch users at this point is Linux enthusiasts.

All in all, Ubuntu touch is really impressive when bearing in mind that it is only a few years old and that it is developed by quite few people compared to Android or iOS. It is already a viable alternative for tablets and phones (unless you speak a language reliant on accented characters and want to use an external keyboard, but this will be solved soon) and in not too long, the Unity 8 interface used on the tablets and phones when in desktop mode will also come to the regular Ubuntu distro on laptops and desktops. This means that all the work going into the tablets and phones will also benefit the desktop in the long run.

I really like the M10, and even if the software is still a bit rougher around the edges than an iPad or Android tablet of the same size would be, I find it exciting to take part in the Ubuntu touch journey as it is maturing. The hardware itself is very good with its high DPI 1920 x 1200 screen, quad core 1.5 GHz processor and I particularly like the well sounding speakers. LibreOffice and Firefox are quite heavy programs, but they run decently on the M10 FHD with a bit of time to start up. They might not be as usable on the slightly slower white M10 HD tablet (1280 x 800 screen and 1.3 GHz processor with slightly slower GPU as well), so I am glad I bought the more expensive and slightly faster and higher DPI black FHD version. The Ubuntu touch experience on the M10 FHD is nice, and gradually improving to become even better. With OTA 12 it is a bit closer to being ready for everyman, but there are still quite important bugs that need fixing and some features missing.

Making Lubuntu 16.04 more pixel efficient

With the panel on the left or right, you get more visible space for content in portrait orientation, like word processing documents and websites and you don’t have to scroll as much. Ubuntu‘s Unity desktop environment got that right.

If you have a low resolution screen this is even more important. If you only watch films on your computer, then the “traditional” Gnome 2 and Windows layouts work fine. The traditional layouts also make more sense on “traditional” a 4:3 screen since the screen has more space in the height compared to the width than modern wider screens (16:9 or 16:10).

In addition to scrolling less and seeing more content, I also find this layout functional and a bit more beautiful than the «traditional» layout. It is possible to use a more fancy dock like docky or plank in stead of the LX panel that comes with Lubuntu, but then you also need compositing and that makes the machine a bit less energy efficient, even if it looks beautiful, so I prefer to just use LX panel. It is possible to use translusency without compositing and it looks quite nice in my opinion. My tweaked Lubuntu with LibreOffice Writer open My tweaked Lubuntu with LibreOffice Writer open

The advantages of using Lubuntu with the LXDE desktop environment in stead of standard Ubuntu with Unity is mainly that it is faster, runs better on older hardware, uses less RAM and CPU and GPU cycles, uses less energy (= longer battery life on laptops) and is more tweakable. Even if I like Unity, Lubuntu lures me back time and again and I enjoy using it a lot. At present, I use it on my laptop after a period of Manjaro Gnome. I am probably more of an LTS kind of guy even if I like the idea of a (slow) rolling distro.

I have made a video showing how to tweak LXDE to be more pixel efficient than it is out of the box on Lubuntu. I also change some other aspects of the look and feel more to my liking. The goal is to get something like what you see on the screenshot above. (There is no sound in the video.)

Here is a step by step guide if you didn’t get all of it from the video.

Openbox configuration manager

  1. Choose “Lubuntu-small” theme in “Theme” tab
  2. Make font sizes 10 in “Appearance” tab
  3. Make 4 desktops and name them in “Desktop” tab in Openbox configuration manager
  4. Set left margin to 33 in “Margins” tab

Customize look and feel

  1. Set icon theme to “Ubuntu-Mono-Light” in “Icon theme” tab
  2. Check / set that theme is “Lubuntu-small” in “Window border” tab
  3. Check / set font size to 10 in “Title bar tab”
  4. Check /set font sizes to 10 in “Misc” tab
  5. Choose “Small toolbar icon” as “Toolbar icon size” in “Other” tab

Desktop preferences (right-click desktop)

  1. Set font size to 10 for “Font of label text”
  2. Deselect “Use desktop as a folder (show icons on it) by path:” in “Advanced” tab

LXpanel (right-click it and choose “Panel settings”)

  1. Set “Edge” to “Left” in “Geometri” tab
  2. Set height to 100 percent
  3. Set width to 32
  4. Set Icon size to 30
  5. Select “Solid color (with opacity)
  6. Click color field and choose a nice light grey and set opacity to 128 and click “OK”
  7. Set Size to 7 under Font.
  8. Remove everything except “Menu”, “Spacer”, “Volume control”,”System tray” and “Digital clock” in “Panel Applets” tab
  9. Move “Digital clock” to before “Volume control” by selecting it and clicking “up”
  10. Select “Stretch” for the spacer
  11. Add new “Spacer” between “Menu” and “Application launch bar”.
  12. Set width of new “Spacer” to 4 pixels by double clicking it.
  13. Add programs to “Application launch bar” by double clicking it

(14. Set Tux image as menu icon by double clicking “Menu” in the “Application launch bar” tab and selecting the Tux image in the open dialog.)

A special thanks go to Leszeck Lesner for the Lubuntu screencasts from some years ago that taught me how to tweak Lubuntu! 🙂

The netbook - a cheap and flexible alternative in the tablet and ultrabook age

There has never been a better time to buy a netbook than today. Netbooks are being replaced by tablets and ultrabooks by a lot of people and the netbook is no longer the new and exciting device it used to be some years ago. Prices are low on the used market and the later netbooks with dual core processors can be had just as cheaply as the less powerful earlier models. There are also netbooks with GPUs (not just integrated graphics), USB 3.0 and HD screens that you could buy cheaply used.

Different people have different needs for different tasks. Fore some, an ultrabook is perfect, for others a tablet, for some a laptop, for some a chromebook and for some a netbook. There are different considerations, such as which operating system(s) you want to use, what form factor(s) you like to use, how much money you are willing to spend, whether mobility or screen real estate is more important to you, how much storage space you need, how long battery life you need, if you want a keyboard or not, if you like touchpads or touch screens or both…

I am touch typist, so I really want a keyboard on my device, but I also want a small and ultraportable devices that is easier to bring with me than my 13,3 inch MacBook Pro. It is just too big and heavy. The 10 inch form factor of most netbooks is very portable, but big enough that the screen, keyboard and trackpad are useable even for adults. There are also netbooks with 11 and 12 inch screens if you prefer a slightly larger size and some people get along fine with 7 and 9 inch netbooks as well. I have got thick fingers, so smaller keyboards than the one on my 10 inch Asus EeePC would be too hard to write on for me.

Netbook keyboards are of varying build quality and size, but I find that the Asus EeePC 1015 PEM I have got is ok to type on, even if it has taken some time to get used to the 93% keyboard size. People often use tablets with bluetooth keyboards, but then you have to carry two devices and you are back to the clamshell form factor of traditional laptops anyway. For me, the price of a tablet combined with apps for it and a keyboard is just overkill when I can get a netbook much cheaper that suits my needs better. I also prefer a full desktop operating system and a full set of ports. For others, a tablet with iOS, Android or Tizen might be perfect. And for the people that want more processor power in a light and portable package, an ultrabook might be right. Personally, I really like the good old-fashioned clamshell laptop form factor.

One advantage of netbooks is that they have all the usual ports like USB, Ethernet, VGA and/or HDMI, sound in and out and SD card reader. If you ever use a USB stick or mobile broadband or want to plug your device into a projector, this might be important to you. Combined with a full desktop operating system, you get all the flexibility of the traditional desktop computer in a light, compact and mobile package. You can run any version of Windows or any Linux distro you want. You can even hackintosh it if you are so inclined. And if you prefer a simpler interface, you might try running Android, MeeGo, Tizen, JolliCloud or any tablet/phone operating system in stead. Choice is good!

Battery life is a reason many people state as their main reason to use a tablet in stead of a laptop. Since netbooks are now getting really cheap on the used market, you could buy a netbook and a high-capacity battery for half the price of a tablet and get more or less the same battery life (some Asus Eee with dual core processors can get up to 13 hours of claimed battery life, which is probably more like 8 to 10 hours in real life). Of course, netbooks with GPUs have shorter battery life, while netbooks with integrated graphics have longer battery life. On my netbook, I am getting around 4 and a half hours of normal use with Wifi on and the screen brightness set to maximum with the three year old low capacity battery that came with the netbook. So far I haven’t bought a high capacity battery, but I am thinking about it. Might be smart to do so before they become too scarce.

With a netbook you have more upgradability than on a tablet or ultrabook. RAM is usually easily upgradable. It is also so cheap now that there is no reason not to max the RAM. Most older netbooks came with 1 GB of RAM and maxed out at 2 GB, but some of the newer ones max out at 4 GB. More RAM will usually increase speed, specially if you are multitasking a lot. A tip if you are running a Linux distro is to maximise the RAM and set the swappiness to 0, so that the netbook will use the faster RAM in stead of using the swap partition on your hard disc as long as there is still RAM available. Since disc writes and reads are draining the battery more than RAM writes and reads, this will also increase battery life as well as make the overall experience faster.

If you buy one of the newer netbooks, they usually come with 160 GB or 250 GB hard disc drives. Compared to tablets which often have 16, 32 or 64 GB SSDs, there is a lot more room for movies and music and whatever you might want to bring with you on most of the newer netbooks. On some netbooks, the hard drive is easily swapped out for another disc if you need more space by just opening a hatch on the back of the computer. On my Asus EeePC, the hard drive is harder to get to, but there are tutorials on youtube and blogs for upgrading it, so it is still user upgradable. Be aware that 2,5 inch SATA drives come in different heights and that your netbook might use a 7 or 9 mm high drive and taller drives might not fit. With hard disc drives up to a Terabyte being quite cheap now, it is not very expensive to get more storage space or a faster hard drive if you want or need to. SSDs bring silent computing since the fans don’t have to remove excess heat produced by a spinning disc. They also bring longer battery life, since there are no moving parts and motors, but the price is high per GigaByte. It is probably overkill to invest in an expensive SSD for an inexpensive netbook. On the other hand, a SATA SSD might be brought over to a newer device or put in a USB, eSATA or FireWire enclosure at a later time, so if you really want one, you might be able to justify it somehow. Personally, I am thinking they are still too expensive and for now, the 250 GB hard disc that came with the netbook is large enough. I keep my ripped DVDs on my MacBook Pro.

Another upgrade choice I mentioned in an earlier paragraph is the battery. Unlike many new ultrabooks and tablets, the battery is usually user replaceable in a netbook. This means that you will be able to use the device for a longer time, since you do not need to pay an authorized serviceperson to open your device to change your battery and you don’t get the dilemma of buying new or a high price for a repairsperson to fix the machine when it is getting old. More user-upgradability means that the device will stay in service longer, which is good for the environment.

There are many things to love about netbooks, but there are also some drawbacks. The main drawbacks are usually the processor, GPU or lack thereof, screen resolution and keyboard. Most netbooks have a screen with a resolution of 1024 x 600, which is useable, but somewhat limiting, specially the 600 pixels of height. Some netbooks have GPUs and higher definition screens, usually 1366 x 768. Even if my Asus has an integrated Intel graphic chip, I have had no trouble utilising projectors or external screens in addition to the internal screen when using Lubuntu. Video playback is fluid. Usually this is not a problem with the newer netbooks.

Keyboards on netbooks are usually smaller than 100%. Some are mushy and very small, while others are quite ok, once you get used to the smaller size and the placement of the keys. I think the keyboard of an Asus EeePC 1015 PEM compares quite well to the chicklet keyboard on the Macbook and Macbook Pro. The main difference is the size and that the keys have slightly more resistance on the Asus. Asus actually used to produce Macs for Apple in the past, so they certainly know how to produce well designed computers.

The processor is usually the main drawback of netbooks. Earlier netbooks had single core Intel Atom processor and later have AMD fusion or dual core Intel Atoms. Even the later netbooks are quite slow compared to full-fledged laptops with Core 2 Duo, i3, i5 or i7 or AMD processors. The ultrabooks, which usually have a slightly bigger screen and a slimmer body beneath the keyboard, have more processing power, but they usually lack the upgradability of netbooks and cost much more.

For most daily tasks like email, websurfing, watching movies, listening to music, podcasts and internet radio, watching online videos and streams, writing documents, making spreadsheets, instant messaging, video conferencing, VOIP &c a netbook is really all you need, but it might take some seconds more to boot the operating system and launch programs than an ultrabook would have used. That is the main trade off for the small size and the quite long battery life. For the low prices of netbooks on the used market, getting a quite new, high-end netbook is a no-brainer if you want a very portable computer and do not need a lot of processor power or a high resolution screen.

After I got my netbook, my huge and heavy 13,3 inch MacBook Pro has become my desktop computer. I still use it a lot at home and when I am away for longer periods at the same place, but for mobile computing, the 10 inch Asus is much more practical. Of course, if you are not a touch typist or don’t want to or need to write on a traditional keyboard, then maybe a tablet might be just as good, but for me, the freedom to install whatever operating system I want and the ability to connect with VGA to a projector or an external screen or use USB to connect to my camera or phone or a mobile broadband USB stick is invaluable. It is much lighter in my backpack than my MacBook Pro. Of course, I might as well have used a small 11 or 12 inch ultrabook, but it would have cost at least triple what I payed. Since I don’t really need the extra processing power, a netbook is perfect for me.

Ubuntu 14.04 on MacBook 2,1 (late 2006) and how to get iSight working

Ubuntu 14.04 "Trusty Tahr" runs quite well on my MacBook 2,1 from late 2006. Now that security support from Apple is (silently) ended for Mac OS X 10.6 "Snow Leopard", installing Ubuntu is a good choice if you want the latest software, want to stay secure and don't rely on Mac-specific programs. (It is possible to dual-boot or keep one of the OSes on an external FireWire hard drive you can boot from if you want to have both. Or you could upgrade to Mac OS X 10.7 "Lion" to get security support from Apple a while longer, but lose Rosetta and FrontRow.)

I initially ran Ubuntu 12.04, the previous long term support (LTS) version, but Ubuntu 14.04 is faster and leaner and comes with more up-to-date programs. If you are thinking of using Ubuntu on your MacBook, use the newest LTS. There is a new version of Ubuntu every six months, but personally, I prefer staying on the long term support version that comes out every two years. This gives me stability and security and I don't need to upgrade or reinstall that often. The LTS release is supported for five years, so even after the next LTS is out, you have some time before needing to upgrade.

Ubuntu1404MacBook.png
Figure 1: Ubuntu 14.04 on the MacBook (late 2006)

Ubuntu 14.04 comes with all the newest programs and everything "just works". All the hardware on the MacBook works fine out of the box, except the internal iSight camera, the internal microphone and the fans. Apple doesn't supply drivers for their fans for Linux or Windows, which means that although you can run Windows or Linux on the machine, the fans are either off or on at full speed. This makes the machine more noisy when not running Mac OS X and also shortens the battery life. The solution is to install macfanctl. You can find it in the Ubuntu software centre or by using apt install macfanctl.

To get the webcam working, I found some tips in an old how-to on the Ubuntu MacTel support wiki,but the page was somewhat hard to understand and I had to do some additional thinking and experimenting to get it working. So I thought I'd share the solution here:

  1. Step one was to get the iSight firmware from a machine/disk with Mac OS 10.6.8 Snow Leopard installed. You have to go to system/Library/Extensions and find IOUSBFamily.kext. Then ctrl-click (or right-click) on it and select "Show contents". Then navigate to the

Contents folder within it, and to the PlugIns folder within it and ctrl-click on AppleUSBVideoSupport.kext and select "Show contents" again. Then navigate into the Contents folder and into the MacOS folder and copy the file "AppleUSBVideoSupport" to a USB memory stick.

  1. Open a Terminal and write sudo apt-get install isight-firmware-tools and hit enter and write your password and hit enter again. You need to install this program to extract the parts of the firmware file that Ubuntu will use and place it where it should be. Don't close the Terminal window yet, you will need it later.
  2. Insert your USB memory stick and copy the "AppleUSBVideoSupport" to your home folder. 4. In the Terminal, write

sudo ift-extract -a /home/yourusername/AppleUSBVideoSupport (with the name of your user instead of "yourusername") and hit enter. (You might have to write your password again.) If everything works fine, you will get notified that isight.fw have been added to /lib/firmware. Now restart, and you can enjoy using your iSight webcam and internal microphone with Skype or Cheese or whatever program you like.

There is also another minor annoyance in Ubuntu for me: the Norwegian Macintosh keyboard layout does not correspond to the physical Norwegian Macintosh keyboards on one key, which makes it impossible to write apostrophes. All other glyphs and modifiers work fine. My solution is to use the Norwegian [PC] keyboard layout and remap the right command key (called the right Win key) to Alt-Gr with the Keyboard system settings panel (as shown above).

Update as of 28th August 2019: I got a message through my contact page that the above procedure to get iSight working also works with Debian. Since Ubuntu is downstream from Debian, that seems natural, but it was nice to hear from someone that has actually done it with success.

How to bring Rhythmbox radio streams from one computer to another

I recently installed Ubuntu on a new machine and wanted to bring along my music collection to use with Rhythmbox. This was trivial, I just copied the Music folder from my old machine to my new via an external USB hard drive and let Rhythmbox on the new machine search through the folder at first run. Then I wanted to listen to the radio and tried the radio tab in the sidepanel in Rhythmbox, but all the stations I had added to my old installation was no where to be found. So I did a little digging around the internet to come up with a solution.

Rhythmboxradio.png
Figure 1: Rhythmbox db

It turns out that the Rhythmbox radio stations are stored in the same database file that the whole music library database is stored in. Unfortunately, I could not just copy the database file, since the links in the file are hard links and the user names (and home folder names) are different on the two machines. Changing all the song entries would have been tedious, but I found another way.

What I did was open the file ~/.local/share/rhythmbox/rhythmdb.xml in gedit. (Open a terminal and write gedit ~/.local/share/rhythmbox/rhythmdb.xml and press return.) Then I searched for "iradio" by clicking on the magnifying glass and scrolled down until I found the radio stations I had added. I then selected everything from <entry type="iradio"… until entry> after the last of my added radio streams and copied it (press ctrl-c). Next, I opened a new file in gedit and pasted my text (ctrl-v) and saved the new file to a USB thumbdrive. On the other machine, I inserted the thumb drive, opened my saved file in gedit (right-click the file name in Nautilus and select "Open with" and "Text editor") and copied everything in the file (press cttrl-a and ctrl-c). Then I opened the ~.local/share/rhythmbox/rhythmdb.xml file in gedit (open a terminal and type gedit ~/.local/share/rhythmbox/rhythmdb.xml and press return), searched for "iradio", scrolled down to the last radio station, set the marker after the last "/entry>", hit return, pasted my radio station entries (ctrl-v), checked that there were no extra empty lines before or after my radio entries and then I saved the file. When I opened up Rhythmbox, my radio stations were there and streaming radio was working fine.

How to switch between programs on different workspaces in Ubuntu (with Unity)

One of the things I always customise when using the LXDE desktop environment is to get alt-tab to not only change programs on one desktop/work space, but on all of them. On Unity I was looking for a way to do the same and discovered that I don’t need to change anything, there is aleady a built-in keyboard shortcut: ctrl-alt-tab. Although slightly more akward than just alt-tab, it works.

Things to do to get the most out of Debian Wheezy

I have recently installed Debian Wheezy with LXDE on my netbook. As anticipated, there were a number of things that needed to be done to get it to work as I like. Debian is a bit more work than Ubuntu, but also slightly lighter on resources, and I enjoy learning how to do this stuff. Having used some time to find out how to do things, I thought I might make a list to remember it all and share some Debian info with the interwebs.

(There are two ways of getting root, which you need to install software. Either you have no root account and you use «sudo» in an ordinary terminal, or you have a root account and do not use «sudo», but in stead use the root terminal. If you do the latter, you have to subtract «sudo» from all terminal commands mentioned here to get them to work.)

Adding software sources:

Debian’s package installer APT uses the file /etc/apt/sources.list to determine where to get its software from. By adding new lines to this file, new software repositories can be added. I like to add the following to my software sources:

  • Adding «contrib» and «non-free» software sources (for non GPL software like drivers, fonts, media codecs): How to and more on software sources at Debian sources.list
  • To get newer versions of software in Debian repos, add Debian Backports
  • To get newest Mozilla software, add Ubuntuzilla

Software from the Debian repos:

  • MSttcorefonts (TimesNewRoman, Aerial and so forth, «contrib» must be in your sources.list): open a terminal, write «sudo apt-get install msttcorefonts», hit enter and type your password and enter again.
  • How to add drivers for the Asus EeePC 1015PEM

Software installations from backports (to get newer versions):

To install programs from backports, open a terminal and write «sudo apt-get -t wheezy-backports install <Program name>». These are the programs I like to install from backports:

  • libreoffice, the free and open source office suite (if it is already installed, you must first deinstall the old version by opening a terminal and writing «sudo apt-get autoremove libreoffice», and then install the newer version from backports.)
  • gpodder, a podcatcher
  • vlc, a video/audio player that plays most formats
  • liferea, a RSS and Atom feedreader, to avoid having to visit lots of site to see new content
  • fbreader, an ebook reader that reads most DRM-free formats
  • gimp, the GNU Image Manipulation Program, great for editing photos or images
  • rhythmbox, an audio player and music organiser with live radio streams

Newest release of FireFox and Thunderbird (And Seamonkey if you like):

Debian Wheezy’s Icedove (Thunderbird) package doesn’t properly display my calendar and tasks with the matchning Iceowl-extension (Lightning), and the Debian Mozilla group’s slightly newer versions don’t work either, so I had to look elsewhere. The Ubuntuzilla project keeps up with Mozilla’s newest builds and the repos work on APT-based distros like Mint, Ubuntu and Debian.

  • To install FireFox: «sudo apt-get install firefox-mozilla-build» (the Ubuntuzilla sources must be in your sources.list.)
  • To install Thunderbird: «sudo apt-get install thunderbird-mozilla-build»(the Ubuntuzilla sources must be in your sources.list.)

Other software installations:

Some software is not available through the above mentioned repos, and must be installed from other sources. Here is a list of a few of those that I like, and how/where to get them:

  • LibreOffice dictionaries: LibreOffice Extensions
  • BitTorrent Sync user package, a brilliant way to sync files between computers: BTSync User
  • Skype, the instant messanger, VOIP and video call program: Installing Skype on Debian (As Skype comes as a 32 bit «multiarch», you need to read the section for amd64 on this page to get it to install properly on a 64-bit Debian install)
  • Flashplayer, to be able to play some contents online: Debian Wiki

LXDE:

Adding radio streams’ URLs:

Unfortunately, my favorite radio streams are not available by default in Rhythmbox, so I have to add them manually. (Find your European favorites on listenlive.eu.):

Other stuff:

  • to browse the Debian repos, check out Packages for Debian Wheezy

How to add drivers for the Asus EeePC 1015PEM in Debian Wheezy

I used some time to find out how to add wireless support and the use of the function keys on the Asus EeePC 1015PEM after installing Debian «Wheezy» 7.2 with LXDE. I thought others might be having the same issues, so I wrote this post. (And to remember how, if I ever need to do this again.) You have to be connected to the internet via ethernet to install the software that solves these issues.

Wireless network

To get the wireless working, I had to install a driver called brcm80211. This is how:

  1. If you haven’t already done it, add the non-free package sources to your sources.list file. Write sudo leafpad etc/apt/sorces-list in the terminal, then press enter and write your password, then add «contrib non-free» after the line saying deb http://http.debian.net/debian wheezy main so it reads deb http://http.debian.net/debian/ wheezy main contrib non-free and save.)
  2. Then write sudo apt-get update in the terminal and hit enter. This updates the package index from the sources in the sources.list file.
  3. Then write sudo apt-get install firmware-brcm80211 and hit enter to install the driver.
  4. Then write sudo modprobe -r brcmsmac and hit enter. This will remove the driver from the Linux kernel if it is already installed.
  5. Write sudo modprobe brcmsmac and hit enter. This will add the driver module to the Linux kernel.

Brightness keys, hibernate key and wireless on/off key

To get the brightness keys, the on/off wireless network key and the hibernate key do what you would expect, you have to install a package called eeepc-acpi-scripts. And of course, you have to use Fn tgether with the key. The volume keys still don’t work after this package is installed. This is how:

  1. Open a terminal and write sudo apt-get install eeepc-acpi-scripts and hit enter and write in your password. When/if apt prompts you, press y and enter to finish the install.

My sources for these solutions:

This is where I found these solutions originally, in case you want to know more:

Fix Alt Tab in Lubuntu

I usually keep one or a couple of similar programs running at each desktop. On the Mac, I use 9 Spaces that I alt-tab or ctrl-arrowkey to and from, but when using 4 desktops in LXDE on my netbook, alt-tabbing doesn't show me all my programs, but only the programs running on the current desktop. Of course, I could alt-scroll to the right desktop and then alt-tab if there are more than one program running there, but it seems a bit too complicated.

While trying out some distros that had openbox in virtualbox, I discovered that there is a way of alt-tabbing across all desktops. This method will work in any Linux distro that uses the LXDE desktop environment and/or the openbox window manager, if the version of openbox is 3.4 or higher. (Lubuntu, LXLE, Debian LXDE, Mint LXDE, Semplice, #!…)

  1. Open ~/.config/openbox/lubuntu-rc.xml (Either use PcManFM, rightclick and choose "show hidden" when in your home folder, then double click the .config folder, double click the openbox folder, then double click lubuntu-rc.xml or open a terminal and write leafpad ~/.config/openbox/lubuntu-rc.xml and press enter.) In other distros this file might be called lxde-rc.xml or just rc.xml.
  2. Scroll down to the "keybindings for window switching" section and find "keybind key="A-Tab”
  3. Change the text so it looks like this:
<keybind key="A-Tab">
<action name="NextWindow">
<allDesktops>yes</allDesktops>
</action>
</keybind>
<keybind key="A-S-Tab">
<action name="PreviousWindow">
<allDesktops>yes</allDesktops>
</action>
</keybind>
  1. Save.
  2. Open a terminal and type “openbox -reconfigure and hit enter. Hopefully, you will now have a working alt-tab between all desktops. (Thank you Peppa, for the tip!)

If it doesn't work or if you get an error message when trying to use OpenBox configuration manager, it might be because you didn't remember to delete the backslash (/) after "action name="NextWindow”, so that the later "/action" breaks the syntax of the XML file.

Update February 2021: Since this is a problem with the OpenBox configuration and not the desktop environment on top of OpenBox, the problem was still in Lubuntu after the switch to LXQt. I reported a feature request to be able to alt-tab between all desktop, and the Lubuntu team implemented my fix in the next release, Lubunut 20.04. Since then, there has been no need for this fix.

Why i switched to Ubuntu from Lubuntu on my netbook

When I got my netbook in january, I backed up the Windows 7 starter restore partition before installing Lubuntu. I had been playing with Ubuntu, Lubuntu, Bohdi, Xubuntu and other Linux distros in virtual machines on my Mac for a while and I had been thinking that it would be practical to have a smaller, more portable computer. So I watched some sites where people advertise used stuff for sale and got myself an Asus EeePC 1015PEM cheaply.

Ubuntu seemed to be the best distro for a Linux newbie like me, with lots of online documentation, lots of available software that is easily installed and a big community of users and developers, but the Unity desktop environment that comes with stock Ubuntu was a bit too slow on my netbook. I looked into Xubuntu, but I didn’t really like it that much and it wasn’t really that much faster than Ubuntu, so I went a step further in lightness to Lubuntu. I found it user-friendly and fast. The look is slightly Windows 95ish, but it is tweakable and generally quite pixel efficient, wich is important on a netbook. So I tweaked away the bottom panel and changed some font sizes and was generally happy with it.

However, I have allways liked Unity. The integrated menu and window title bar saves some vertical pixels and the content of my programs get more space. It makes a lot of sense, specially on smaller screens. The dock on the left side also saves some vertical pixels compared to a panel or dock at the bottom of the screen. I am also a fan of the dash. Using the Windows Super key to get to the dash and just starting typing whatever you are searching for is very efficient. I am looking forward to seeing what types of «lenses» for the dash will be available in the near future.

Some time ago I read on OMGUbuntu (or was it Phoronix) about how much faster Unity was in Ubuntu 13.04 Developer Beta than in previous versions and how stable the developer beta was. I tried the beta, and it was actually stable enough for day to day work and much faster than 12.04 and 12.10 on my netbook and on par with Lubuntu 12.04.2. I went back to Lubuntu because in the developer beta of Ubuntu 13.04, I had trouble setting up external monitors properly without mirroring the internal monitor and limiting my resolution options because of it. I need to be able to connect to projectors sometimes when I am substituting as a teacher, for showing a video or presentation, even if I usually don’t have log on credentials to the school computers. And using beta software is not that smart, since things can stop working with the next update.

But using the faster Unity desktop environment of the developer beta of 13.04 was enticing. When Lubuntu 13.04 came out, I upgraded, but the speed wasn’t much faster in 13.04 than in 12.04.2. (12.10 was troublesome for me, so I went back to 12.04.2.) Lubuntu 13.04 wasn’t as much faster compared to previous Lubuntu versions as Ubuntu 13.04 was compared with 12.04. Some weeks ago, I tried the final version of Ubuntu 13.04 on the Live CD and tried out the screen settings panel and discovered that it no longer limited my choices when it came to mirrored or unmirrored screens and that it gave me independent resolution settings for each screen, just as in Lubuntu.

After half a year of Lubuntu on my netbook, suddenly my reasons for choosing Lubuntu over Ubuntu had disappeared. Ubuntu 13.04 is just as fast on my netbook and Unity has matured and become faster and more good-looking than in 12.04 and 12.10. And the screen settings panel has become much more useable for me.

I have also switched back to Firefox from Midori. Midori had a tendency to crash all the time and whenever I turned off my computer without first quitting Midoring, it said that it had crashed last time it ran and asked me wether or not I wanted to restore my tabs. Annoying stuff. Firefox might be slightly slower, but not having to deal with bugginess is better than speed. I might swith back to Midori if a later version is more stable.

2 Responses to "Why I switched to Ubuntu from Lubuntu on my netbook"

  1. vayne says: 05.07.2013, kl. 00:16 hello what are the specs of your netbook i have a netbook sony vaio with ubuntu 10.04 (its the only that dont cause trouble) i test lubuntu to but i thinks it has battery problems so i install 10.04. i have a 1gb ram do you think is a good idea to change? thanks
  2. Reply Einar Mostad says: 08.07.2013, kl. 17:08 Hi Vayne! My netbook is an Asus EeePC 1015PEM with a dual core Atom at 1,5 GHz and 2 GB RAM. Lubuntu ran fine on it and earlier versions of Ubuntu were slow, but in 13.04 the difference in speed between Ubuntu and Lubuntu more or less disappeared, so I chose Ubuntu, since I like the Unity desktop environment. 1 GB RAM is not much, so a more lightweight linux distribution, like Lubuntu, is probably faster on your machine. (I would max my RAM to whatever the machine can take. It is usually quite easy and cheap these days, and then you will get a bit more speed.) I have heard lots of good things about Peppermint OS, which is based on Lubuntu, so maybe that is worth a try. Another option if you want a modern looking desktop that is lightweight is to try Bohdi Linux, which is based of Ubuntu, but uses the Enlightenment desktop. I’m very tempted to switch to it, but the setup panel for screens keep me away for now. Anyway, you are probably better off with a newer version than 10.04. I would try 12.04 which is a long time support realease (LTS) or 13.04, which seems faster, but might be more unstable, to keep up with security updates and to get access to newer versions of software. Might be smart to look for any issues concerning your specific machine model and any version of (L)Ubuntu you are thinking of installing on Ask Ubuntu to see if others are experiencing problems before installing it. If you want to try Bohdi or Peppermint OS, then those are based on Ubuntu, so they probably have the same issues as the (L)Ubuntu version they are based on.

How to sync podcasts between a Mac and Linux computer

I have been looking for a good way to sync podcasts between my Macbook Pro and Asus EeePC running Lubuntu. On the Mac, I have been using iTunes and for a while I just synced the \~/music/iTunes/iTunes Music/Podcasts folder from my Mac to my netbook with BitTorrent Sync. Then I only had to download the podcasts once on my Mac, and all podcasts would be synced to the netbook. The main problem with this apporach was that there was no way of seeing wich podcasts I had allready heard/seen without either remembering its file name or opening it to check if I had allready heard/seen it. There was also no nice GUI to see the metadata for the podcasts on my netbook without opening the files in a media player.

I stumbled across gPodder, an easy to use open source podcatcher for Linux, Windows and Mac. gPodder is a program that only does podcatching, but it does it really well.  It doesn't play video or sound by itself, but the user can choose any desired program to do that. There is a sync service built into the program, but I am not a fan of trusting third party servers in «the cloud», so I am not using that.

gPodder stores all its settings and all downloaded podcasts in a folder called gPodder in your user directory. The formats of the files in the folder are the same no matter which operating system you are running. This means that to keep the same settings and the same downloaded content across machines, you could just sync the gPodder folder with BitTorrent Sync from one machine to the other. The smart thing about this is that it doesn't matter if I am at my Mac or my netbook, I can now download podcasts on wichever machine and they will be available on the other machine as well.

With the same settings, syncing from one machine to the other, you are not able to choose different programs on each machine for playing your podcasts, and even if you choose the same program on the Mac and Linux machine, you will get into trouble, since they are not stored at the same place. What you need to do is set gPodder to use the «Default program» for both audio and video in the «General» tab in the «Settings» panel and change that program to whatever you like on each machine. On the Mac, mp3 files defaults to open in iTunes if you haven't changed this setting, and this is not ideal, since iTunes will, by default, add any files to its library, thus storing the same file twice on the machine.

I am using VLC as the default program for most video and sound files on both my Mac and EeePC. To set wich programs act as default on a Mac, choose a file of the desired format in the Finder, press command-I (or choose «Get info» from the «File» menu) and choose the desired program in the pull down menu on the lower left. Then click «Change all…» to make this change universal for all files of this type. On Lubuntu, just select «Default programs» from «System settings» in the Lubuntu menu and change to your desired programs. On Ubuntu, choose «System settings» from the dash or dock, then choose the «Details» settings panel and the «Default programs» tab from the menu on the left and set music and video to whatever you prefer.

How to sync files between computers securely and fast

Behold, the end of the time of the sneakernet has come! For a long time, I have wanted to sync some files back and forth between my various computers. So far, I have been using AFP over TCP/IP, FTP or sneakernet with USB dongles to transfer files between machines. The downside to this way of syncing files is that I have to manually copy any file I have changed from one machine to the other. It is easy to get conused about wich machine ha the newest version of a file. A disadvantage of using AFP over TCP/IP is that I have to have file sharing (or netatalk on linux) enabled all the time on one or more machines, wich might be a bad idea since it is probably not that hard to crack the password and get full access to my files. Or I have to turn it on and off every time I am tranferring some files back and forth.

The other option, so far, has been using one of the many cloud services out there. The problem with cloud services is that they are slow, since they have to transfer all your files from machine A to a server on the internet (or «the cloud») before machine B can download the files from that server. Even with a fast internet connection at both ends, this is much slower than just transferring the files manually over a local area network (LAN) from one machine to the other. It might also be slower than sneakernet.

The other problem with cloud services is privacy. DropBox was recently hacked and since it encrypts every dropbox folder of every dropbox client with the same encryption key, all data uploaded to DropBox was suddenly public information. Even if the companies behind your cloud service might have better security in place, you have no garantee that the data you upload to their servers will not be sold to marketing companies. You better read those terms of service… How much do you really trust Apple, Microsoft, Google, Dropbox or Cannonical?

The brilliant solution to the syncing problem is Bittorrent Sync. It is a new syncing service using peer-to-peer connections with the bittorrent protocol. If you are syncing two machines on the same local area network, these two machines will connect to each other and sync the data between folders on the two machines. This is much faster than any cloud service, since it doesn't have to upload any data to any server on the internet before downloading from the same server.

If the machines syncing folders are situated in different locations, the connection is made over the internet from the first machine to the second machine directly. Since no server is involved this is also faster than the cloud services.

If more than two machines are syncing a folder, the bittorrent protocol will make sure that data gets conveyed as fast as possible from the machines that have got the data to the other ones syncing the same folder, with different mchines contributing different parts of the folder, just as when you download files with a normal bittorrent client program.

Since all connections are made between the computers syncing the folder and no server in «the cloud» is involved, there are no third parties that will have a copy of the data transmitted. The connections between machines are encrypted, wich means that the data is not easy to sniff out either. Every folder you sync gets a random generated «secret», a key that you have to input at all the other machines syncing the same folder. By inserting the secret, the other machine gets to know wich machine(s) to connect to and wich folder to sync.

With some cloud services you have to put the files you want to sync in a special folder, but with Bittorrent sync, you can sync any folder on one machine with any folder on another machine. So, if you for instance want to keep your LibreOffice settings synced between a couple of Macs, you could sync the LibreOffice folder inside Application Support folder in your Libraries folder. Or you could update programs only on one machine and sync the program folder to all the other machines to avoid having to download the same programs more than once from the internet.

Another advantage of Bittorrent Sync is that there are no limitations on the amount of data you can sync, since there are no servers in «the cloud» that could limit your capacity. There are no extra fees for transferring more data than a certain amount and no need to buy extra space on cloud servers. However, If you want to, you may limit the upload and download bandwith BitTorrent Sync is allowd to use.

There is also a possibility to sync only one way. A scenario where this might be usefull is if you want to share some photos with some friends, but don't want to let them add their own files to the folder to be synced back. There is also a possibility to make a one-time «secret» that will let a person sync a folder only within 24 hours of the generation of the secret. These secrets might be one-way (read only) or full access.

At this point, Bittorrent Sync is only available for Mac OS X, Windows and Linux, but Bittorrent labs are working on making clients for mobile phones and tablets as well. The Linux version is managed through a webbrowser in stead of the program having its own GUI. Check out this blog post for the lastest Ubuntu and Debian user packages. Many thanks to tuxpoldo for making the packages!

How to get the Ubuntu software Centre in Lubuntu

The Lubuntu software centre in Lubuntu 13.04 Beta is not yet populated. In other versions of Lubuntu, the software centre works fine, but there are more programs available in the Ubuntu software centre than in the Lubuntu software centre, so you might want to add the Ubuntu software centre anyway.

To add the Ubuntu software centre, open a terminal (Lubuntu menu \> Accessories \> LXTerminal) and type sudo apt-get install software-center. Make sure that you are spelling software-centre in the American way in stead of the British spelling (software-center, not software-centre). Type your password when prompted and press the return key. Then type y and press the return key when it asks wether on not you would like to continue. And wait untill the process is finished and you get a normal prompt. Then close the terminal window and if you want to check out the Ubuntu software centre, select it from Lubuntu menu \> System tools \> Ubuntu software center.

How to get rid of tap to click in Lubuntu, LXLE, MintPPC,

Debian LXDE etc

Tap to click is usually on by default, but I know that I am not the only one that disables it on all my computers to avoid clicking all over the place. In most desktop environments (Unity, MATE, Gnome, KDE..), the Mouse and trackpad system settings panel lets you turn off tap to click, but in LXDE, there is no such option in the Keyboard and Mouse settings.

However, there is a method that should work in LXDE on most distros that use it (Lubuntu, LXLE, Debian with LXDE, MintPPC etc) Unfortunately, this only works if your trackpad uses the synaptics drivers. This is how you do it: Open the LXDE menu > Preferences > Customize default applications for LXSession. Choose the Autostart tab. Choose config-only from the drop-down menu where it says "Disable autostarted applications?". Write "@synclient MaxTapTime=0" in the text field next to the "Add" button and hit the button. You will now see "@synclient MaxTapTime=0/”/ in the bottom of the list of"Manual autostarted applications”. Log out and log in. Now tap to click should be disabled.

Lubuntu 12.04 on an iBook Clamshell 300 MHz

Update 2022: Neither Ubuntu nor Debian support the 32bit PowerPC architecture any longer (PPC). Most of the information in this blog post is therefore only of historical interest.

I recently installed Lubuntu 12.04 on my iBook. Lubuntu is running slightly faster than Mac OS X 10.4.11 «Tiger» on the same machine, but slower than Mac OS 9.2.2. This is the Clamshell revision B with a 6 GB 4200 rpm hard drive, 300 MHz G3 processor and I’ve maxed the RAM to 576 MB.

Why Linux on an old PowerPC Mac?

Even if Mac OS 9.2.2 runs very well with 576 MB RAM on the iBook and AirPort works fine (but not with WPA and WPA 2 networks), the problem with using an old OS is that there are no current internet browsers, there is no up-to-date JAVA and Flash and there are no security updates (wich isn’t really that important on such a small and long dead platform anyway). OS 9 is very pixel efficient on the 800 x 600 screen and I like the good old familiar GUI, but there is absolutely no future in it and going to the internet bank or watching a youtube video is impossible. As I recently got my father’s Quadra 700, I am able to use all of my legacy System 7 – 9 software on that machine, so I don’t really need OS 9 for legacy software support. (Most of it is from my old Performa 450 and thus 68k or «fat banary» programs, so they will work just as well on a 68040 Quadra as on a G3 iBook.) The Clasilla browser is the only more or less up-to-date browser that is still maintained, but the browsing experience is far from FireFox on a modern OS.

Mac OS X 10.4.11 «Tiger» is capable of running on the iBook, but it is much slower than OS 9. Mac OS X 10.3.9 «Panther» is even slower in my experience. (Tiger is oficially not supported on machines without FireWire and is delivered on DVD, but it is still installable if you hack the installer to not refuse to install on your machine, start from a volum with Tiger allready installed (since starting from USB is only possible on PowerPC Macs with Mac OS X 10.4.7 or newer) and then install from an external HD via USB 1.1 with an external power source. It is not easy, but it is possible.)

Tiger is less pixel efficient and more cluncky on the small 800 x 600 screen and suffers from the same problem as OS 9 with no security updates and no up-to-date Flash or Java. TenFourFox is a port of FireFox that is up-to-date and it works well, but since Tiger is slow on my iBook and there is no Java or Flash, it is still not the best experience on the web. TenFourFox is also not very pixel efficient on the small 800 x 600 screen, even if it much better than many other browsers.

One of the advantages of Linux on the PowerPC platform is that there is a community of people maintaning, porting and building both OSes and programs for the PowerPC platform, wich means that up-to-date software is available for old PowerPC Macs and IBM Power machines. Open Source software available as source code also means that you could port any program to any platform (or OS) if you know how to compile software from source. I don’t, but if you really want a program that is unavailable, it might be something worth learning how to do.

Linux comes in lots of distributions or distros. At http://mac.linux.be/ there are some information about Linux distros for Macs, including PowerPC Macs. Distrowatch.com has a more comprehensive list of Linux distros. It seems like Ubuntu is the most popular distro and also one of the easier to use and configure for new users (as far as I know). The advantage of using a popular distro is that there are lots of people working on development and killing bugs and getting support is easy via forums or irc chat.

The Ubuntu «family» consists of Ubuntu and distributions based on it, but with different desktop environments and/or bundled software. There are also many other Ubuntu-derived distributions that are not part of the oficial Ubuntu «family». Ubuntu uses a desktop environment called Gnome Unity. It is quite Mac OS X-like, with a dock on the left side and menu on top of the screen, with a Spotlight-like «dash» on top of the dock. Kubuntu uses another desktop environment called KDE that is more highly configurable. Both of them are modern and slick and full of visual GUI goodies like half-transparent menus and such. This also means that they are quite demanding on the hardware and will run quite slow on machines with little RAM or slow processors.

For older machines, Xubuntu and Lubuntu are often recommended. Xubuntu uses that XFCE wich is quite light and fast. The looks are modern and it is highly configurable. Lubuntu is the newest memember of the official Ubuntu family and it is even faster and smaller than Xubuntu. It uses a desktop environment called LXDE wich is made specially for being small, lightweigt, visually appealing and configurable. Lubuntu also includes some preinstalled software that is among the lightest and fastest of its type, but with the options to install any program usable in Ubuntu. I like the graphical user interface in Lubuntu. It is very uncluttered and has an elegance of simplicity. It could also be configured to be very pixel efficient for my 800 x 600 screen. It seems very intuitive to me and after having used it for a while in a virtual machine on my MacBook Pro, I felt ready to install it on my iBook.

Installing Lubuntu on a PowerPC Mac

There are at least three ways of installing Lubuntu for PowerPC: The Live CD, the alternate installer and the minimal install (mini.iso). For most people, downloading the Live CD for PowerPC Macs (https://help.ubuntu.com/community/Lubuntu/GetLubuntu), burning it to a CD, starting your Mac from the CD by holding down the C key at startup and then answering the relevant questions in the installer will work fine. And it looks good too.

It might be a good idea to read the PowerPC Known Issues (https://wiki.ubuntu.com/PowerPCKnownIssues) and the PowerPC FAQ (https://wiki.ubuntu.com/PowerPCFAQ) before installing to avoid suprises. The page (https://help.ubuntu.com/community/OSXApplicationsEquivalents) comparing OS X programs to open source alternatives might also be interesting.

Installing, even if you can’t


Unfortunately, the CD-ROM drive in my iBook is starting to fail, wich means I got lots of I/O errors and bad sector alerts when trying to install from the Live CD. I also tried the alternate install, wich does the same as the Live CD, but with a text based installer, and it left me with the same problems. I also tried using a USB stick, but since booting from USB does not work unless Mac OS X 10.4.7 or newer is installed on a PowerPC Mac, I was unable to boot from USB. Not even an external Superdrive would work. I then tried the mini.iso (available here: https://help.ubuntu.com/community/Installation/MinimalCD), and since the mini.iso is so much smaller (27 MB compared to 700 for the live CD), there are less sectors for the CD-ROM to read, and I had more success.

This page (https://help.ubuntu.com/community/Lubuntu/Documentation/MinimalInstall) describes how to install from the mini.iso. The method described on this page is slightly out of date, but just boot from the CD (after having burned the mini.iso to it) by holding down C and just wait. The installer will start by itself, but if it doesn’t, type install. Answer the questions and if you do not know the answer, just go with the default. At one point, the installer doesn’t show any progress bar and seems to have freezed up, but just wait and after a quite long time, a progress bar will appear and it will continue to show you that it is still alive.

Fixing a few problems after install

There are a few things in Lubuntu 12.04 that does not work properly out of the box on the PowerPC platform. First, there is a crossed out Chromium symbol in the application launcher in the lower left side of the screen. This is because Chromium, wich is the standard browser in Lubuntu, is not available for PowerPC. In stead FireFox is installed by default. (Personally, I would switch to FireFox anyway, since I don’t trust the company that earns its money by tracking peoples browsing to not track my browsing if I am using their browser. I also like the user interface in FireFox better than Chromium.) To get rid of the symbol and replacing it with FireFox, direct your cursor to the panel on the bottom of the screen (the grey line) and press the F12 key. (F12 is the same as right-click in Lubuntu and F11 equals middle-click.) This will bring up a context menu. Choose «Panel settings». In the following window, choose the tab «panel programs». Then choose the second line on the left «Program launcher» and then press the «Edit» button. Choose the strange symbol and press the «Delete» button. Then press the little triangle on the left of «Internet» and choose «FireFox» and press the «Add» button. Now you have a FireFox launch button on your bottom panel.

The other thing that does not work, at least not for me, is AbiWord. It either crashes when I start it, or after a few seconds of running. I uninstalled it with the Lubuntu Software Centre and installed LibreOffice Writer in stead. It might not be as lightweight, but it doesn’t crash. (Of course, you might want to keep AbiWord, hoping it will be less buggy after the next update, and just add LibreOffice Writer to have something that works untill it gets fixed.) To get rid of AbiWord and install LibreOffice Writer, choose Lubuntu Software Centre from the System Tools submenu of the menu on the left of the bottom panel (click the Lubuntu logo and then move to System Tools and Lubuntu Software Centre.) Click «Installed software» and click on «AbiWord» and press the «Remove from the system» button. Write your password and it will be removed. It might still be visible in the «Installed software» even after you get a message that it is uninstalled. This bug should be fixed in 12.10. Then choose «Get software» and «Office» and scroll down to LibreOffice Writer. If you want the rest of LibreOffice as well, you could choose «LibreOffice» in stead, this will install all the LibreOffice components available for PowerPC. Click «Add to app basket» and then click «App basket» on the top right and then «Install packages» and write your password and wait. If you want to open LibreOffice Writer it will now be in the «Office» submenu of the Lubuntu menu on the lower left of the screen. If you want to add it to your program launcher next to FireFox, just direct your cursor to the bottom panel, press F12 and repeat what you did to add FireFox, but go to Office and add LibreOffice Writer in stead.

You might also want to install some Extensions to FireFox. My favourites are AdBlock Plus, Facebook disconnect, Google disconnect and Twitter disconnect. These extensions will make your surfing ad-free and you will avoid Facebook, Google and Twitter collecting data about wich sites you surf. I don’t really want these companies to sell information about my websurfing to anybody. Think about enabling ads for those sites you really want to support, since ads are what makes many sites economically viable.

© Einar Mostad 2010 - 2026. Content is licensed under the terms of CC BY SA except code which is GNU GPL v3 or later.
Made with GNU Emacs, Org-Static-Blog, and Codeberg Pages on GNU/Linux.