Files
omarchycn/bin/omarchy-dev-status
T
Ryan Hughes a2feffa803 Add omarchy-dev-{link,unlink,status,pkg-test} commands
The four dev-tools commands that complete the developer-ergonomics
story for the package refactor:

- omarchy-dev-link <path>: writes /etc/omarchy.conf so OMARCHY_PATH
  resolves to <path> in all new shells, the Hyprland session env, and
  systemd --user. Updates the live session via hyprctl setenv +
  systemctl --user import-environment, restarts omarchy-shell, and
  reloads Hyprland so the changes are visible immediately. Affects
  every tree resolved via $OMARCHY_PATH: bin/, default/, shell/,
  themes/, applications/, config/.

- omarchy-dev-unlink: removes /etc/omarchy.conf and reverses the live
  session updates back to /usr/share/omarchy.

- omarchy-dev-status: reports current dev-link state (configured path,
  current shell, hyprland session env).

- omarchy-dev-pkg-test [pkg] [checkout]: builds and installs a package
  from the checkout via OMARCHY_SRC + makepkg -si --skipchecksums.
  Used for changes that land at fixed system paths (/etc/, /usr/lib/,
  udev rule bodies, plymouth themes, /etc/skel) that dev-link can't
  shadow. The built package's pkgver is tagged 'dev.<short-sha>[.dirty]'
  so 'pacman -Q' makes its source obvious. Defaults: package
  omarchy-settings, checkout ~/Work/omarchy/omarchy-installer,
  PKGBUILDs read from ~/Work/omarchy/omarchy-pkgs/pkgbuilds/.

All four ship via omarchy-dev-tools (existing PKGBUILD wildcard).
Verified package build picks them up at /usr/bin/omarchy-dev-*.
2026-06-04 18:34:35 -04:00

35 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# omarchy:summary=Show the current Omarchy dev-link state
# omarchy:group=dev
if [[ -f /etc/omarchy.conf ]]; then
# Source in a subshell so we don't mutate the caller's env.
configured=$(
OMARCHY_PATH=
# shellcheck disable=SC1091
. /etc/omarchy.conf
printf '%s' "${OMARCHY_PATH:-<empty>}"
)
echo "dev-link: ACTIVE"
echo " /etc/omarchy.conf -> OMARCHY_PATH=$configured"
else
configured="/usr/share/omarchy (default)"
echo "dev-link: inactive"
fi
echo " current shell: OMARCHY_PATH=${OMARCHY_PATH:-<unset>}"
if [[ -f /etc/omarchy.conf && "${OMARCHY_PATH:-}" != "$configured" ]]; then
echo
echo "Note: this shell predates dev-link. Open a new shell to pick up the change,"
echo "or 'export OMARCHY_PATH=$configured' to update just this shell."
fi
if command -v hyprctl >/dev/null 2>&1 && hyprctl version &>/dev/null; then
hypr_path=$(hyprctl getoption -j env 2>/dev/null | sed -n 's/.*OMARCHY_PATH=\([^"]*\).*/\1/p' | head -1)
if [[ -n "$hypr_path" ]]; then
echo " hyprland session: OMARCHY_PATH=$hypr_path"
fi
fi