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-*.
This commit is contained in:
Ryan Hughes
2026-06-04 18:34:35 -04:00
parent dfc8065915
commit a2feffa803
4 changed files with 219 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
#!/bin/bash
# omarchy:summary=Restore Omarchy to the package install (undo omarchy-dev-link)
# omarchy:group=dev
set -euo pipefail
if [[ ${1:-} == "-h" || ${1:-} == "--help" ]]; then
cat <<USAGE
Usage: omarchy dev unlink
Removes /etc/omarchy.conf so OMARCHY_PATH falls back to /usr/share/omarchy
(the package install). Updates Hyprland/systemd session env and restarts
omarchy-shell so live state matches.
USAGE
exit 0
fi
if [[ ! -f /etc/omarchy.conf ]]; then
echo "Not currently linked. OMARCHY_PATH already resolves to /usr/share/omarchy."
exit 0
fi
sudo rm -f /etc/omarchy.conf
echo "Removed /etc/omarchy.conf"
# Update the current shell.
export OMARCHY_PATH=/usr/share/omarchy
# Drop the prepended checkout bin/ from PATH if present.
PATH=$(printf '%s' "$PATH" | tr ':' '\n' | grep -vFx "$(dirname "$0")" | paste -sd:)
export PATH
# Update the live Hyprland session.
if command -v hyprctl >/dev/null 2>&1 && hyprctl version &>/dev/null; then
hyprctl setenv OMARCHY_PATH /usr/share/omarchy >/dev/null
hyprctl setenv PATH "$PATH" >/dev/null
echo " Updated Hyprland session env."
systemctl --user import-environment OMARCHY_PATH PATH 2>/dev/null || true
echo " Updated systemd --user env."
if pgrep -x quickshell >/dev/null 2>&1; then
omarchy-restart-shell
echo " Restarted omarchy-shell."
fi
hyprctl reload >/dev/null
echo " Reloaded Hyprland config."
fi
echo
echo "Done. Existing shells still have the old OMARCHY_PATH until restarted."