|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | | -# omarchy:summary=Set up Omarchy for the current user (~/.config, ~/.local, etc.) |
4 | | -# omarchy:group=setup |
5 | | -# omarchy:examples=omarchy setup user | omarchy setup user --force |
| 3 | +# omarchy:summary=Finalize Omarchy user setup (runtime tweaks /etc/skel can't do) |
| 4 | +# omarchy:group=finalize |
| 5 | +# omarchy:examples=omarchy finalize user | omarchy finalize user --force |
6 | 6 |
|
7 | 7 | set -euo pipefail |
8 | 8 |
|
9 | 9 | usage() { |
10 | 10 | cat <<USAGE |
11 | | -Usage: omarchy setup user [--force] [--first-install] |
| 11 | +Usage: omarchy finalize user [--force] [--first-install] |
12 | 12 |
|
13 | | -Idempotent user-level setup: copies/symlinks defaults from \$OMARCHY_PATH |
14 | | -into \$HOME, installs user services/session defaults, refreshes app launchers, |
15 | | -and applies user-scoped hardware/session tweaks. |
| 13 | +Runs the per-user setup steps that /etc/skel can't seed: |
| 14 | +dev-aware skill symlinks, xdg-user-dirs + gtk bookmarks (need \$HOME), |
| 15 | +vconsole→hypr keyboard sync, default browser/mailto, and install/user/all.sh. |
| 16 | +
|
| 17 | +For shipped configs see /etc/skel (new users) and omarchy-reinstall-configs |
| 18 | +(existing users explicitly resyncing). |
16 | 19 |
|
17 | 20 | --first-install is used by the ISO in the target chroot. It marks shipped |
18 | | -migrations complete for the freshly-created user and enables the first graphical |
19 | | -login one-shot. |
| 21 | +migrations complete for the freshly-created user. |
20 | 22 |
|
21 | | -Idempotency marker: ~/.local/state/omarchy/setup-user.done |
| 23 | +Idempotency marker: ~/.local/state/omarchy/finalize-user.done |
22 | 24 | USAGE |
23 | 25 | } |
24 | 26 |
|
25 | 27 | if (( EUID == 0 )); then |
26 | | - echo "Error: run omarchy-setup-user as the user being configured, not as root." >&2 |
| 28 | + echo "Error: run omarchy-finalize-user as the user being configured, not as root." >&2 |
27 | 29 | exit 1 |
28 | 30 | fi |
29 | 31 |
|
@@ -53,11 +55,11 @@ while (($#)); do |
53 | 55 | done |
54 | 56 |
|
55 | 57 | state_dir="$HOME/.local/state/omarchy" |
56 | | -marker="$state_dir/setup-user.done" |
| 58 | +marker="$state_dir/finalize-user.done" |
57 | 59 | mkdir -p "$state_dir" |
58 | 60 |
|
59 | 61 | if [[ -f $marker && $force -eq 0 ]]; then |
60 | | - echo "User setup already complete (rerun with --force to refresh)." |
| 62 | + echo "User finalization already complete (rerun with --force to refresh)." |
61 | 63 | exit 0 |
62 | 64 | fi |
63 | 65 |
|
|
79 | 81 | } |
80 | 82 | fi |
81 | 83 |
|
82 | | -omarchy_user_systemctl_enable() { |
83 | | - local unit="$1" unit_path target |
84 | | - local -a targets=() |
85 | | - |
86 | | - if systemctl --user enable "$unit" >/dev/null 2>&1; then |
87 | | - return 0 |
88 | | - fi |
89 | | - |
90 | | - # ISO chroot setup has no running user systemd manager. Enabling a user unit |
91 | | - # is just creating the [Install] WantedBy symlinks, so do that directly. |
92 | | - unit_path="$HOME/.config/systemd/user/$unit" |
93 | | - if [[ -f $unit_path ]]; then |
94 | | - mapfile -t targets < <(awk -F= ' |
95 | | - /^\[Install\]/ { in_install=1; next } |
96 | | - /^\[/ { in_install=0 } |
97 | | - in_install && $1 == "WantedBy" { |
98 | | - n=split($2, values, /[[:space:]]+/) |
99 | | - for (i = 1; i <= n; i++) if (values[i] != "") print values[i] |
100 | | - } |
101 | | - ' "$unit_path") |
102 | | - fi |
103 | | - ((${#targets[@]})) || targets=(default.target) |
104 | | - |
105 | | - for target in "${targets[@]}"; do |
106 | | - mkdir -p "$HOME/.config/systemd/user/$target.wants" |
107 | | - ln -sfn "../$unit" "$HOME/.config/systemd/user/$target.wants/$unit" |
108 | | - done |
109 | | -} |
110 | | -export -f omarchy_user_systemctl_enable |
111 | | - |
112 | | -mkdir -p ~/.config |
113 | | -cp -R "$OMARCHY_PATH/config/." ~/.config/ |
114 | | -cp "$OMARCHY_PATH/default/bashrc" ~/.bashrc |
115 | | -echo '[[ -f ~/.bashrc ]] && . ~/.bashrc' > ~/.bash_profile |
116 | | - |
| 84 | +# Dev-aware skill symlinks. Cannot live in /etc/skel because OMARCHY_PATH may |
| 85 | +# point at a dev checkout (omarchy dev link) where the target differs. |
117 | 86 | mkdir -p ~/.agents/skills ~/.claude/skills ~/.codex/skills ~/.pi/agent/skills |
118 | 87 | ln -sfn "$OMARCHY_PATH/default/omarchy-skill" ~/.agents/skills/omarchy |
119 | 88 | ln -sfn "$OMARCHY_PATH/default/omarchy-skill" ~/.claude/skills/omarchy |
120 | 89 | ln -sfn "$OMARCHY_PATH/default/omarchy-skill" ~/.codex/skills/omarchy |
121 | 90 | ln -sfn "$OMARCHY_PATH/default/omarchy-skill" ~/.pi/agent/skills/omarchy |
122 | 91 |
|
123 | | -mkdir -p ~/.local/state/omarchy/toggles/hypr |
124 | | -cp "$OMARCHY_PATH/default/hypr/toggles/flags.lua" ~/.local/state/omarchy/toggles/hypr/ |
125 | | - |
126 | | -mkdir -p "$HOME/.local/share/nautilus-python/extensions" |
127 | | -cp "$OMARCHY_PATH/default/nautilus-python/extensions/localsend.py" \ |
128 | | - "$HOME/.local/share/nautilus-python/extensions/" |
129 | | -cp "$OMARCHY_PATH/default/nautilus-python/extensions/transcode.py" \ |
130 | | - "$HOME/.local/share/nautilus-python/extensions/" |
131 | | - |
132 | | -mkdir -p ~/.config/omarchy/branding |
133 | | -cp "$OMARCHY_PATH/icon.txt" ~/.config/omarchy/branding/about.txt |
134 | | -cp "$OMARCHY_PATH/logo.txt" ~/.config/omarchy/branding/screensaver.txt |
135 | | - |
136 | 92 | mkdir -p ~/Downloads ~/Pictures ~/Videos ~/.config/gtk-3.0 |
137 | 93 | xdg-user-dirs-update --set TEMPLATES "$HOME" |
138 | 94 | xdg-user-dirs-update --set PUBLICSHARE "$HOME" |
@@ -174,4 +130,4 @@ if (( first_install )); then |
174 | 130 | fi |
175 | 131 |
|
176 | 132 | touch "$marker" |
177 | | -echo "User setup complete." |
| 133 | +echo "User finalization complete." |
0 commit comments