diff --git a/bin/omarchy-first-run b/bin/omarchy-first-run index 8e2c024d..dc800baf 100755 --- a/bin/omarchy-first-run +++ b/bin/omarchy-first-run @@ -23,3 +23,7 @@ if [[ -f $FIRST_RUN_MODE ]]; then bash "$OMARCHY_PATH/install/first-run/welcome.sh" bash "$OMARCHY_PATH/install/first-run/wifi.sh" fi + +# omarchy-setup-user is idempotent (gated on its own marker), so this is +# safe to call on every invocation — it'll no-op once user setup is done. +omarchy-setup-user || true diff --git a/bin/omarchy-setup-user b/bin/omarchy-setup-user new file mode 100755 index 00000000..b2605a27 --- /dev/null +++ b/bin/omarchy-setup-user @@ -0,0 +1,98 @@ +#!/bin/bash + +# omarchy:summary=Set up Omarchy for the current user (~/.config, ~/.local, etc.) +# omarchy:group=install +# omarchy:examples=omarchy setup user | omarchy setup user --force + +set -euo pipefail + +if [[ $EUID -eq 0 ]]; then + echo "Error: run omarchy-setup-user as the user being configured, not as root." >&2 + exit 1 +fi + +force=0 +if [[ ${1:-} == "--force" ]]; then + force=1 +elif [[ ${1:-} == "-h" || ${1:-} == "--help" ]]; then + cat </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 + +# Hyprland keyboard layout from /etc/vconsole.conf +conf=/etc/vconsole.conf +hyprlua="$HOME/.config/hypr/input.lua" +if [[ -f $conf && -f $hyprlua ]]; then + if 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 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 +fi + +# Application catalog + MIME defaults +omarchy-refresh-applications +xdg-settings set default-web-browser chromium.desktop +xdg-mime default HEY.desktop x-scheme-handler/mailto + +touch "$marker" +echo "User setup complete." diff --git a/install/config/all.sh b/install/config/all.sh index f6eeb879..d9d2aefe 100644 --- a/install/config/all.sh +++ b/install/config/all.sh @@ -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 diff --git a/install/config/branding.sh b/install/config/branding.sh deleted file mode 100644 index e203b495..00000000 --- a/install/config/branding.sh +++ /dev/null @@ -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 diff --git a/install/config/detect-keyboard-layout.sh b/install/config/detect-keyboard-layout.sh deleted file mode 100644 index 576d7975..00000000 --- a/install/config/detect-keyboard-layout.sh +++ /dev/null @@ -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 diff --git a/install/config/mimetypes.sh b/install/config/mimetypes.sh deleted file mode 100644 index 91a1cde9..00000000 --- a/install/config/mimetypes.sh +++ /dev/null @@ -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 diff --git a/install/config/nautilus-python.sh b/install/config/nautilus-python.sh deleted file mode 100644 index 76266353..00000000 --- a/install/config/nautilus-python.sh +++ /dev/null @@ -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/" diff --git a/install/config/omarchy-ai-skill.sh b/install/config/omarchy-ai-skill.sh deleted file mode 100644 index 8eec4b95..00000000 --- a/install/config/omarchy-ai-skill.sh +++ /dev/null @@ -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 diff --git a/install/config/omarchy-toggles.sh b/install/config/omarchy-toggles.sh deleted file mode 100644 index 4a6687f4..00000000 --- a/install/config/omarchy-toggles.sh +++ /dev/null @@ -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/ diff --git a/install/config/toggles.sh b/install/config/toggles.sh deleted file mode 100644 index fb5a8680..00000000 --- a/install/config/toggles.sh +++ /dev/null @@ -1,2 +0,0 @@ -# Make sure toggles are available -mkdir -p ~/.local/state/omarchy/toggles diff --git a/install/config/user-dirs.sh b/install/config/user-dirs.sh deleted file mode 100644 index 26d1adc2..00000000 --- a/install/config/user-dirs.sh +++ /dev/null @@ -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