From 513459d4dd6986c325ee18e4dee8502542e029c6 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 1 Jul 2022 18:55:02 -0700 Subject: [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. --- .stowrc | 1 + GNUmakefile | 19 ++++++++++++++++++- firefox/.gitignore | 1 + firefox/src/userChrome.css | 28 ++++++++++++++++++++++++++++ firefox/userChrome.css | 28 ---------------------------- 5 files changed, 48 insertions(+), 29 deletions(-) create mode 100644 firefox/.gitignore create mode 100644 firefox/src/userChrome.css delete mode 100644 firefox/userChrome.css 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/src/userChrome.css b/firefox/src/userChrome.css new file mode 100644 index 0000000..93e7d9a --- /dev/null +++ b/firefox/src/userChrome.css @@ -0,0 +1,28 @@ +#tabbrowser-tabs, #tabbrowser-arrowscrollbox { + min-height: 0 !important; +} + +#tabbrowser-tabs tab[first-visible-tab="true"][last-visible-tab="true"], +#tabbrowser-tabs tab[first-visible-tab="true"][last-visible-tab="true"] + toolbarbutton { + visibility: collapse; +} + +#tabbrowser-tabs .tabs-newtab-button { + visibility: collapse !important; +} + +#tabbrowser-tabs tab { + min-height: var(--tab-min-height); +} + +/* Context menu filters */ +.menu-iconic-left { opacity: 0.7; } +#contentAreaContextMenu, #placesContext, #tabContextMenu, #toolbar-context-menu #sitebarMenu-popup { opacity: 0.7 !important; } +/* Bookmarks Toolbar folters, Bookmarks and History Menu filters */ +#personal-bookmarks .menu-iconic-left, #BMB_bookmarksPopup .menu-iconic-left, #bookmarksMenuPopup .menu-iconic-left, #goPopup .menu-iconic-left { opacity: 0.9 !important; } +menupopup:nth-child(1) { opacity: 0.7; } +/* Page Action context menu filter */ +#pageActionContextMenu .menu-iconic-left { opacity: 0.7 !important; } +#pageActionContextMenu { opacity: 0.7; } +/* Widget Panels (Overflow + add-ons) filter */ +.panel-arrowcontent { opacity: 0.7; } diff --git a/firefox/userChrome.css b/firefox/userChrome.css deleted file mode 100644 index ba87743..0000000 --- a/firefox/userChrome.css +++ /dev/null @@ -1,28 +0,0 @@ -#tabbrowser-tabs, #tabbrowser-tabs > .tabbrowser-arrowscrollbox { - min-height: 0 !important; -} - -#tabbrowser-tabs tab[first-visible-tab="true"][last-visible-tab="true"], -#tabbrowser-tabs tab[first-visible-tab="true"][last-visible-tab="true"] + toolbarbutton { - visibility: collapse; -} - -#tabbrowser-tabs .tabs-newtab-button { - visibility: collapse !important; -} - -#tabbrowser-tabs tab { - min-height: var(--tab-min-height); -} - -/* Context menu filters */ -.menu-iconic-left { opacity: 0.7; } -#contentAreaContextMenu, #placesContext, #tabContextMenu, #toolbar-context-menu #sitebarMenu-popup { opacity: 0.7 !important; } -/* Bookmarks Toolbar folters, Bookmarks and History Menu filters */ -#personal-bookmarks .menu-iconic-left, #BMB_bookmarksPopup .menu-iconic-left, #bookmarksMenuPopup .menu-iconic-left, #goPopup .menu-iconic-left { opacity: 0.9 !important; } -menupopup:nth-child(1) { opacity: 0.7; } -/* Page Action context menu filter */ -#pageActionContextMenu .menu-iconic-left { opacity: 0.7 !important; } -#pageActionContextMenu { opacity: 0.7; } -/* Widget Panels (Overflow + add-ons) filter */ -.panel-arrowcontent { opacity: 0.7; } -- cgit v1.2.3-54-g00ecf