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
cd $HOME/.dotfiles || exit
envsubst <.librewolf/installs.template >$HOME/.librewolf/installs.ini
envsubst <.librewolf/profiles.template >$HOME/.librewolf/profiles.ini
cd $HOME/.dotfiles/.librewolf || exit
librewolf --no-remote --CreateProfile "librewolf $HOME/.local/share/librewolf"

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.fullscreen.autohide", false);
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'
dotfiles="${1:-$HOME/.dotfiles}"
echo "${BLUE}Changing directory to $dotfiles${NC}"
printf "${BLUE}Changing directory to $dotfiles${NC}\n"
if ! cd "$dotfiles"; then
echo "${RED}Could not CD into $dotfiles${NC}"
printf "${RED}Could not CD into $dotfiles${NC}\n"
exit
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")
needs_pop=1
if [ "$stash_result" = "No local changes to save" ]; then
needs_pop=0
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 submodule update --remote --recursive --init
echo
printf "\n"
if [ $needs_pop -eq 1 ]; then
echo "${BLUE}Popping stashed changes...${NC}"
printf "${BLUE}Popping stashed changes...${NC}\n"
git stash pop
fi
echo
printf "\n"
unmerged_files=$(git diff --name-only --diff-filter=U)
if [ -n "$unmerged_files" ]; then
echo "${RED}The following files have merge conflicts after popping the stash:${NC}"
echo
printf %"s\n" "$unmerged_files"
printf "${RED}The following files have merge conflicts after popping the stash:${NC}\n"
printf "\n"
printf %"s\n" "$unmerged_files\n"
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
echo "${BLUE}Generating librewolf profiles...${NC}"
envsubst <.librewolf/installs.template >$HOME/.librewolf/installs.ini
envsubst <.librewolf/profiles.template >$HOME/.librewolf/profiles.ini
echo
printf "${BLUE}Generating librewolf profiles...${NC}\n"
$dotfiles/.librewolf/generate.sh
printf "\n"
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"