Category Archives: Tips and Tricks

Bootstrapping chezmoi_modify_manager before chezmoi apply

If you use chezmoi_modify_manager together with chezmoi, there is one annoying bootstrap problem: chezmoi_modify_manager is needed while chezmoi apply computes file contents but the usual .chezmoiscripts/run_before_* hooks run too late to install it for the first apply I wanted a solution that was: automatic shell-based version-pinned rerun only when the installer script changes This post […]

SWTBot Tests Failing on GitHub Actions macOS Because of “Welcome to Mac” (Setup Assistant Analytics)

My SWTBot UI tests recently started failing on GitHub Actions macOS runners. The application under test is an Eclipse-based application, so at first I expected the failure to be caused by some SWTBot timing issue, focus issue, or maybe a regression in my own code. However, the screenshot captured by the failed test showed something […]

Running Homebrew Commands with sudo on Linux and macOS

Sometimes a command installed with Homebrew needs to be executed as root. A good example is nethogs, which needs elevated privileges to inspect network traffic. The problem is that this often fails:

even though this works:

The reason is that sudo usually runs with a different, restricted PATH. Your normal shell can find […]

Bootstrapping chezmoi from HTTPS to SSH After First Apply

When I bootstrap a new machine with chezmoi, I usually start by cloning my dotfiles repo from GitHub over HTTPS:

That works well for the very first setup, because my SSH keys are not installed yet. After the first chezmoi apply, though, my SSH keys are finally in place, and I want the dotfiles […]

Running Waybar with a Custom Configuration Directory in Sway

When setting up Sway as your Wayland compositor, you might want to organize your Waybar configuration in a non-standard location — for example, keeping a dedicated ~/.config/waybar/sway/ directory to separate your Sway-specific bar configuration from others. This seemingly simple task comes with a couple of subtle pitfalls worth knowing about. The ~ Expansion Problem The […]

Stop VS Code’s Java LSP from Rewriting Your Eclipse .classpath with m2e-apt Entries

How to prevent JDT LS (via m2e) from adding generated-sources APT folders and org.eclipse.jdt.apt prefs to an Eclipse+Maven project in VS Code. If you open a Maven Java project in Visual Studio Code that also contains Eclipse project metadata (.project, .classpath, .settings/…), you might notice that VS Code’s Java tooling (JDT Language Server) “helpfully” edits […]

LaTeX listings: Eclipse colors

This is the style I use to highlight my Java code in LaTeX documents with the Listings package, with Eclipse colors:

And this is an example of a document, where I show the same listing both with black and white colors an Eclipse colors:

Here’s the result:

Browse and run your Sway keybindings with Rofi

Remembering every Sway shortcut is tough. I wrote a small script that parses your Sway config, displays all bindsym shortcuts in a clean, searchable list via Rofi, and executes the command associated with whichever one you select. It’s fast, keyboard-friendly, and great for discovery: “What did I bind to Mod + Shift + P again?” Now you […]

Modern Java in LaTeX listings (Java 17)

If you use the LaTeX listings package to typeset Java, you’ve probably noticed that modern Java has moved faster than the package itself. Records, var, and text blocks may not highlight correctly out of the box. The good news: the listings package is extensible so that you can teach it “modern Java” with a tiny […]

Getting Your MacBook Air Webcam Working on Linux

If you’ve installed Linux on your MacBook Air, you’ve probably discovered that while most hardware works out of the box, the built-in FaceTime HD camera is notably absent from your video applications. Don’t worry—you’re not alone, and there’s a solution that doesn’t involve external USB webcams or complicated workarounds. The issue stems from Apple’s use […]

Maintaining KDE dotfiles with Chezmoi Modify Manager

I have already blogged about managing KDE dotfiles with chezmoi and chezmoi_modify_manager. But what about maintaining them? For example, one of the KDE configuration files changes, and you want to update the version managed by chezmoi. Here’s an example where the Kate configuration file changed on the system and chezmoi detects that:

You can […]

Configure Tmux to support true color and italics in Alacritty and Neovim

I know there are many blog posts about configuring Tmux to support true color and italics in Alacritty, but many of them miss a crucial detail that breaks Neovim’s diagnostic undercurl (wavy underlines). Many of them suggest overriding the TERM variable in Alacritty to xterm-256color, which causes Neovim to lose the ability to display undercurl […]

Speed Up Your Linux System with Zram

Zram, https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html, is a Linux kernel module that creates a compressed block device in RAM. This device can be used as swap space or a general-purpose RAM disk. By compressing data in memory, zram allows your system to store more data in RAM, reducing the need to swap to slower disk storage and improving overall […]

Better diffs in Lazygit with delta

If you use Lazygit as your terminal Git UI, you know how convenient it is for staging, committing, and managing branches. I use it in Neovim (LazyVim already configures it). Integrating a custom pager (Lazygit Custom Pagers Documentation) can dramatically improve how diffs are displayed. In this blog post, I’ll document how to use delta: […]

Computing the total test execution time of Maven Surefire

When working with Maven projects, the Surefire plugin is commonly used to execute tests, but it lacks a built-in feature to display the total execution time across all test suites. This can be particularly important when monitoring performance trends in larger projects with many test classes. Maven’s Surefire plugin reports execution time for individual test […]

Using Neovim in Gitpod

I’m going to show you how to use Neovim on Gitpod. This can be useful for checking and testing your Neovim configuration. The example can be found here: https://github.com/LorenzoBettini/neovim-gitpod-example. I’m using a LazyVim distribution as a demonstration. The Gitpod custom Dockerfile, “.gitpod.Dockerfile”, must be tweaked to install Neovim and its requirements (especially for using Lazyvim):

[…]

Installing Ansible and Molecule in Arch Linux

Using “pip” is the supported installation method for Ansible and Molecule. Let’s install Python libraries and applications (in this case, Ansible and Molecule) in a Python virtual environment. (This post is similar to the one about Ubuntu.) First, install the required packages, including the Python virtual environment package:

Create a virtual environment somewhere (in […]

Using Flash remote in Neovim

The “remote” feature of flash.nvim is handy: it acts in “operator pending mode” to perform operations and then return to the original position. It took me some time to understand what it was doing, so I’m writing about it. I’m using it in the LazyVim distribution, which enables “flash” by default (and also “which-key”, which […]