Files
dotfiles/hosts/sctfw004/bin/qutebrowser-arch
T
connor e6644d0616 Rebuild dotfiles as one branch with per-host layers
Replaces the previous repo, which had split into two histories that never
met (mainframe on a dead GitLab remote, the laptops on Gitea) with 146
dirty files across three machines and the NAS never enrolled at all.

Branch-per-machine is gone. One main, with host differences expressed as
small files under hosts/<hostname>/ rather than as branches, so there is
nothing to merge. The reconciled zsh layer reduces 15-33 line forks to
1-7 effective lines per host; distro differences (oh-my-zsh prefix,
syntax-highlighting path, fd vs fdfind) are probed in common/ instead.

Fresh history: the old one carried six plaintext credentials, 45 MB of
mail caches, browser caches and vendored binaries. 5,096 tracked files
and 144 MB become 462 files and 2.6 MB. The .gitignore is now an
allowlist, which is what keeps that true.

Root cause of the rot: ~/.local/bin was a symlink to scripts/ with GOPATH
inside it, so every go install wrote into version control (2.2 GB on the
work laptop). PATH now points at the repo instead of the reverse.

Also: Hyprland replaces sway and is sourced in two halves so $browser is
defined before use; singleton automations carry ConditionHost= alongside
host-layer-only placement; ddns moves from cron to a guarded timer;
package manifests and pkg-snapshot/pkg-restore replace the X11-era
install_scripts/; networkmanager-dmenu added to system76 (the binding
always existed, the package never did).
2026-09-14 14:24:37 -04:00

31 lines
1.4 KiB
Bash
Executable File

#!/bin/sh
# Absolute path is required: the shared $HOME puts the host's pip shim at
# ~/.local/bin/qutebrowser, which shadows the container's and runs an incompatible python.
# Both builds hash to the same IPC socket name, so a running host instance would
# silently swallow this launch and open a tab there instead.
if pgrep -f '\.local/apps/qutebrowser/\.venv/bin/python3 -m qutebrowser' >/dev/null 2>&1; then
echo "qutebrowser-arch: the host (pip) qutebrowser is running and shares the IPC socket." >&2
echo "Quit it first, or this launch will just open a tab in that instance." >&2
exit 1
fi
# QB_MODE works around eglCreateImage returning EGL_NOT_INITIALIZED under native
# Wayland, which loses the GL context and leaves pages rendering as background only.
PRE=""
EXTRA=""
case "${QB_MODE:-xwayland}" in
xwayland)
# XWayland cannot do fractional scaling, so Hyprland upscales a 1x buffer and
# blurs it. Needs `xwayland { force_zero_scaling = true }` in hyprland.conf to help.
SCALE=$(hyprctl monitors -j 2>/dev/null | grep -m1 '"scale"' | tr -dc '0-9.' )
PRE="QT_QPA_PLATFORM=xcb QT_SCALE_FACTOR=${SCALE:-1}"
;;
software) EXTRA="--qt-flag disable-gpu" ;;
wayland) ;;
*) echo "qutebrowser-arch: unknown QB_MODE '$QB_MODE' (wayland|xwayland|software)" >&2; exit 1 ;;
esac
exec "$HOME/.local/bin/distrobox" enter --no-tty --name arch -- sh -c \
"$PRE exec /usr/bin/qutebrowser $EXTRA \"\$@\"" -- "$@"