From 671dd4698cf9bb2ae6c099ea91f19de209e5ffe4 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 17 May 2026 21:55:53 +0200 Subject: [PATCH] Kill this weird pattern --- AGENTS.md | 4 ++++ bin/omarchy-dev-benchmark-theme-switcher | 3 --- bin/omarchy-install-browser | 2 +- bin/omarchy-menu-images | 2 -- bin/omarchy-menu-tmux-keybindings | 2 +- bin/omarchy-restart-shell | 2 +- bin/omarchy-shell-ipc | 3 +-- bin/omarchy-shell-ipc-fast | 1 - bin/omarchy-snapshot | 1 - bin/omarchy-style-bar-position | 2 +- bin/omarchy-theme-bg-switcher | 1 - bin/omarchy-theme-list-with-previews | 2 -- bin/omarchy-theme-switcher | 1 - 13 files changed, 9 insertions(+), 17 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d94f09e8..df4e70fd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -58,6 +58,10 @@ Example: # omarchy:aliases=omarchy screenshot ``` +# Runtime Environment + +- Commands in `bin/` should rely on `$OMARCHY_PATH` from the uwsm environment; do not set or default `OMARCHY_PATH` manually there. + # Install Scripts Install entry points (`install.sh`, `boot.sh`) use `#!/bin/bash`. Many scripts under `install/` are sourced via `run_logged` and intentionally do not have shebangs. diff --git a/bin/omarchy-dev-benchmark-theme-switcher b/bin/omarchy-dev-benchmark-theme-switcher index 97460bed..9bbc0424 100755 --- a/bin/omarchy-dev-benchmark-theme-switcher +++ b/bin/omarchy-dev-benchmark-theme-switcher @@ -8,7 +8,6 @@ set -euo pipefail OMARCHY_BIN_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) -OMARCHY_PATH=${OMARCHY_PATH:-$(cd -- "$OMARCHY_BIN_DIR/.." && pwd)} REPEAT=5 KEEP_CACHE=false @@ -124,14 +123,12 @@ chmod +x "$stub_bin/omarchy-menu-images" benchmark_env=( env - "OMARCHY_PATH=$OMARCHY_PATH" "XDG_CACHE_HOME=$benchmark_cache" "PATH=$stub_bin:$OMARCHY_BIN_DIR:$PATH" ) thumbnail_env=( env - "OMARCHY_PATH=$OMARCHY_PATH" "XDG_CACHE_HOME=$thumbnail_cache" "PATH=$stub_bin:$OMARCHY_BIN_DIR:$PATH" ) diff --git a/bin/omarchy-install-browser b/bin/omarchy-install-browser index ed067d8d..3359d922 100755 --- a/bin/omarchy-install-browser +++ b/bin/omarchy-install-browser @@ -16,7 +16,7 @@ announce_browser_installed() { copy_chromium_flags() { mkdir -p ~/.config - cp -f "${OMARCHY_PATH:-$HOME/.local/share/omarchy}/config/chromium-flags.conf" "$1" + cp -f "$OMARCHY_PATH/config/chromium-flags.conf" "$1" } setup_firefox_preferences() { diff --git a/bin/omarchy-menu-images b/bin/omarchy-menu-images index 4c109582..1eba5313 100755 --- a/bin/omarchy-menu-images +++ b/bin/omarchy-menu-images @@ -3,8 +3,6 @@ # omarchy:summary=Open a generic image selector menu # omarchy:args=[--selected ] [--print-name] [--show-labels] [--filterable] [--lazy-thumbnails] [--preload] [--cache-only] ... -OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy} - selected_image="" print_name=false show_labels=false diff --git a/bin/omarchy-menu-tmux-keybindings b/bin/omarchy-menu-tmux-keybindings index fb6af7d6..489b58b5 100755 --- a/bin/omarchy-menu-tmux-keybindings +++ b/bin/omarchy-menu-tmux-keybindings @@ -24,7 +24,7 @@ while (($#)); do done if [[ ! -f $config_file ]]; then - default_config="${OMARCHY_PATH:-$HOME/.local/share/omarchy}/config/tmux/tmux.conf" + default_config="$OMARCHY_PATH/config/tmux/tmux.conf" if [[ -f $default_config ]]; then config_file="$default_config" diff --git a/bin/omarchy-restart-shell b/bin/omarchy-restart-shell index 2b61c193..c6b38985 100755 --- a/bin/omarchy-restart-shell +++ b/bin/omarchy-restart-shell @@ -6,4 +6,4 @@ CONFIG_DIR="$OMARCHY_PATH/default/quickshell/omarchy-shell" quickshell kill -p "$CONFIG_DIR" >/dev/null 2>&1 || true -setsid uwsm-app -- env OMARCHY_PATH="$OMARCHY_PATH" quickshell -p "$CONFIG_DIR" >/dev/null 2>&1 & +setsid uwsm-app -- quickshell -p "$CONFIG_DIR" >/dev/null 2>&1 & diff --git a/bin/omarchy-shell-ipc b/bin/omarchy-shell-ipc index 0de6af33..1a634c37 100755 --- a/bin/omarchy-shell-ipc +++ b/bin/omarchy-shell-ipc @@ -31,7 +31,6 @@ if [[ $1 == "--if-running" ]]; then shift fi -OMARCHY_PATH="${OMARCHY_PATH:-$HOME/.local/share/omarchy}" SHELL_DIR="$OMARCHY_PATH/default/quickshell/omarchy-shell" shell_running() { @@ -50,7 +49,7 @@ else # 9<&- so the spawned shell does not inherit (and keep) the lock fd; the # spawned process is long-lived and would otherwise hold the lock for the # remainder of the session, deadlocking every subsequent helper invocation. - setsid uwsm-app -- env OMARCHY_PATH="$OMARCHY_PATH" quickshell -p "$SHELL_DIR" >/dev/null 2>&1 9<&- & + setsid uwsm-app -- quickshell -p "$SHELL_DIR" >/dev/null 2>&1 9<&- & for _ in 1 2 3 4 5 6 7 8 9 10; do sleep 0.2 shell_running && break diff --git a/bin/omarchy-shell-ipc-fast b/bin/omarchy-shell-ipc-fast index d2f017a7..7a37a707 100755 --- a/bin/omarchy-shell-ipc-fast +++ b/bin/omarchy-shell-ipc-fast @@ -3,7 +3,6 @@ # omarchy:summary=Send a fire-and-forget IPC call to a running omarchy-shell # omarchy:hidden=true -OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy} SHELL_QML="$OMARCHY_PATH/default/quickshell/omarchy-shell/shell.qml" if (( $# < 2 )); then diff --git a/bin/omarchy-snapshot b/bin/omarchy-snapshot index ce1bc9ca..27c1b7de 100755 --- a/bin/omarchy-snapshot +++ b/bin/omarchy-snapshot @@ -7,7 +7,6 @@ set -e COMMAND="$1" -OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy} if [[ -z $COMMAND ]]; then echo "Usage: omarchy-snapshot " >&2 diff --git a/bin/omarchy-style-bar-position b/bin/omarchy-style-bar-position index 2ef44675..a6fe127d 100755 --- a/bin/omarchy-style-bar-position +++ b/bin/omarchy-style-bar-position @@ -7,7 +7,7 @@ set -e CONFIG_FILE="$HOME/.config/omarchy/shell.json" -DEFAULTS_FILE="${OMARCHY_PATH:-$HOME/.local/share/omarchy}/default/quickshell/omarchy-shell/shell-defaults.json" +DEFAULTS_FILE="$OMARCHY_PATH/default/quickshell/omarchy-shell/shell-defaults.json" position=$1 if [[ ! $position =~ ^(top|bottom|left|right)$ ]]; then diff --git a/bin/omarchy-theme-bg-switcher b/bin/omarchy-theme-bg-switcher index d3846027..93a47a12 100755 --- a/bin/omarchy-theme-bg-switcher +++ b/bin/omarchy-theme-bg-switcher @@ -5,7 +5,6 @@ # omarchy:name=bg-switcher # omarchy:aliases=omarchy background -OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy} theme_name=$(cat "$HOME/.config/omarchy/current/theme.name" 2>/dev/null) current_background=$(readlink -f "$HOME/.config/omarchy/current/background" 2>/dev/null) diff --git a/bin/omarchy-theme-list-with-previews b/bin/omarchy-theme-list-with-previews index 71d60b22..6197c3fd 100755 --- a/bin/omarchy-theme-list-with-previews +++ b/bin/omarchy-theme-list-with-previews @@ -3,8 +3,6 @@ # omarchy:summary=List themes with preview image paths (tab-separated: name\tslug\tpreview) # omarchy:hidden=true -OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy} - omarchy-theme-list 2>/dev/null | while IFS= read -r name; do [[ -n $name ]] || continue slug=$(printf '%s' "$name" | tr '[:upper:]' '[:lower:]' | tr ' ' '-') diff --git a/bin/omarchy-theme-switcher b/bin/omarchy-theme-switcher index e891f4c6..6e20acbe 100755 --- a/bin/omarchy-theme-switcher +++ b/bin/omarchy-theme-switcher @@ -2,7 +2,6 @@ # omarchy:summary=Open the Omarchy theme switcher -OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy} preload=false if [[ $1 == "--preload" ]]; then