From 513459d4dd6986c325ee18e4dee8502542e029c6 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 1 Jul 2022 18:55:02 -0700 Subject: [PATCH] [firefox] Make it possible to stow firefox configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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. --- .stowrc | 1 + GNUmakefile | 19 ++++++++++++++++++- firefox/.gitignore | 1 + firefox/{ => src}/userChrome.css | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 firefox/.gitignore rename firefox/{ => src}/userChrome.css (94%) diff --git a/.stowrc b/.stowrc index 8e27a40..e845ab0 100644 --- a/.stowrc +++ b/.stowrc @@ -4,4 +4,5 @@ --ignore .dir-locals.el --ignore PKGBUILD --ignore pkg.tar.xz +--ignore src --no-folding diff --git a/GNUmakefile b/GNUmakefile index f368adb..15c6712 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,9 +1,11 @@ MODULES=xmodmap emacs xdg shepherd dunst zsh mcron mbsync nyxt work \ - herbstluftwm mpd polybar xbindkeys + herbstluftwm mpd polybar xbindkeys firefox STOW = stow EMACS = emacs 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 @@ -125,6 +127,21 @@ zsh: zsh/.profile zsh/.zshrc zsh/.zsh/functions/unzip.zwc \ 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 %.el: %.org diff --git a/firefox/.gitignore b/firefox/.gitignore new file mode 100644 index 0000000..d029b17 --- /dev/null +++ b/firefox/.gitignore @@ -0,0 +1 @@ +.mozilla/ diff --git a/firefox/userChrome.css b/firefox/src/userChrome.css similarity index 94% rename from firefox/userChrome.css rename to firefox/src/userChrome.css index ba87743..93e7d9a 100644 --- a/firefox/userChrome.css +++ b/firefox/src/userChrome.css @@ -1,4 +1,4 @@ -#tabbrowser-tabs, #tabbrowser-tabs > .tabbrowser-arrowscrollbox { +#tabbrowser-tabs, #tabbrowser-arrowscrollbox { min-height: 0 !important; }