Update .local/bin/setup/setupnextcloud

This commit is contained in:
2026-02-22 23:22:56 +00:00
parent 6c540cc75f
commit 0d78d1ca8f

View File

@@ -1,31 +1,37 @@
#!/usr/bin/zsh #!/usr/bin/zsh
# 1. Fetch credentials (Enpass logic remains the same)
TOWER=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show "Scarif: Tower" 2>&1) TOWER=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show "Scarif: Tower" 2>&1)
TOWERUN=$(echo "$TOWER" | grep -Po "(?<=login: )\w+") TOWERUN=$(echo "$TOWER" | grep -Po "(?<=login: )\w+")
TOWERPW=$(echo "$TOWER" | grep -Po "(?<=pass : ).+(?=\")")
echo "https://tower.scarif.space" | xclip -selection clipboard -i # Helper function to wait for a clipboard change
wait_for_copy() {
# We use wl-paste --watch but kill it after the first event
# This mimics the 'clipnotify' behavior of pausing the script
timeout 60s wl-paste --watch sh -c 'kill $PPID' >/dev/null 2>&1
}
# 2. Start the process
echo "https://tower.scarif.space" | wl-copy
mkdir -p "$HOME/Tower" mkdir -p "$HOME/Tower"
# Launch Nextcloud (Standard NixOS/Wayland path)
nextcloud & nextcloud &
dwmc toggleview 32 # 3. The Sequence
# Wait for you to paste the URL, then copy the username
wait_for_copy
echo "$TOWERUN" | wl-copy
clipnotify # Wait for you to paste the username, then copy the password
wait_for_copy
echo "$TOWERUN" | xclip -selection clipboard -i enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort copy "Scarif: Tower"
clipnotify
echo "$TOWERPW" | xclip -selection clipboard -i
# 4. Finalize
read -s -k $'?Press enter when you have synced Nextcloud... \n' read -s -k $'?Press enter when you have synced Nextcloud... \n'
echo "" | xclip -selection clipboard -i # Clear clipboard for security
wl-copy --clear
dwmc toggleview 0
ln -s "$HOME/Tower/Pictures/Wallpapers/7680x2160" "$HOME/.local/share/wallpapers"
ln -s "$HOME/Tower/Resources/Fonts" "$HOME/.local/share/fonts"
# Symbolic links (NixOS usually manages fonts via config, but manual links still work)
ln -s "$HOME/Tower/Library/Pictures/Wallpapers/7680x2160" "$HOME/.local/share/wallpapers"