1
0
Fork 0

rework firefox profile handling

This commit is contained in:
Luca Bilke 2023-03-29 00:08:17 +02:00
parent f5b26bc555
commit ce62f247ff
5 changed files with 30 additions and 38 deletions

View file

@ -1,4 +1,3 @@
#!/bin/sh #!/bin/sh
cd $HOME/.dotfiles || exit cd $HOME/.dotfiles/.librewolf || exit
envsubst <.librewolf/installs.template >$HOME/.librewolf/installs.ini librewolf --no-remote --CreateProfile "librewolf $HOME/.local/share/librewolf"
envsubst <.librewolf/profiles.template >$HOME/.librewolf/profiles.ini

View file

@ -1,4 +0,0 @@
[6C4726F70D182CF7]
Default=$XDG_DATA_HOME/librewolf
Locked=1

View file

@ -6,3 +6,4 @@ defaultPref("browser.uidensity", 1);
defaultPref("browser.compactmode.show", true); defaultPref("browser.compactmode.show", true);
defaultPref("browser.fullscreen.autohide", false); defaultPref("browser.fullscreen.autohide", false);
defaultPref("full-screen-api.ignore-widgets", true); defaultPref("full-screen-api.ignore-widgets", true);
defaultPref("toolkit.legacyUserProfileCustomizations.stylesheets", true);

View file

@ -1,13 +0,0 @@
[Install6C4726F70D182CF7]
Default=$XDG_DATA_HOME/librewolf
Locked=1
[Profile0]
Name=librewolf
IsRelative=0
Path=$XDG_DATA_HOME/librewolf
Default=1
[General]
StartWithLastProfile=1
Version=2

View file

@ -6,44 +6,53 @@ RED='\033[1;30m'
NC='\033[0m' NC='\033[0m'
dotfiles="${1:-$HOME/.dotfiles}" dotfiles="${1:-$HOME/.dotfiles}"
echo "${BLUE}Changing directory to $dotfiles${NC}" printf "${BLUE}Changing directory to $dotfiles${NC}\n"
if ! cd "$dotfiles"; then if ! cd "$dotfiles"; then
echo "${RED}Could not CD into $dotfiles${NC}" printf "${RED}Could not CD into $dotfiles${NC}\n"
exit exit
fi fi
echo printf "\n"
echo "${BLUE}Stashing existing changes...${NC}" printf "${BLUE}Stashing existing changes...${NC}\n"
stash_result=$(git stash push -m "sync-dotfiles: Before syncing dotfiles") stash_result=$(git stash push -m "sync-dotfiles: Before syncing dotfiles")
needs_pop=1 needs_pop=1
if [ "$stash_result" = "No local changes to save" ]; then if [ "$stash_result" = "No local changes to save" ]; then
needs_pop=0 needs_pop=0
fi fi
echo printf "\n"
echo "${BLUE}Pulling updates from dotfiles repo...${NC}" printf "${BLUE}Pulling updates from dotfiles repo...${NC}\n"
git pull origin main git pull origin main
git submodule update --remote --recursive --init git submodule update --remote --recursive --init
echo printf "\n"
if [ $needs_pop -eq 1 ]; then if [ $needs_pop -eq 1 ]; then
echo "${BLUE}Popping stashed changes...${NC}" printf "${BLUE}Popping stashed changes...${NC}\n"
git stash pop git stash pop
fi fi
echo printf "\n"
unmerged_files=$(git diff --name-only --diff-filter=U) unmerged_files=$(git diff --name-only --diff-filter=U)
if [ -n "$unmerged_files" ]; then if [ -n "$unmerged_files" ]; then
echo "${RED}The following files have merge conflicts after popping the stash:${NC}" printf "${RED}The following files have merge conflicts after popping the stash:${NC}\n"
echo printf "\n"
printf %"s\n" "$unmerged_files" printf %"s\n" "$unmerged_files\n"
else else
stow -t "$HOME" . || echo "${RED}Stow uninstalled or not in path!${NC}" stow -t "$HOME" . || printf "${RED}Stow uninstalled or not in path!${NC}\n"
fi fi
echo "${BLUE}Generating librewolf profiles...${NC}" printf "${BLUE}Generating librewolf profiles...${NC}\n"
envsubst <.librewolf/installs.template >$HOME/.librewolf/installs.ini $dotfiles/.librewolf/generate.sh
envsubst <.librewolf/profiles.template >$HOME/.librewolf/profiles.ini printf "\n"
echo
echo "${GREEN}Dotfiles Synced Successfully!${NC}" printf "Recompile/Install src files? [y/N] \n"
read ans
[ $ans = "y" ] && for f in $dotfiles/.local/src/*; do
if ! cd "$f"; then
printf "${RED}Could not CD into $f${NC}\n"
exit
fi
sudo make install
done
printf "${GREEN}Dotfiles Synced Successfully!${NC}\n"