Files
dotfiles/.local/bin/station-install/firefox.sh

33 lines
1.0 KiB
Bash
Raw Normal View History

2026-03-01 23:15:53 +00:00
#! /bin/zsh
2026-03-01 00:09:35 +00:00
2026-03-14 19:40:46 +00:00
echo "-------------------------------------"
echo "Browser Setup Script"
echo "-------------------------------------"
2026-03-01 00:09:35 +00:00
2026-03-14 19:40:46 +00:00
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
2026-03-01 00:09:35 +00:00
read -s -k $'?Press enter when you have synced Firefox...\n'
2026-03-14 19:40:46 +00:00
echo -n "" | wl-copy