#! /bin/zsh

echo "Signing into Super Productivity..."

read -r username password <<< "$(station-get-username-password "Scarif: Tower")"

echo -n "https://tower.scarif.space/remote.php/dav/files/chris/" | wl-copy

super-productivity &

station-confirm-or-close "Super Productivity Setup" "URL copied.\nPress OK for username"

echo -n "$username" | wl-copy

station-confirm-or-close "Super Productivity Setup" "Username copied.\nPress OK for password"

echo -n "$password" | wl-copy

station-confirm-or-close "Super Productivity Setup" "Password copied.\nPress OK for sync folder"

echo -n ".backups/super-productivity" | wl-copy

station-confirm-or-close "Super Productivity Setup" "Sync folder path copied\n\nClick OK when you have finished logging in to move on."

wl-copy --clear

echo "Downloading latest autoplan plugin..."

wget "https://codeberg.org/00sapo/sp-autoplan/releases/download/latest/sp-autoplan-plugin.zip" -O "$HOME/Downloads/autoplan.zip"

station-confirm-or-close "Super Productivity Setup" "Autoplan plugin downloaded. Please enable it in settings."

hyprctl dispatch closewindow class:superProductivity

echo "Finished setting up Super Productivity"


