Trim over-commented Chunk 3+/4 work
A pass over the install scripts, dev-tools commands, and Hyprland Lua files that I had stuffed with explain-everything preambles. Most of those rationales (which files ship where, why hyprctl setenv doesn't suffice, etc.) belong in commit messages or PR descriptions, not in code people have to read forever. Kept the few comments that document genuinely non-obvious behaviour: the keybind-env reason for hl.env in envs.lua, why the runtime PAM seds stay scripted in increase-lockout-limit, the chroot/--now distinction in chroot.sh, and the dev-pkg-test split-install reason.
This commit is contained in:
@@ -7,11 +7,10 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Sudo wipes HYPRLAND_INSTANCE_SIGNATURE, so the live-session refresh below
|
||||
# can't reach hyprctl. Run as user; we sudo internally for the conf write.
|
||||
if [[ $EUID -eq 0 ]]; then
|
||||
echo "Error: run omarchy-dev-link as your user, not under sudo. The script" >&2
|
||||
echo " will prompt for sudo when it needs to write /etc/omarchy.conf." >&2
|
||||
echo " (Invoking under sudo wipes HYPRLAND_INSTANCE_SIGNATURE so the" >&2
|
||||
echo " live-session refresh can't reach hyprctl.)" >&2
|
||||
echo "Error: run omarchy-dev-link as your user, not under sudo." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -37,7 +36,6 @@ target=$(realpath -e "$1" 2>/dev/null) || {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Sanity: looks like an omarchy-installer checkout?
|
||||
for required in bin default shell; do
|
||||
if [[ ! -d "$target/$required" ]]; then
|
||||
echo "Warning: $target/$required not found — does this look like an omarchy-installer checkout?" >&2
|
||||
@@ -47,12 +45,9 @@ done
|
||||
echo "Pointing Omarchy at $target"
|
||||
printf 'export OMARCHY_PATH="%s"\n' "$target" | sudo tee /etc/omarchy.conf >/dev/null
|
||||
|
||||
# Update the current shell so the rest of this script and anything spawned
|
||||
# from it see the new path.
|
||||
export OMARCHY_PATH="$target"
|
||||
export PATH="$target/bin:$PATH"
|
||||
|
||||
# Update the live Hyprland session if one is running.
|
||||
if command -v hyprctl >/dev/null 2>&1 && hyprctl version &>/dev/null; then
|
||||
hyprctl setenv OMARCHY_PATH "$target" >/dev/null
|
||||
hyprctl setenv PATH "$PATH" >/dev/null
|
||||
|
||||
@@ -48,7 +48,7 @@ trap 'rm -rf "$build_dir"' EXIT
|
||||
|
||||
cp -a "$PKGBUILD_DIR/." "$build_dir/"
|
||||
|
||||
# Mark the build with a versioned dev pkgver so pacman -Q makes the source obvious.
|
||||
# pkgver=dev.<sha>[.dirty] so pacman -Q makes the source obvious.
|
||||
short_sha=$(git -C "$CHECKOUT" rev-parse --short HEAD 2>/dev/null || echo "local")
|
||||
dirty=""
|
||||
if [[ -d "$CHECKOUT/.git" ]] && [[ -n "$(git -C "$CHECKOUT" status --porcelain)" ]]; then
|
||||
@@ -65,11 +65,9 @@ echo
|
||||
cd "$build_dir"
|
||||
OMARCHY_SRC="$CHECKOUT" makepkg -s --skipchecksums --noconfirm "${@:3}"
|
||||
|
||||
# Install separately so we can pass --overwrite='*' to pacman. In dev mode
|
||||
# the package commonly conflicts with files left behind by previous
|
||||
# script-installed Omarchy versions (plymouth themes, /etc drop-ins,
|
||||
# sudoers, etc.). makepkg -i forwards a fixed set of flags to pacman and
|
||||
# doesn't expose --overwrite.
|
||||
# Install separately so we can pass --overwrite='*' (makepkg -i can't).
|
||||
# Dev builds frequently conflict with files left behind by previous
|
||||
# script-installed Omarchy versions; the build is the authoritative state.
|
||||
built_pkg=$(ls -t "$build_dir"/*.pkg.tar.* 2>/dev/null | grep -v '\.sig$' | head -1)
|
||||
if [[ -z $built_pkg ]]; then
|
||||
echo "Error: no built package found in $build_dir" >&2
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
# 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
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
if [[ $EUID -eq 0 ]]; then
|
||||
echo "Error: run omarchy-dev-unlink as your user, not under sudo. The script" >&2
|
||||
echo " will prompt for sudo when it needs to remove /etc/omarchy.conf." >&2
|
||||
echo "Error: run omarchy-dev-unlink as your user, not under sudo." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -30,13 +29,11 @@ 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.
|
||||
# Drop the checkout bin/ that dev-link prepended.
|
||||
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
|
||||
|
||||
@@ -7,13 +7,9 @@ set -e
|
||||
|
||||
echo -e "\e[32m\nUpdate system packages\e[0m"
|
||||
|
||||
# Transition --overwrite: the Omarchy 4 package refactor moves files that
|
||||
# previous Omarchy installs wrote as unowned files (via install scripts) into
|
||||
# the omarchy-settings package. Pacman would otherwise refuse to install
|
||||
# omarchy-settings on the first upgrade because the paths "exist in
|
||||
# filesystem". Limited to the exact paths the package now owns; remove the
|
||||
# corresponding --overwrite entry once the transition release is everyone's
|
||||
# baseline.
|
||||
# Transition --overwrite: previous script-installed Omarchy wrote these paths
|
||||
# as unowned files; pacman would refuse the omarchy-settings upgrade on first
|
||||
# encounter. Drop each entry once the transition release is the baseline.
|
||||
sudo pacman -Syyu --noconfirm \
|
||||
--overwrite '/etc/docker/daemon.json' \
|
||||
--overwrite '/etc/gnupg/dirmngr.conf' \
|
||||
|
||||
Reference in New Issue
Block a user