[firefox] Make it possible to stow firefox configuration

- Put ‘userChrome.css’ into the ‘src/’ directory and have stow ignore any such
  directory.

- Dynamically find the name of the default firefox profile.

- In case the firefox profile can't be found, output some messages stating such.

- Update the ‘userChrome.css’ as used by Firefox.
This commit is contained in:
Tom Willemse 2022-07-01 18:55:02 -07:00
parent 1d8a14276d
commit 513459d4dd
4 changed files with 21 additions and 2 deletions

View file

@ -4,4 +4,5 @@
--ignore .dir-locals.el --ignore .dir-locals.el
--ignore PKGBUILD --ignore PKGBUILD
--ignore pkg.tar.xz --ignore pkg.tar.xz
--ignore src
--no-folding --no-folding

View file

@ -1,9 +1,11 @@
MODULES=xmodmap emacs xdg shepherd dunst zsh mcron mbsync nyxt work \ MODULES=xmodmap emacs xdg shepherd dunst zsh mcron mbsync nyxt work \
herbstluftwm mpd polybar xbindkeys herbstluftwm mpd polybar xbindkeys firefox
STOW = stow STOW = stow
EMACS = emacs EMACS = emacs
SCHEME_IMPLEMENTATION = guile SCHEME_IMPLEMENTATION = guile
# Found this sed command here: https://stackoverflow.com/a/40778047
FIREFOX_PROFILE := $(shell sed -nr "/^Name=default/ { :l /^Path=/ { s/[^=]*=[ ]*//; p; q; }; n; b l; }" ~/.mozilla/firefox/profiles.ini 2>/dev/null)
.PRECIOUS: %.el .PRECIOUS: %.el
@ -125,6 +127,21 @@ zsh: zsh/.profile zsh/.zshrc zsh/.zsh/functions/unzip.zwc \
nyxt: nyxt/.config/nyxt/init.lisp nyxt: nyxt/.config/nyxt/init.lisp
## Firefox
ifneq ($(FIREFOX_PROFILE),)
firefox: firefox/.mozilla/firefox/$(FIREFOX_PROFILE)/chrome/userChrome.css
firefox/.mozilla/firefox/$(FIREFOX_PROFILE)/chrome/userChrome.css: firefox/src/userChrome.css
mkdir -p $$(dirname $@)
cp $^ $@
else
firefox:
@echo "Error finding firefox default profile, can't make" >&2
firefox-stow:
@echo "Error finding firefox default profile, can't stow" >&2
endif
## Helper ## Helper
%.el: %.org %.el: %.org

1
firefox/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.mozilla/

View file

@ -1,4 +1,4 @@
#tabbrowser-tabs, #tabbrowser-tabs > .tabbrowser-arrowscrollbox { #tabbrowser-tabs, #tabbrowser-arrowscrollbox {
min-height: 0 !important; min-height: 0 !important;
} }