Split user-level setup into bin/omarchy-setup-user

User-level files (~/.config, ~/.local/share, ~/.agents, etc.) shouldn't
be written by install.sh — it runs as root or with system-level sudo,
and in offline (ISO chroot) mode the user doesn't exist yet. Moved into
a per-user idempotent command, called from omarchy-first-run.

Moved into bin/omarchy-setup-user (deleted from install/config/):
- omarchy-ai-skill.sh    AI skill symlinks
- omarchy-toggles.sh     hypr toggle flags
- nautilus-python.sh     nautilus extensions
- branding.sh            ~/.config/omarchy/branding/{about,screensaver}.txt
- user-dirs.sh           xdg-user-dirs-update + gtk bookmarks
- detect-keyboard-layout.sh  layout/variant sed into ~/.config/hypr/input.lua
- toggles.sh             ~/.local/state/omarchy/toggles mkdir
- mimetypes.sh           omarchy-refresh-applications + xdg-mime/xdg-settings

Kept in install/config/ (rely on OMARCHY_USER_NAME / OMARCHY_USER_EMAIL
that only exist during install):
- git.sh        git config --global user.{name,email}
- xcompose.sh   ~/.XCompose with name/email substituted

omarchy-setup-user:
- Refuses to run as root
- Idempotent via ~/.local/state/omarchy/setup-user.done marker
- --force escape hatch for re-running after dev-link or upstream changes
- Defaults OMARCHY_PATH to /usr/share/omarchy so it works outside install

bin/omarchy-first-run now invokes omarchy-setup-user unconditionally
(it self-gates), so first user login picks up the user setup.

install/config/all.sh: dropped the eight deleted entries.

All three packages (omarchy, omarchy-settings, omarchy-installer) still
build clean.
This commit is contained in:
Ryan Hughes
2026-06-04 18:34:35 -04:00
parent c26bce6235
commit f852edfbd6
11 changed files with 102 additions and 58 deletions
-8
View File
@@ -1,5 +1,4 @@
run_logged $OMARCHY_INSTALL/config/theme.sh
run_logged $OMARCHY_INSTALL/config/branding.sh
run_logged $OMARCHY_INSTALL/config/git.sh
run_logged $OMARCHY_INSTALL/config/gpg.sh
run_logged $OMARCHY_INSTALL/config/increase-lockout-limit.sh
@@ -7,21 +6,14 @@ run_logged $OMARCHY_INSTALL/config/lockscreen-pam.sh
run_logged $OMARCHY_INSTALL/config/sleep-lock.sh
run_logged $OMARCHY_INSTALL/config/increase-file-watchers.sh
run_logged $OMARCHY_INSTALL/config/increase-fd-limit.sh
run_logged $OMARCHY_INSTALL/config/detect-keyboard-layout.sh
run_logged $OMARCHY_INSTALL/config/xcompose.sh
run_logged $OMARCHY_INSTALL/config/mise-work.sh
run_logged $OMARCHY_INSTALL/config/fix-powerprofilesctl-shebang.sh
run_logged $OMARCHY_INSTALL/config/docker.sh
run_logged $OMARCHY_INSTALL/config/mimetypes.sh
run_logged $OMARCHY_INSTALL/config/user-dirs.sh
run_logged $OMARCHY_INSTALL/config/toggles.sh
run_logged $OMARCHY_INSTALL/config/nautilus-python.sh
run_logged $OMARCHY_INSTALL/config/localdb.sh
run_logged $OMARCHY_INSTALL/config/fast-shutdown.sh
run_logged $OMARCHY_INSTALL/config/input-group.sh
run_logged $OMARCHY_INSTALL/config/omarchy-ai-skill.sh
run_logged $OMARCHY_INSTALL/config/pi.sh
run_logged $OMARCHY_INSTALL/config/omarchy-toggles.sh
run_logged $OMARCHY_INSTALL/config/powerprofilesctl-rules.sh
run_logged $OMARCHY_INSTALL/config/wifi-powersave-rules.sh
-4
View File
@@ -1,4 +0,0 @@
# Allow the user to change the branding for fastfetch and screensaver
mkdir -p ~/.config/omarchy/branding
cp $OMARCHY_PATH/icon.txt ~/.config/omarchy/branding/about.txt
cp $OMARCHY_PATH/logo.txt ~/.config/omarchy/branding/screensaver.txt
-13
View File
@@ -1,13 +0,0 @@
# Copy over the keyboard layout that's been set in Arch during install to Hyprland
conf="/etc/vconsole.conf"
hyprlua="$HOME/.config/hypr/input.lua"
if [[ -f $conf && -f $hyprlua ]] && grep -q '^XKBLAYOUT=' "$conf"; then
layout=$(grep '^XKBLAYOUT=' "$conf" | cut -d= -f2 | tr -d '"')
sed -i "/^[[:space:]]*kb_options *=/i\ kb_layout = \"$layout\"," "$hyprlua"
fi
if [[ -f $conf && -f $hyprlua ]] && grep -q '^XKBVARIANT=' "$conf"; then
variant=$(grep '^XKBVARIANT=' "$conf" | cut -d= -f2 | tr -d '"')
sed -i "/^[[:space:]]*kb_options *=/i\ kb_variant = \"$variant\"," "$hyprlua"
fi
-5
View File
@@ -1,5 +0,0 @@
omarchy-refresh-applications
xdg-settings set default-web-browser chromium.desktop
# HEY.desktop is generated by install/packaging/webapps.sh, so the mapping
# can't ship as a static /etc/skel/.config/mimeapps.list entry.
xdg-mime default HEY.desktop x-scheme-handler/mailto
-5
View File
@@ -1,5 +0,0 @@
EXTENSIONS_DIR="$HOME/.local/share/nautilus-python/extensions"
mkdir -p "$EXTENSIONS_DIR"
cp "$OMARCHY_PATH/default/nautilus-python/extensions/localsend.py" "$EXTENSIONS_DIR/"
cp "$OMARCHY_PATH/default/nautilus-python/extensions/transcode.py" "$EXTENSIONS_DIR/"
-6
View File
@@ -1,6 +0,0 @@
# Place in each assistant's global skills directory so the Omarchy skill is available on first install
mkdir -p ~/.agents/skills ~/.claude/skills ~/.codex/skills ~/.pi/agent/skills
ln -sfn "$OMARCHY_PATH/default/omarchy-skill" ~/.agents/skills/omarchy
ln -sfn "$OMARCHY_PATH/default/omarchy-skill" ~/.claude/skills/omarchy
ln -sfn "$OMARCHY_PATH/default/omarchy-skill" ~/.codex/skills/omarchy
ln -sfn "$OMARCHY_PATH/default/omarchy-skill" ~/.pi/agent/skills/omarchy
-3
View File
@@ -1,3 +0,0 @@
# Toggles are used to turn certain features on/off in a persistent way
mkdir -p ~/.local/state/omarchy/toggles/hypr
cp "$OMARCHY_PATH/default/hypr/toggles/flags.lua" ~/.local/state/omarchy/toggles/hypr/
-2
View File
@@ -1,2 +0,0 @@
# Make sure toggles are available
mkdir -p ~/.local/state/omarchy/toggles
-12
View File
@@ -1,12 +0,0 @@
mkdir -p ~/Downloads ~/Pictures ~/Videos ~/.config/gtk-3.0
xdg-user-dirs-update --set TEMPLATES "$HOME"
xdg-user-dirs-update --set PUBLICSHARE "$HOME"
xdg-user-dirs-update --set DESKTOP "$HOME"
rmdir ~/Templates ~/Public ~/Desktop 2>/dev/null || true
touch ~/.config/gtk-3.0/bookmarks
for dir in Downloads Projects Pictures Videos; do
printf 'file://%s/%s %s\n' "$HOME" "$dir" "$dir" >>~/.config/gtk-3.0/bookmarks
done