diff --git a/.local/bin/station-confirm-or-close b/.local/bin/station-confirm-or-close new file mode 100755 index 0000000..21f466a --- /dev/null +++ b/.local/bin/station-confirm-or-close @@ -0,0 +1,5 @@ +#! /bin/zsh + +zenity --title="$1" --info --text="$2" \ + || gum confirm "You closed the dialog, do you want to continue?" \ + || break diff --git a/.local/bin/station-get-username-password b/.local/bin/station-get-username-password new file mode 100755 index 0000000..cac0512 --- /dev/null +++ b/.local/bin/station-get-username-password @@ -0,0 +1,28 @@ +#! /bin/zsh + +local label="$1" + +if [[ -z "$MASTERPW" ]]; then + export MASTERPW=$(gum input --password --placeholder "Enter Enpass Master Password") +fi +local entry=$(enpass-cli -vault="$HOME/.local/share/Enpass/Enpass/Vaults/primary" -json -sort show "$label" | sed 's/\\/\\\\/g') # Escaping backslashes for jq + +len=$(echo "$entry" | jq '. | length') +if [[ $len -eq 0 ]]; then + exit 1 +fi +if [[ $len -gt 1 ]];then + logins=$(echo "$entry" | jq -r '.[].login') + + login=$(echo "$logins" | gum choose --header "Select which account to use" --selected="stofflees@gmail.com" --height=$(echo "$logins" | wc -l) --ordered) + + entry=$(echo "$entry" | jq -c --arg login "$login" '.[] | select(.login == $login) | [.]') +fi +username=$(echo "$entry" | jq -r '.[].login') +password=$(echo "$entry" | jq -r '.[].password') + +if [[ -z "$username" || -z "$password" ]]; then + exit 1 +fi + +echo "$username $password" diff --git a/.local/bin/station-initial-setup b/.local/bin/station-initial-setup new file mode 100755 index 0000000..d45af7f --- /dev/null +++ b/.local/bin/station-initial-setup @@ -0,0 +1,64 @@ +#! /bin/bash + +echo "Let's get set up" +echo """ + +░▒█▀▀▀█░▀▀█▀▀░█▀▀▄░▀▀█▀▀░▀█▀░▒█▀▀▀█░▒█▄░▒█░░░▒█▀▀▀█░▒█▀▀▀░▀▀█▀▀░▒█░▒█░▒█▀▀█ +░░▀▀▀▄▄░░▒█░░▒█▄▄█░░▒█░░░▒█░░▒█░░▒█░▒█▒█▒█░░░░▀▀▀▄▄░▒█▀▀▀░░▒█░░░▒█░▒█░▒█▄▄█ +░▒█▄▄▄█░░▒█░░▒█░▒█░░▒█░░░▄█▄░▒█▄▄▄█░▒█░░▀█░░░▒█▄▄▄█░▒█▄▄▄░░▒█░░░░▀▄▄▀░▒█░░░ + +""" + +export MASTERPW=$(gum input --header="Enpass Master password" --password) + +station-setup-password +station-setup-password-manager + +CHECKPW=$(enpass-cli -vault="$HOME/.local/share/Enpass/Enpass/Vaults/primary" -sort list 2>&1) + +while [[ "$CHECKPW" == *level=error* ]]; do + export MASTERPW=$(gum input --header="Enpass Master password (incorrect, try again)" --password) + CHECKPW=$(enpass-cli -vault="$VAULT_DIR" -sort list) +done + + ["Firefox"]="https://accounts.firefox.com/signin?action=email&service=sync,false" + ["Google"]="https://accounts.google.com,true" + ["Discord"]="https://discord.com/channels/@me,true" + ["Netflix"]="https://netflix.com/gb/login,true" + ["GitHub"]="https://github.com/login,true,GitHub (1)" + ["Zoom"]="https://apps.zoom.us/wc/home,true" + ["Scarif: Tower"]="https://tower.scarif.space,true" + ["Scarif: Labs"]="https://labs.scarif.space/user/login,true" + ["Scarif: Droid"]="https://droid.scarif.space,true" + +STEPS=( + ["SSH"]="station-setup-ssh" + ["Server"]="station-setup-server" + ["Firefox"]="station-setup-website \"Firefox\" https://accounts.firefox.com/signin?action=email&service=sync" + ["Nextcloud"]="station-setup-nextcloud" + ["Google"]="station-setup-website \"Google\" https://accounts.google.com" + ["Discord"]="station-setup-website \"Discord\" https://discord.com/channels/@me" + ["Netflix"]="station-setup-website \"Netflix\" https://netflix.com/gb/login" + ["GitHub"]="station-setup-website \"GitHub\" https://github.com/login true \"GitHub (1)\"" + ["Zoom"]="station-setup-website \"Zoom\" https://apps.zoom.us/wc/home" + ["Tower"]="station-setup-website \"Scarif: Tower\" https://tower.scarif.space" + ["Labs"]="station-setup-website \"Scarif: Labs\" https://labs.scarif.space/user/login" + ["Droid"]="station-setup-website \"Scarif: Droid\" https://droid.scarif.space" + ["ExpressVPN"]="station-setup-vpn" + ["Spotify"]="station-setup-spotify" + ["Antigravity"]="station-setup-antigravity" + ["Minecraft"]="station-setup-minecraft" + ["Mail"]="station-setup-mail" + ["Super Productivity"]="station-setup-super-productivity" +) + +CHOICE=$(print -l ${(k)STEPS} | gum choose --header "Select accounts to setup (ctrl + a to toggle all)" --no-limit --selected="*" --height="${#STEPS[@]}" --ordered) + +if [[ -z "$CHOICE" ]]; then + echo "No choice made, skipping." + exit 1 +fi + +for key in ${(@f)CHOICE}; do + eval "${ACCOUNTS[$key]}" +done diff --git a/.local/bin/station-install/firefox.sh b/.local/bin/station-install/firefox.sh deleted file mode 100755 index 749987f..0000000 --- a/.local/bin/station-install/firefox.sh +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/zsh - -echo "-------------------------------------" -echo "Browser Setup Script" -echo "-------------------------------------" - -echo "Checking if firefox is already synced" -if [[ -d "$HOME/.mozilla/firefox" && -n "$(find "$HOME/.mozilla/firefox" -name "places.sqlite" -print -quit)" ]]; then - echo "Firefox profile detected. Skipping sync." - exit 0 -fi - -FIREFOX=$(enpass-cli -vault="$HOME/.local/share/Enpass/Enpass/Vaults/primary" -json -sort show "Firefox" | sed 's/\\/\\\\/g') # Escaping backslashes for jq -FIREFOXUN=$(echo "$FIREFOX" | jq -r '.[].login') -FIREFOXPW=$(echo "$FIREFOX" | jq -r '.[].password') - -echo -n "$FIREFOXUN" | wl-copy - -station-launch-browser "https://accounts.firefox.com/signin?action=email&service=sync" - -zenity --title="Firefox Setup" \ - --info \ - --text="Email copied.\nPress OK for password" \ - || gum confirm "You closed the dialog, do you want to continue?" \ - || exit 1 - -echo -n "$FIREFOXPW" | wl-copy - -read -s -k $'?Press enter when you have synced Firefox...\n' - -echo -n "" | wl-copy - diff --git a/.local/bin/station-install/install.sh b/.local/bin/station-install/install.sh deleted file mode 100755 index 2052866..0000000 --- a/.local/bin/station-install/install.sh +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/bash - -echo "Let's get set up" -echo """ - -░▒█▀▀▀█░▀▀█▀▀░█▀▀▄░▀▀█▀▀░▀█▀░▒█▀▀▀█░▒█▄░▒█░░░▒█▀▀▀█░▒█▀▀▀░▀▀█▀▀░▒█░▒█░▒█▀▀█ -░░▀▀▀▄▄░░▒█░░▒█▄▄█░░▒█░░░▒█░░▒█░░▒█░▒█▒█▒█░░░░▀▀▀▄▄░▒█▀▀▀░░▒█░░░▒█░▒█░▒█▄▄█ -░▒█▄▄▄█░░▒█░░▒█░▒█░░▒█░░░▄█▄░▒█▄▄▄█░▒█░░▀█░░░▒█▄▄▄█░▒█▄▄▄░░▒█░░░░▀▄▄▀░▒█░░░ - -""" - -export MASTERPW=$(gum input --header="Enpass Master password" --password) - -"$HOME/.local/bin/station-install/password.sh" -"$HOME/.local/bin/station-install/password-manager.sh" - -CHECKPW=$(enpass-cli -vault="$HOME/.local/share/Enpass/Enpass/Vaults/primary" -sort list 2>&1) - -while [[ "$CHECKPW" == *level=error* ]]; do - export MASTERPW=$(gum input --header="Enpass Master password (incorrect, try again)" --password) - CHECKPW=$(enpass-cli -vault="$VAULT_DIR" -sort list) -done - -"$HOME/.local/bin/station-install/ssh.sh" -"$HOME/.local/bin/station-install/server.sh" -"$HOME/.local/bin/station-install/firefox.sh" -# "$HOME/.local/bin/station-install/nextcloud.sh" diff --git a/.local/bin/station-install/nextcloud.sh b/.local/bin/station-install/nextcloud.sh deleted file mode 100755 index bb9841a..0000000 --- a/.local/bin/station-install/nextcloud.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/zsh - -mkdir -p "$HOME/Tower" - -nextcloud & - -enpasscli -vault="$HOME/.local/share/Enpass/Enpass/Vaults/primary" -sort copy "Scarif: Tower" - -read -s -k $'?Press enter when you have synced Nextcloud... \n' - -wl-copy --clear - diff --git a/.local/bin/station-install/vpn.sh b/.local/bin/station-install/vpn.sh deleted file mode 100755 index f74ad16..0000000 --- a/.local/bin/station-install/vpn.sh +++ /dev/null @@ -1,17 +0,0 @@ -#! /bin/bash - -sudo systemctl enable --now expressvpn.service - -VPN=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show "ExpressVPN Activation Code" 2>&1) -VPNPW=$(echo "$LABS" | grep -Po "(?<=pass : ).+(?=\")") - -echo "$VPNPW" | xclip -selection clipboard -i - -expressvpn activate - -expressvpn autoconnect true - -expressvpn connect smart - -echo "" | xclip -selection clipboard -i - diff --git a/.local/bin/station-setup-antigravity b/.local/bin/station-setup-antigravity new file mode 100755 index 0000000..ddd1a2c --- /dev/null +++ b/.local/bin/station-setup-antigravity @@ -0,0 +1,13 @@ +#! /bin/zsh + +echo "Signing into Antigravity..." + +antigravity & + +station-confirm-or-close "Spotify Setup" "Click OK when you have finished logging in to move on." + +wl-copy --clear + +hyprctl dispatch closewindow class:Antigravity + +echo "Finished setting up Antigravity" diff --git a/.local/bin/station-setup-mail b/.local/bin/station-setup-mail new file mode 100755 index 0000000..83ca4fe --- /dev/null +++ b/.local/bin/station-setup-mail @@ -0,0 +1,5 @@ +#! /bin/zsh + +echo "Signing into Mail..." + +## Todo diff --git a/.local/bin/station-setup-minecraft b/.local/bin/station-setup-minecraft new file mode 100755 index 0000000..e748a19 --- /dev/null +++ b/.local/bin/station-setup-minecraft @@ -0,0 +1,21 @@ +#! /bin/zsh + +echo "Signing into Minecraft..." + +read -r username password <<< "$(station-get-username-password "Minecraft")" + +echo -n "$username" | wl-copy + +lunarclient & + +station-confirm-or-close "Minecraft Setup" "Username copied.\nPress OK for password" + +echo -n "$password" | wl-copy + +station-confirm-or-close "Minecraft Setup" "Click OK when you have finished logging in to move on." + +wl-copy --clear + +hyprctl dispatch closewindow class:lunarclient + +echo "Finished setting up Minecraft" diff --git a/.local/bin/station-setup-nextcloud b/.local/bin/station-setup-nextcloud new file mode 100755 index 0000000..5be186a --- /dev/null +++ b/.local/bin/station-setup-nextcloud @@ -0,0 +1,10 @@ +#! /bin/zsh + +echo -n "https://tower.scarif.space" | wl-copy + +nextcloud & + +station-confirm-or-close "Nextcloud Setup" "Click OK to finish setup" + +wl-copy --clear + diff --git a/.local/bin/station-install/password.sh b/.local/bin/station-setup-password similarity index 100% rename from .local/bin/station-install/password.sh rename to .local/bin/station-setup-password diff --git a/.local/bin/station-install/password-manager.sh b/.local/bin/station-setup-password-manager similarity index 100% rename from .local/bin/station-install/password-manager.sh rename to .local/bin/station-setup-password-manager diff --git a/.local/bin/station-install/server.sh b/.local/bin/station-setup-server similarity index 100% rename from .local/bin/station-install/server.sh rename to .local/bin/station-setup-server diff --git a/.local/bin/station-setup-spotify b/.local/bin/station-setup-spotify new file mode 100755 index 0000000..c44b11e --- /dev/null +++ b/.local/bin/station-setup-spotify @@ -0,0 +1,21 @@ +#! /bin/zsh + +echo "Signing into Spotify..." + +read -r username password <<< "$(station-get-username-password "Spotify")" + +echo -n "$username" | wl-copy + +spotify & + +station-confirm-or-close "Spotify Setup" "Username copied.\nPress OK for password" + +echo -n "$password" | wl-copy + +station-confirm-or-close "Spotify Setup" "Click OK when you have finished logging in to move on." + +wl-copy --clear + +hyprctl dispatch closewindow class:Spotify + +echo "Finished setting up Spotify" diff --git a/.local/bin/station-install/ssh.sh b/.local/bin/station-setup-ssh similarity index 100% rename from .local/bin/station-install/ssh.sh rename to .local/bin/station-setup-ssh diff --git a/.local/bin/station-setup-super-productivity b/.local/bin/station-setup-super-productivity new file mode 100755 index 0000000..76271be --- /dev/null +++ b/.local/bin/station-setup-super-productivity @@ -0,0 +1,17 @@ +#! /bin/zsh + +echo "Signing into Super Productivity..." + +super-productivity & + +station-confirm-or-close "Spotify Setup" "Username copied.\nPress OK for password" + +echo -n "$password" | wl-copy + +station-confirm-or-close "Spotify Setup" "Click OK when you have finished logging in to move on." + +wl-copy --clear + +hyprctl dispatch closewindow class:Spotify + +echo "Finished setting up Spotify" diff --git a/.local/bin/station-setup-vpn b/.local/bin/station-setup-vpn new file mode 100755 index 0000000..39fe14f --- /dev/null +++ b/.local/bin/station-setup-vpn @@ -0,0 +1,22 @@ +#! /bin/bash + +echo "Signing into ExpressVPN..." + +read -r username password <<< "$(station-get-username-password "ExpressVPN")" + +station-launch-browser "https://www.expressvpn.com/sign-in" + +echo -n "$username" | wl-copy + +station-confirm-or-close "ExpressVPN Setup" "Email copied.\nPress OK for password" || exit + +echo -n "$password" | wl-copy + +expressvpn activate + +expressvpn autoconnect true + +expressvpn connect smart + +wl-copy --clear + diff --git a/.local/bin/station-setup-website b/.local/bin/station-setup-website new file mode 100755 index 0000000..542bcc1 --- /dev/null +++ b/.local/bin/station-setup-website @@ -0,0 +1,28 @@ +#! /bin/zsh + +key="$1" +url="$2" +also_webapp="$3:-true" +label="$4:-$key" + +echo "Signing into $key..." + +read -r username password <<< "$(station-get-username-password "$label")" + +echo -n "$username" | wl-copy + +station-launch-browser "$url" + +if [[ "$also_webapp" == "true" ]]; then + exec setsid uwsm-app -- chromium "$url" 2>/dev/null & +fi + +station-confirm-or-close "$key Setup" "Email copied.\nPress OK for password" + +echo -n "$password" | wl-copy + +station-confirm-or-close "$key Setup" "Click OK when you have finished logging in to move on." + +echo -n "" | wl-copy + +echo "Finished setting up $key."