#! zsh # 1. Fetch credentials (Enpass logic remains the same) TOWER=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show "Scarif: Tower" 2>&1) TOWERUN=$(echo "$TOWER" | grep -Po "(?<=login: )\w+") wait_for_copy() { timeout 60s wl-paste --watch sh -c 'kill $PPID' >/dev/null 2>&1 } echo "https://tower.scarif.space" | wl-copy mkdir -p "$HOME/Tower" nextcloud & wait_for_copy echo "$TOWERUN" | wl-copy wait_for_copy enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort copy "Scarif: Tower" read -s -k $'?Press enter when you have synced Nextcloud... \n' wl-copy --clear