dotfiles/.config/aerospace/startup.sh
2026-07-03 09:41:20 +02:00

41 lines
989 B
Bash
Executable file

#!/bin/bash
# Wait for Aerospace server to be fully ready
sleep 2
# Launch all apps (open returns immediately)
open -a "Ghostty"
open -a "Helium"
open -a "Slack"
open -a "1Password"
open -a "Proton Pass"
open -a "Proton Mail"
# Give apps time to start up and create windows
sleep 4
# Place a window on its workspace, polling up to 30s
place_window() {
local app_name="$1"
local workspace="$2"
local window_id
for _ in $(seq 1 30); do
window_id=$(aerospace list-windows --all --format "%{window-id} %{app-name}" 2>/dev/null \
| grep -m1 " ${app_name}$" \
| awk '{print $1}')
if [ -n "$window_id" ]; then
aerospace move-node-to-workspace --window-id "$window_id" "$workspace"
return 0
fi
sleep 1
done
return 1
}
place_window "Ghostty" "1"
place_window "Helium" "2"
place_window "Slack" "3"
place_window "1Password" "7"
place_window "Proton Pass" "6"
place_window "Proton Mail" "8"