A good weekend

A fulfilling weekend: gaming, quality time with partners, and engaging tech projects. Good stuff.

Installing Harper on Kubuntu: The Right Way. Maybe.

Remember when I said installing Rust was overkill for a spell checker I use once a month? Well… I lied. Snap packages are for cowards, right? And I also learned a whole bunch of Curl and Rust along the way. Weekend geek project: unlocked.

With recent CSS changes to the blog seemingly holding for now, I’m going for another big one: switching from Hugo 0.91 to 0.158 (the latest available on Micro.blog). Works ok on my test blog… what can go wrong? I’m just waiting for the backups to complete 😬

Started fixing up my CSS.

Earlier, I said I need to move over all my custom-made CSS changes to custom.css from the Tiny Theme’s original CSS file. That’s what I just did. Now let’s see what broke in the proccess.

Using Denote for Email: A manual workflow

Denote wasn’t built for email, but since I’m tired of Apple Mail for long emails, a quick manual copy-paste solves the problem. It’s not a sophisticated workflow, but it works.

Journelly and OSM for Emacs are good together

Fixed OSM in my Emacs after I tracked down the issue to be with visual-line-mode conflict. Been wanting to fix this for a while. While at it, wrote a quick function to pull LATITUDE/LONGITUDE from Journelly’s property drawers and feed them to osm-goto. Good stuff.

In other geek news, I found out about What the Cable a week ago through Mastodon:

GitHub - darrylmorley/whatcable: macOS menu bar app that tells you, in plain English, what each USB-C cable plugged into your Mac can actually do github.com

It’s a nice little app for macOS that gives you a bunch of information regarding what your USB cables are connected to, what kind of cable, and if they’re optimized. nicely made.

I wrote about Harper before, but I wanted to expand now that I have it working on Kubuntu with a couple of more options.

Harper is good in two scenarios for me: first, when I want something quick and I don’t feel like starting a browser with Grammarly in it, and second, when I write a personal email and the idea of my words going to some AI grammar bot somewhere makes my skin crawl. Otherwise, for my blog (which is public anyway) and work email (I don’t care about those) Grammarly is definitely better.

The issue with Linux is that the makers of Harper geared it toward macOS (Homebrew) and Arch Linux, among other things. It was made for programmers by programmers, and these guys don’t bother with Ubuntu-like distros. Fair, but up until recently it meant I had to jump through hoops.

The quick and easy route in Ubuntu distros (which is what Kubuntu is) is to use snap. I know, I know. I didn’t want to either, but since the Harper makers don’t bother with flatpak, the other option was to install a Rust environment, which is a big overkill just for an app inside Emacs I use like once a month or so or less. I don’t like snap and I don’t use it, but I made an exception here. (Edit: I actually decided to go ahead with Rust and Cargo, and explained what I did)

Now, that snap “shortcut” is by a guy who works with Ubuntu (I think) and maintains his own package for it, so it’s on the edge channel (not stable) and seems to be a lot behind (version .49 to be exact, and Harper is currently 2.2.1!) so if Harper is your choice of grammar check, and you use it daily, I’d suggest against what I’m doing below. I’d install as needed in that case, Rust and all.

With that disclaimer, let’s move on: sudo snap install harper --edge.

Now in Emacs, in Linux, we want to tell it where harper is:

    (when (eq system-type 'gnu/linux)
               (add-to-list 'exec-path "/snap/harper/current/bin"))

When tells it to add the snap path only when running Linux, since I have the same config for both macOS and Linux.

That’s all… After that, I’ve added some of Harper’s flags, or linters. Here’s the whole code as I have it in my emacs org settings:

          (with-eval-after-load 'eglot
            (add-to-list 'eglot-server-programs
                         '(org-mode . ("harper-ls" "--stdio"))))
    
           (setq-default eglot-workspace-configuration
                      '(:harper-ls (:dialect "American" :linters (:LongSentences :json-false :AvoidCurses :json-false))))
    
    ;; Besides choosing American as the language, I also want to ignore long sentences (the main issue is that it hides other errors nested in those) and I also want harper not to tell me when it thinks something is offensive. The full list of these options is in https://writewithharper.com/docs/rules. It needs to be nested inside the :linters option.
    
           (when (eq system-type 'gnu/linux)
             (add-to-list 'exec-path "/snap/harper/current/bin"))
    
    ;; on a mac, Harper is installed via Homebrew - on Kubuntu, the best option is snap - the harper team does not do a package (flatpak) unfortunately, and I don't want to install Rust just for harper. So.. meh.  I did sudo 'snap install harper --edge' for this.

Lazy Chopped Salad

Some folks asked that I share my recipes more often… well, here’s another attempt. I don’t know if it justifies a new category. Let me know if you find this useful? Thanks 😊

It’s becoming one of those days where I discover even more new people with blogs. Some people out there are fun, some serious, others are grumpy… At this rate I won’t stop writing emails all morning. And you know what, I think I’d like that.