/ de-omarchy / default / bash / env-bootstrap
swadhinbiswas Fix installer: batch repo pkgs + stdin-safe AUR prompts, create /etc/environment.d, retarget all runtime fallbacks to /usr/share/de-omarchy · 8/22/2026
3eba9d4
42 lines · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Single source of truth for OMARCHY_PATH + PATH adjustments. Sourced by:
#   /etc/profile.d/omarchy.sh                 (system login shells)
#   /etc/skel/.bashrc                         (interactive shells)
#   /usr/share/uwsm/env.d/10-omarchy          (Hyprland session via uwsm)
#   /usr/share/de-omarchy/default/bash/envs      (bash rc chain; SSH/non-login)

# /etc/omarchy.conf is written by omarchy-dev-link and reset by
# omarchy-dev-unlink. When absent, force the packaged default instead of
# preserving a stale inherited value.
if [ -f /etc/omarchy.conf ]; then
  . /etc/omarchy.conf
  : "${OMARCHY_PATH:=/usr/share/de-omarchy}"
else
  OMARCHY_PATH=/usr/share/de-omarchy
fi
export OMARCHY_PATH

# Only prepend in dev-link mode. On a production install, the binaries are
# already on PATH as /usr/bin/omarchy-* via the omarchy package — prepending
# /usr/share/de-omarchy/bin would just be noise.
if [ "$OMARCHY_PATH" != /usr/share/de-omarchy ]; then
  case ":$PATH:" in
    *":${OMARCHY_PATH%/}/bin:"*) ;;
    *) PATH="${OMARCHY_PATH%/}/bin${PATH:+:$PATH}" ;;
  esac
fi

# User-level tool paths, appended so system binaries keep precedence. This is
# what lets login shells (ssh, bash -lc) and the uwsm session find mise-managed
# tools without an interactive rc. Keep these directories in sync with the PAM
# PATH line from install/config/ssh-command-path.sh, which covers SSH commands
# that run no shell setup at all.
case ":$PATH:" in
  *":$HOME/.local/share/mise/shims:"*) ;;
  *) PATH="${PATH:+$PATH:}$HOME/.local/share/mise/shims" ;;
esac
case ":$PATH:" in
  *":$HOME/.local/bin:"*) ;;
  *) PATH="${PATH:+$PATH:}$HOME/.local/bin" ;;
esac
export PATH