Refactoring install

This commit is contained in:
2026-03-15 16:24:30 +00:00
parent 10939f2ea3
commit b3637e4d6f
19 changed files with 234 additions and 88 deletions

View File

@@ -0,0 +1,5 @@
#! /bin/zsh
zenity --title="$1" --info --text="$2" \
|| gum confirm "You closed the dialog, do you want to continue?" \
|| break

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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"

5
.local/bin/station-setup-mail Executable file
View File

@@ -0,0 +1,5 @@
#! /bin/zsh
echo "Signing into Mail..."
## Todo

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

22
.local/bin/station-setup-vpn Executable file
View File

@@ -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

View File

@@ -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."