Daily Notes for 2024-01-14

ยท 870 words ยท 5 minute read

#pdxtst ๐Ÿ”—

Wow, yesterday was nerve-wracking. Listening to the wind howl wasn’t great before we lost power, and it was awful after we did around 2:30 in the afternoon. Plus there are all the things that start making noise once the power is out, like the UPS and smoke detectors. And because of the extreme cold, one of the motorcycle disc locks started going off every ten minutes or so until I went out and got it loose and brought it inside to thaw.

Due to whatever local peculiarities in the grid, we could look out any window and see lights on around us after the sun went down, and when the Portland General map was willing to load we could see the outage reports disappearing all around us until we were part of a little island clustered around the neighborhood park.

Power outages aren’t rare in this neighborhood. I think before this one we’ve never gone more than eight hours or so. This time the lights stayed out until 5:30. It got down to 44 in the house overnight, and would have been worse if not for the gas fireplace holding the line until we went to bed.

Anyhow … no, it wasn’t great, but it was also not life in the RV across the street, or a tent a block away. We could still sleep in a bed, keep the phones charged, or take one of several friends up on an offer to come over if we needed to.

Junction, xdg-open, mutt and HTML mail ๐Ÿ”—

The whole “I want to use a plaintext mail client on a GUI desktop thing” has been messy for a super long time. Excavating my mutt mailcap, I can see a bunch of swings at it going back 15 years. I thiiiink I might have finally figured out a setup that’s still got a few rough edges but seems stable.

I’ve got Junction installed from a flatpak, and I’ve got it set as the default browser (in GNOME that’s Settings -> Default Apps -> Web), and as the default for the HTML file type (xdg-mime default re.sonny.Junction.desktop text/html).

In my ~/.mutt/mailcap I’ve got:

text/html; xdg-open %s &> /dev/null &; nametemplate=%s.html
application/*; xdg-open %s &> /dev/null &;
image/*; xdg-open %s &> /dev/null &;

mutt defaults to the plaintext version of a message when I open it, but I can tap v and select the text/html part to bring up Junction.

I tried living with w3m as my default text-mode browser for reading HTML mail inline, but once I started counting the number of times I went ahead and bailed to a GUI browser I realized it’s not a great experience. So I just let it display the plaintext version first, which is usually more readable than whatever w3m is going to render.

I also tried using Firefox as my default GUI browser for HTML mail, but I use Firefox for personal stuff and Chrome for work stuff, so it’s helpful to open an HTML mail in the browser that’ll have the right cookies.

So the net of it is:

  • Junction can grab links from apps and pop up a selector, so a link from work Slack can open in Chrome and a link from a personal email can open in Firefox.
  • Junction can send HTML mail to a chosen browser.

Making Chrome profiles available from GNOME launcher and Junction ๐Ÿ”—

When launched from Junction or the GNOME launcher Google Chrome will launch with a profile selector, which is fine: I have two profiles, but usually only use the work-related one. So as a matter of curiosity I wanted to see if I could get Junction to offer profiles instead of a generic Chrome icon. You just need to make .desktop files for each profile and tell Chrome the directory to launch from.

Running from Flatpak as I do, I don’t think Chrome’s quite “normal” so I made data directories for each of my profiles and then made a pair of .desktop files. They look like this:

[Desktop Entry]
Version=1.0
Name=Personal Chrome
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Web Browser
# Gnome and KDE 3 uses Comment.
Comment=Access the Internet
Exec= flatpak run com.google.Chrome %U --user-data-dir=/home/mph/.config/google-chrome/pdxmph
StartupNotify=true
Terminal=false
Icon=/home/mph/.local/share/icons/google-chrome.png
Type=Application
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/ftp;x-scheme-handler/http;x-scheme-handler/https;
Actions=new-window;new-private-window;

[Desktop Action new-window]
Name=New Window
Exec= flatpak run com.google.Chrome %U --user-data-dir=/home/mph/.config/google-chrome/pdxmph
[Desktop Action new-private-window]
Name=New Incognito Window
Exec= flatpak run com.google.Chrome %U --user-data-dir=/home/mph/.config/google-chrome/pdxmph

The “Exec” lines are the pertinent ones.

Once set up, and after running update-desktop-database ~/.local/share/applications, Junction will pick them up as a pair of distinct browsers.

It’s a little hacky, and I think if you are running Chrome from outside Flatpak your approach will vary – there may be proper data directories in your .config hierarchy somewhere.

Vampire Survivors ๐Ÿ”—

Still playing. When you get to the late levels (approaching 100) or late into the round (approaching 30 minutes) and your weapons and powerups are maxed, it is almost psychedelic: Just thousands of creatures all running into this whirling, swirling vortex of destruction. The sound of all the weapons and powerups and exploding bad guys reminds me of being in the slots section of a busy casino.