Update .local/bin/setup/setupnextcloud
This commit is contained in:
@@ -1,31 +1,37 @@
|
||||
#!/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)
|
||||
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"
|
||||
|
||||
# Launch Nextcloud (Standard NixOS/Wayland path)
|
||||
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
|
||||
|
||||
echo "$TOWERUN" | xclip -selection clipboard -i
|
||||
|
||||
clipnotify
|
||||
|
||||
echo "$TOWERPW" | xclip -selection clipboard -i
|
||||
# Wait for you to paste the username, then copy the password
|
||||
wait_for_copy
|
||||
enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort copy "Scarif: Tower"
|
||||
|
||||
# 4. Finalize
|
||||
read -s -k $'?Press enter when you have synced Nextcloud... \n'
|
||||
|
||||
echo "" | xclip -selection clipboard -i
|
||||
|
||||
dwmc toggleview 0
|
||||
|
||||
ln -s "$HOME/Tower/Pictures/Wallpapers/7680x2160" "$HOME/.local/share/wallpapers"
|
||||
ln -s "$HOME/Tower/Resources/Fonts" "$HOME/.local/share/fonts"
|
||||
# Clear clipboard for security
|
||||
wl-copy --clear
|
||||
|
||||
# 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"
|
||||
Reference in New Issue
Block a user