Files
Panama/config/dot/hypr/env.lua
T
Gabriel Brown d96863b687 Convert British spellings to American across the repo
colour -> color, behaviour -> behavior, centre -> center, favourite ->
favorite, and about twenty other pairs, applied consistently across
comments, docs, error/UI copy, and a handful of QML identifiers that
used the British spelling as their actual name: SystemSettings'
serialiseValue/serialiseTable/normaliseGradient, Displays'
normaliseModes, Wallpaper's normalisePolicy, SettingsBackup's
serialiseHomeState, DateTime's ntpSynchronised property, Clipboard's
_normalise helper, and ShortcutCapture's cancelled signal (with its
onCancelled handler in ShortcutsPage.qml). Every call site and the two
tests that assert on the literal source text (settings-ownership and
settings-backup-live contracts) were updated in lockstep.

Left untouched: config/dot/espanso/match/packages/misspell-en/ is a
vendored third-party autocorrect dictionary -- its entries are typo
corrections, not our prose, and rewriting them would fight the
package's own purpose (and any future re-sync from upstream).

The already-American `favorites` property (Home page pinned
accessories) was never actually misspelled -- only nearby comments and
error strings said "favourites" -- so no data migration was needed
there.

Claude-Session: https://claude.ai/code/session_01E6TJUAh41HaP25MVHWkhRZ
2026-08-19 08:07:55 -04:00

87 lines
4.6 KiB
Lua

-- ─────────────────────────────────────────────────────────────────────────────
-- Environment
--
-- hl.env() sets variables before the display server initializes, which is what
-- makes it valid for AQ_* and cursor variables.
--
-- NOTE for uwsm sessions: if you log in via "Hyprland (uwsm-managed)", uwsm
-- prefers these live in ~/.config/uwsm/env and ~/.config/uwsm/env-hyprland
-- instead. They still work here; see the session notes in autostart.lua.
-- ─────────────────────────────────────────────────────────────────────────────
local prefs = require("prefs")
-- ── GPU selection ───────────────────────────────────────────────────────────
-- This box has a discrete RX 7800 XT (0000:03:00.0) and a Granite Ridge iGPU
-- (0000:12:00.0). The monitor hangs off the dGPU, so the dGPU must render.
--
-- /dev/dri/cardN numbering is not stable across boots, and the by-path names
-- contain colons -- which are AQ_DRM_DEVICES' own separator, so they cannot be
-- used directly. Panama installs a udev rule creating colon-free stable
-- symlinks (/dev/dri/amd-dgpu, /dev/dri/amd-igpu); see
-- config/copy/etc/udev/rules.d/99-panama-gpu.rules
--
-- First entry is the primary renderer. The iGPU stays in the list so anything
-- plugged into its outputs still lights up.
--
-- Guarded on the symlink actually existing: this config is shared across
-- machines, and pointing AQ_DRM_DEVICES at a device that isn't there stops
-- Hyprland from starting at all. If the udev rule hasn't been installed (or
-- this is a different box), we say nothing and let aquamarine choose.
local function exists(path)
local f = io.open(path, "r")
if f then f:close() return true end
return false
end
if exists("/dev/dri/amd-dgpu") then
local devices = "/dev/dri/amd-dgpu"
if exists("/dev/dri/amd-igpu") then
devices = devices .. ":/dev/dri/amd-igpu"
end
hl.env("AQ_DRM_DEVICES", devices)
end
-- ── Cursor ──────────────────────────────────────────────────────────────────
-- Theme carried over from GNOME.
--
-- Deliberately no HYPRCURSOR_THEME: oreo_blue_cursors is a plain XCursor theme
-- (it has cursors/ + index.theme and no hyprcursors/ directory or manifest.hl),
-- so setting it would point hyprcursor at nothing. Hyprland falls back to the
-- XCursor path, which is what we want.
hl.env("XCURSOR_THEME", prefs.get("cursorTheme", "oreo_blue_cursors"))
hl.env("XCURSOR_SIZE", "24")
-- ── Toolkits ────────────────────────────────────────────────────────────────
-- Wayland first, X11 only as a fallback for apps that genuinely need it.
hl.env("QT_QPA_PLATFORM", "wayland;xcb")
-- "gtk3" makes Qt derive its palette from the live GTK3 theme via the qgtk3
-- platform plugin, so Qt apps match adw-gtk3-dark exactly rather than
-- approximating it -- and it gives them GTK file/font/color dialogs. It also
-- covers Qt5 and Qt6 with one value.
--
-- Note this is a single value, NOT a fallback list: Qt splits on ":" and uses
-- only the first token, so the commonly-copied "qt5ct:qt6ct" silently means
-- just "qt5ct".
hl.env("QT_QPA_PLATFORMTHEME", "gtk3")
hl.env("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1")
hl.env("QT_AUTO_SCREEN_SCALE_FACTOR", "1")
hl.env("GDK_BACKEND", "wayland,x11")
hl.env("SDL_VIDEODRIVER", "wayland")
hl.env("CLUTTER_BACKEND", "wayland")
hl.env("MOZ_ENABLE_WAYLAND", "1")
-- Electron apps (Slack, Obsidian, Claude, Codex, BlueBubbles, Podman Desktop)
-- pick Wayland from this rather than needing per-app flags.
hl.env("ELECTRON_OZONE_PLATFORM_HINT", "auto")
-- ── Desktop identity ────────────────────────────────────────────────────────
-- Portals and some GNOME apps key off these. uwsm sets them itself, so these
-- are only load-bearing for the plain (non-uwsm) session.
hl.env("XDG_CURRENT_DESKTOP", "Hyprland")
hl.env("XDG_SESSION_TYPE", "wayland")
hl.env("XDG_SESSION_DESKTOP", "Hyprland")
return true