From fa5b13a28449c4e5db084df3862eba6271db38e8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 21 Jul 2025 18:05:48 -0400 Subject: [PATCH] Finalize the first-run flow --- bin/omarchy-first-run | 45 ++++--------------------------------- bin/omarchy-first-run-flow | 44 ++++++++++++++++++++++++++++++++++++ default/hypr/autostart.conf | 1 + 3 files changed, 49 insertions(+), 41 deletions(-) create mode 100755 bin/omarchy-first-run-flow diff --git a/bin/omarchy-first-run b/bin/omarchy-first-run index 9ebc346..8973977 100755 --- a/bin/omarchy-first-run +++ b/bin/omarchy-first-run @@ -1,44 +1,7 @@ #!/bin/bash -source ~/.local/share/omarchy/ansi.sh - -echo -e "Welcome to Omarchy!\n" - -if gum confirm "Install editor in addition to Neovim?"; then - options=("VSCode" "Cursor" "Zed" "Helix" "Emacs" "Nevermind") - choice=$(printf "%s\n" "${options[@]}" | gum choose --header "Add programming editor") || exit 0 - - case "$choice" in - VSCode) yay -Sy --noconfirm --needed vscodium-electron-bin ;; - Cursor) yay -Sy --noconfirm --needed cursor ;; - Zed) yay -Sy --noconfirm --needed zed ;; - Helix) yay -Sy --noconfirm --needed helix-bin ;; - Emacs) yay -Sy --noconfirm --needed emacs ;; - Nevermind) ;; - esac +if [[ ! -f ~/.local/state/omarchy/after-first-run.mode ]]; then + uwsm app -- alacritty --class=OmarchyFirstRun --title=OmarchyFirstRun -e omarchy-first-run-flow + mkdir -p ~/.local/state/omarchy + touch ~/.local/state/omarchy/after-first-run.mode fi - -if gum confirm "Login to GitHub?"; then - gh auth login -fi - -if gum confirm "Setup Dropbox?"; then - omarchy-setup-dropbox -fi - -if gum confirm "Start Docker DBs?"; then - options=("MySQL" "Redis" "PostgreSQL") - choices=$(printf "%s\n" "${options[@]}" | gum choose --no-limit --header "Select databases") || exit 0 - - if [[ -n "$choices" ]]; then - for db in $choices; do - case $db in - MySQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mysql8 -e MYSQL_ROOT_PASSWORD= -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql:8.4 ;; - Redis) sudo docker run -d --restart unless-stopped -p "127.0.0.1:6379:6379" --name=redis redis:7 ;; - PostgreSQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:5432:5432" --name=postgres16 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:16 ;; - esac - done - fi -fi - -echo -e "\nYou're all set!" diff --git a/bin/omarchy-first-run-flow b/bin/omarchy-first-run-flow new file mode 100755 index 0000000..fa9c3ad --- /dev/null +++ b/bin/omarchy-first-run-flow @@ -0,0 +1,44 @@ +#!/bin/bash + +source ~/.local/share/omarchy/ansi.sh + +echo -e "Welcome to Omarchy!\n" + +if gum confirm "Install editor in addition to Neovim?"; then + options=("VSCode" "Cursor" "Zed" "Helix" "Emacs" "Nevermind") + choice=$(printf "%s\n" "${options[@]}" | gum choose --header "Add programming editor") || exit 0 + + case "$choice" in + VSCode) yay -Sy --noconfirm --needed vscodium-electron-bin ;; + Cursor) yay -Sy --noconfirm --needed cursor ;; + Zed) yay -Sy --noconfirm --needed zed ;; + Helix) yay -Sy --noconfirm --needed helix-bin ;; + Emacs) yay -Sy --noconfirm --needed emacs ;; + Nevermind) ;; + esac +fi + +if gum confirm "Login to GitHub?"; then + gh auth login +fi + +if gum confirm "Setup Dropbox?"; then + omarchy-setup-dropbox +fi + +if gum confirm "Start Docker DBs?"; then + options=("MySQL" "Redis" "PostgreSQL") + choices=$(printf "%s\n" "${options[@]}" | gum choose --no-limit --header "Select databases") || exit 0 + + if [[ -n "$choices" ]]; then + for db in $choices; do + case $db in + MySQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mysql8 -e MYSQL_ROOT_PASSWORD= -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql:8.4 ;; + Redis) sudo docker run -d --restart unless-stopped -p "127.0.0.1:6379:6379" --name=redis redis:7 ;; + PostgreSQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:5432:5432" --name=postgres16 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:16 ;; + esac + done + fi +fi + +gum spin --spinner "globe" --title "You're all set!" -- sleep 2 diff --git a/default/hypr/autostart.conf b/default/hypr/autostart.conf index 8b04359..6579a21 100644 --- a/default/hypr/autostart.conf +++ b/default/hypr/autostart.conf @@ -6,3 +6,4 @@ exec-once = uwsm app -- swaybg -i ~/.config/omarchy/current/background -m fill exec-once = uwsm app -- walker --gapplication-service exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec-once = wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+' +exec-once = omarchy-first-run