OpenRiot v6.1 — The Cleanup

“The difference between a professional and an amateur is that the professional cleans up after themselves.” — Someone who never had to debug a dotfile


Release Overview

OpenRiot v6.1 is a maintenance release. No new features. No flashy screenshots. Just the kind of cleanup that separates software that works from software that works correctly.

We fixed every config file and cache file that was in the wrong place, named wrong, or both. We made WireGuard autostart actually work. We stopped fish from choking on null bytes in its history. And we established a naming convention so this never happens again.

Total changes: path hygiene, autostart logic, and a fish history sanitizer.


🧹 Config & Cache Path Cleanup

The Problem: Over multiple releases, state files accumulated in inconsistent locations with inconsistent naming:

  • ~/.config/openriot/.current-background — dot-file inside a dot-directory
  • ~/.config/openriot/.nightlight — same problem
  • ~/.cache/openriot-crypto.json — polluting ~/.cache/ directly instead of namespaced
  • ~/.cache/openriot-crypto-prev.json — same
  • ~/.cache/openriot-ohlc.json — same
  • ~/.cache/openriot-weather.json — same

The Fix: Every state file now follows the same convention:

  • Config state: ~/.config/openriot/{module}.{ext}
  • Cache data: ~/.cache/openriot/{module}.{ext}
  • No dot-prefix on filenames — the directory is already hidden per XDG spec

Migration: All modules transparently migrate old files on first run. No user action required.

Module Old Path New Path
Backgrounds ~/.config/openriot/.current-background ~/.config/openriot/current-background
Night Light ~/.config/openriot/.nightlight ~/.config/openriot/nightlight.state
WireGuard (new) ~/.config/openriot/wireguard.enabled
Crypto ~/.cache/openriot-crypto.json ~/.cache/openriot/crypto.json
Crypto Prev ~/.cache/openriot-crypto-prev.json ~/.cache/openriot/crypto-prev.json
Crypto OHLC ~/.cache/openriot-ohlc.json ~/.cache/openriot/ohlc.json
Weather ~/.cache/openriot-weather.json ~/.cache/openriot/weather.json

“If your state files look like they were named by a cat walking on a keyboard, you have a problem.”


🔐 WireGuard: Auto-start After Network

The Problem: WireGuard had to be manually started every boot with Super+I or the polybar click. The README even suggested editing /etc/rc.local — a file that doesn’t exist on a default OpenBSD install and requires root.

The Fix: WireGuard now autostarts automatically if it was enabled when last shut down.

How it works:

  • User enables WireGuard via Super+I or Settings menu → ~/.config/openriot/wireguard.enabled is created
  • User disables WireGuard → the file is deleted
  • On i3 startup, --wireguard-autostart checks the file. If present and /etc/wireguard/wg0.conf exists → wg-quick up
  • 3-second delay ensures WiFi/Ethernet is up first

No more manual startup. No more /etc/rc.local hacks.

“The best VPN is the one you don’t have to remember to turn on.”


🐟 Fish History: Null Byte Sanitizer

The Problem: Fish shell would print error: ignoring corrupted history entry around offset N on every new terminal. Null bytes had crept into ~/.local/share/fish/fish_history — likely from a crashed command or bad pipe.

The Fix: Added a null-byte stripper to config/fish/config.fish that runs on every shell startup:

if test -s ~/.local/share/fish/fish_history
    tr -d '\000' < ~/.local/share/fish/fish_history > ~/.local/share/fish/fish_history.tmp
    mv ~/.local/share/fish/fish_history.tmp ~/.local/share/fish/fish_history
end

tr -d '\000' on a 65KB file takes ~1ms. Null bytes have no legitimate place in YAML history. This is harmless insurance.

“Your shell history should not require a hex editor to debug.”


📖 README Updates

  • Version badge updated to 6.1
  • WireGuard section rewritten: removed /etc/rc.local workaround, documented built-in autostart behavior
  • File path references verified against new naming convention

🧾 Files Changed

File Nature of Change
source/backgrounds/backgrounds.go Renamed state file to current-background, added migration
source/nightlight/nightlight.go Renamed state file to nightlight.state, added migration
source/wireguard/wireguard.go Added autostart state file wireguard.enabled, AutoStart() function
source/crypto/crypto.go Moved cache files to ~/.cache/openriot/, added migration
source/weather/weather.go Moved cache file to ~/.cache/openriot/weather.json, added migration
source/commands/commands.go Added --wireguard-autostart, updated --crypto-refresh paths
config/fish/config.fish Added null-byte sanitizer for fish history
config/i3/config Added WireGuard autostart exec line
README.md Version bump, WireGuard autostart docs
docs/v6.1-Release-Notes.md This file

🗣️ Final Words

“v6.0 was about making things beautiful. v6.1 is about making things correct. Both matter.”

This release is dedicated to everyone who ever opened a terminal and saw a cryptic error about corrupted history entries. We fixed it. And we made sure it won’t happen again.

Upgrade with the usual command:

curl -fsSL https://OpenRiot.org/setup.sh | sh

— The OpenRiot Crew

“Clean code is not a luxury. It is a requirement.”