#!/bin/bash # omarchy:summary=Set up Omarchy for the current user (~/.config, ~/.local, etc.) # omarchy:group=setup # omarchy:examples=omarchy setup user | omarchy setup user --force set -euo pipefail if (( EUID == 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 < ~/.bash_profile # AI assistant skill symlinks. Each agent has its own conventional skills # directory; we drop an 'omarchy' entry into each so the skill is loaded. 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 # Toggle state and flags mkdir -p ~/.local/state/omarchy/toggles/hypr cp "$OMARCHY_PATH/default/hypr/toggles/flags.lua" ~/.local/state/omarchy/toggles/hypr/ # Nautilus python extensions mkdir -p "$HOME/.local/share/nautilus-python/extensions" cp "$OMARCHY_PATH/default/nautilus-python/extensions/localsend.py" \ "$HOME/.local/share/nautilus-python/extensions/" cp "$OMARCHY_PATH/default/nautilus-python/extensions/transcode.py" \ "$HOME/.local/share/nautilus-python/extensions/" # Branding (fastfetch about + screensaver text) 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 # XDG user dirs (folder layout, gtk bookmarks) 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 bookmark="file://$HOME/$dir $dir" grep -qxF "$bookmark" ~/.config/gtk-3.0/bookmarks || echo "$bookmark" >>~/.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 sed -i '/^[[:space:]]*kb_layout[[:space:]]*=/d' "$hyprlua" sed -i '/^[[:space:]]*kb_variant[[:space:]]*=/d' "$hyprlua" 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 # Reusable per-user install phase: theme, shell/user services, default keyring, # hardware-specific user session fixes, and other current-user setup. source "$OMARCHY_INSTALL/user/all.sh" # Application catalog + MIME defaults. Run after mise/node setup from user/all # so npm-backed wrappers can be installed for each user. 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."