From 0d78d1ca8fdaeb232bd3e0e71676576847ab6da9 Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 22 Feb 2026 23:22:56 +0000 Subject: [PATCH] Update .local/bin/setup/setupnextcloud --- .local/bin/setup/setupnextcloud | 40 +++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/.local/bin/setup/setupnextcloud b/.local/bin/setup/setupnextcloud index c99321d..85707aa 100755 --- a/.local/bin/setup/setupnextcloud +++ b/.local/bin/setup/setupnextcloud @@ -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) 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" \ No newline at end of file