From 039432440e3f7c3f8a733190985b318b344c7614 Mon Sep 17 00:00:00 2001 From: Luke Tidd Date: Mon, 31 Mar 2025 15:49:17 -0400 Subject: [PATCH] [this doesnt work] try to move url bar, tabs, etc to the bottom --- get_profile | 5 ++ info | 4 ++ link | 26 ++++++++- navbar_below_content.css | 58 +++++++++++++++++++ tabs_below_content.css | 113 +++++++++++++++++++++++++++++++++++++ toolbars_below_content.css | 79 ++++++++++++++++++++++++++ userChrome.css | 4 ++ userContent.css | 0 8 files changed, 286 insertions(+), 3 deletions(-) create mode 100755 get_profile create mode 100644 info create mode 100644 navbar_below_content.css create mode 100644 tabs_below_content.css create mode 100644 toolbars_below_content.css create mode 100644 userContent.css diff --git a/get_profile b/get_profile new file mode 100755 index 0000000..010b431 --- /dev/null +++ b/get_profile @@ -0,0 +1,5 @@ +#!/bin/bash +find "${HOME}/.mozilla/firefox" -maxdepth 1 -type d -name '*.default' \ + | while read dir; do + printf '%s\n' "$dir" + done diff --git a/info b/info new file mode 100644 index 0000000..b71471d --- /dev/null +++ b/info @@ -0,0 +1,4 @@ +about:config +toolkit.legacyUserProfileCustomizations.stylesheets = true + +css is from https://github.com/MrOtherGuy/firefox-csshacks diff --git a/link b/link index 199ec0b..fb87b35 100755 --- a/link +++ b/link @@ -1,14 +1,34 @@ #!/bin/bash here="$(pwd)" -if [[ ! "$here" =~ custom_firefox$ ]]; then +if [[ ! "$here" =~ firefox$ ]]; then printf 'I dunno where I am\n' >&2 exit 1 fi +# @import url(chrome/navbar_below_content.css); +# @import url(chrome/tabs_below_content.css); +# @import url(chrome/toolbars_below_content.css); + +declare -a files +files=( + 'userChrome.css' + 'userContent.css' + 'navbar_below_content.css' + 'tabs_below_content.css' + 'toolbars_below_content.css' +) find "${HOME}/.mozilla/firefox" -maxdepth 1 -type d -name '*.default' \ | while read dir; do - printf 'ln -fs "%s/userChrome.css" "%s"\n' "$here" "$dir" - ln -fs "${here}/userChrome.css" "$dir" + dest="${dir}/chrome" + if [[ ! -d "$dest" ]]; then + mkdir "$dest" + fi + for file in "${files[@]}"; do + printf 'ln -fs "%s/%s" "%s"\n' "$here" "$file" "$dest" + ln -fs "${here}/${file}" "$dest" + printf 'ln -fs "%s/%s" "%s"\n' "$here" "$file" "$dest" + ln -fs "${here}/${file}" "$dest" + done done diff --git a/navbar_below_content.css b/navbar_below_content.css new file mode 100644 index 0000000..d04312a --- /dev/null +++ b/navbar_below_content.css @@ -0,0 +1,58 @@ +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/navbar_below_content.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* Moves the main toolbar (#nav-bar) to the bottom of the window */ + +@-moz-document url(chrome://browser/content/browser.xhtml){ + + :root:not([inFullscreen]){ + --uc-bottom-toolbar-height: calc(39px + var(--toolbarbutton-outer-padding) ) + } + + :root[uidensity="compact"]:not([inFullscreen]){ + --uc-bottom-toolbar-height: calc(32px + var(--toolbarbutton-outer-padding) ) + } + + #browser, + #customization-container{ margin-bottom: var(--uc-bottom-toolbar-height,0px) } + + #nav-bar{ + position: fixed !important; + bottom: 0px; + /* For some reason -webkit-box behaves internally like -moz-box, but can be used with fixed position. display: flex would work too but it breaks extension menus. */ + display: -webkit-box; + width: 100%; + z-index: 1; + } + #nav-bar-customization-target{ -webkit-box-flex: 1; } + + :root[lwtheme] #nav-bar{ + background-image: linear-gradient(var(--toolbar-bgcolor),var(--toolbar-bgcolor)), var(--lwt-additional-images,var(--toolbar-bgimage)) !important; + background-position: top,var(--lwt-background-alignment); + background-repeat: repeat,var(--lwt-background-tiling); + } + :root[lwtheme-image] #nav-bar{ + background-image: linear-gradient(var(--toolbar-bgcolor),var(--toolbar-bgcolor)),var(--lwt-header-image), var(--lwt-additional-images,var(--toolbar-bgimage)) !important; + } + + /* Fix panels sizing */ + .panel-viewstack{ max-height: unset !important; } + + #urlbar[breakout][breakout-extend]{ + display: flex !important; + flex-direction: column-reverse !important; + bottom: 0px !important; /* Change to 3-5 px if using compact_urlbar_megabar.css depending on toolbar density */ + top: auto !important; + } + + .urlbarView-body-inner{ border-top-style: none !important; } + + @media (-moz-platform: linux){ + #notification-popup[side="top"]{ + margin-top: calc(-2 * var(--panel-padding-block) - 40px - 32px - 8.5em) !important; + } + #permission-popup[side="top"]{ + margin-top: calc(-2 * var(--panel-padding-block) - 2.5em); + } + } +} diff --git a/tabs_below_content.css b/tabs_below_content.css new file mode 100644 index 0000000..40c7946 --- /dev/null +++ b/tabs_below_content.css @@ -0,0 +1,113 @@ +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/tabs_below_content_v2.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* Requires Fx 133+ */ +@media (-moz-bool-pref: "userchrome.force-window-controls-on-left.enabled"), + -moz-pref("userchrome.force-window-controls-on-left.enabled"){ + #nav-bar > .titlebar-buttonbox-container{ + order: -1 !important; + > .titlebar-buttonbox{ + flex-direction: row-reverse; + } + } +} +@media not (-moz-bool-pref: "sidebar.verticalTabs"), + not -moz-pref("sidebar.verticalTabs"){ + #main-window > body{ + display: grid !important; + grid-template-rows: repeat(8,max-content) 1fr; + grid-auto-rows: auto; + } + #navigator-toolbox{ + display: contents; + } + :root[sizemode="fullscreen"]:not([inDOMFullscreen]) #toolbar-menubar{ + min-height: 0 !important; + } + #main-window #browser{ + grid-row: 9/10; + } + #TabsToolbar{ + grid-row: 10/11; + background-attachment: scroll; + } + .browser-toolbar{ + background: inherit; + background-attachment: fixed; + } + #TabsToolbar > :is(.titlebar-buttonbox-container,.titlebar-spacer){ + display: none; + } + :root[sizemode="fullscreen"] #nav-bar > .titlebar-buttonbox-container{ + display: flex !important; + } + :root:is([tabsintitlebar],[customtitlebar]) #toolbar-menubar:not([autohide="false"]) ~ #nav-bar{ + > .titlebar-buttonbox-container{ + display: flex !important; + } + :root[sizemode="normal"] & { + > .titlebar-spacer{ + display: flex !important; + } + } + :root[sizemode="maximized"] & { + > .titlebar-spacer[type="post-tabs"]{ + display: flex !important; + } + } + @media (-moz-bool-pref: "userchrome.force-window-controls-on-left.enabled"), + -moz-pref("userchrome.force-window-controls-on-left.enabled"), + (-moz-gtk-csd-reversed-placement), + (-moz-platform: macos){ + > .titlebar-spacer[type="post-tabs"]{ + display: none !important; + } + > .titlebar-spacer[type="pre-tabs"]{ + display: flex !important; + } + } + } + @media (-moz-bool-pref: "browser.fullscreen.autohide"), + -moz-pref("browser.fullscreen.autohide"){ + #main-window[sizemode="fullscreen"]:not([inDOMFullscreen]){ + > body { + grid-template-rows: repeat(8,0px) 1fr; + grid-auto-rows: 0px; + } + & #nav-bar{ + height: min-content; + z-index: 1; + transition: transform 133ms ease-in-out 400ms !important; + transform: rotateX(89.9deg); + transform-origin: top; + &:hover{ + transition-delay: 0ms !important; + transform: rotateX(0deg); + } + } + & #TabsToolbar{ + opacity: 0 !important; + will-change: unset !important; + transform: translateY(calc(100% - 1px)); + transition: transform 66.7ms ease-in-out 100ms, opacity 66.7ms linear 66.7ms !important; + height: min-content; + align-self: end; + z-index: 2; + &:hover{ + transition-delay: 0ms !important; + transform: translateY(0); + opacity: 1 !important; + } + } + & #mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#selection-shortcut-action-panel,#chat-shortcuts-options-panel,#tab-preview-panel)) ~ #navigator-toolbox > #nav-bar{ + transition-delay: 0ms !important; + transform: rotateX(0deg); + } + & #mainPopupSet:has(> #tabContextMenu:hover) ~ #navigator-toolbox #TabsToolbar{ + transition-delay: 0ms; + transform: translateY(0); + opacity: 1 !important; + } + } + } +} \ No newline at end of file diff --git a/toolbars_below_content.css b/toolbars_below_content.css new file mode 100644 index 0000000..b92588c --- /dev/null +++ b/toolbars_below_content.css @@ -0,0 +1,79 @@ +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/toolbars_below_content_v2.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* This requires Firefox 133 + * By default tabs will be the top-most toolbar, but you can set the following pref to move them to bottom: + * userchrome.toolbars-below-content.tabs-at-bottom.enabled + */ + +#navigator-toolbox{ + display: contents; + --uc-navbar-height: 40px; +} +:root[uidensity="compact"] #navigator-toolbox{ + --uc-navbar-height: 34px; +} +#main-window > body > #browser, +.global-notificationbox, + #tab-notification-deck, + #toolbar-menubar{ + order: -1; +} + +#TabsToolbar{ + max-height: calc((var(--tab-min-height) + 2 * var(--tab-block-margin,0px)) * var(--multirow-n-rows,1)); +} +#toolbar-menubar, +#TabsToolbar{ + background: inherit !important; +} +@media (-moz-platform: linux){ + :root[sizemode="normal"][customtitlebar] #toolbar-menubar{ + border-top-left-radius: inherit; + border-top-right-radius: inherit; + } + #toolbar-menubar, + #TabsToolbar{ + opacity: 1 !important; + will-change: unset !important; + } + #notification-popup[side="top"]{ + margin-top: calc(-2 * var(--panel-padding-block) - 40px - 32px - 8.5em) !important; + } + #permission-popup[side="top"]{ + margin-top: calc(-2 * var(--panel-padding-block) - 2.5em); + } +} + +#nav-bar, +#PersonalToolbar{ + background-image: linear-gradient(var(--toolbar-bgcolor),var(--toolbar-bgcolor)), var(--lwt-additional-images,var(--toolbar-bgimage)) !important; + background-position: top,var(--lwt-background-alignment); + background-position-y: calc(0px - var(--tab-min-height) - 2*var(--tab-block-margin,0px)); + background-repeat: repeat,var(--lwt-background-tiling); +} +:root[lwtheme-image] #nav-bar, +:root[lwtheme-image] #PersonalToolbar{ + background-image: linear-gradient(var(--toolbar-bgcolor),var(--toolbar-bgcolor)),var(--lwt-header-image), var(--lwt-additional-images,var(--toolbar-bgimage)) !important; +} +#PersonalToolbar{ + background-position-y: calc(0px - var(--tab-min-height) - 2*var(--tab-block-margin,0px) - var( --uc-navbar-height)); +} +#urlbar[breakout][breakout-extend]{ + display: flex !important; + flex-direction: column-reverse !important; + transform: translateY(calc(var(--urlbar-container-height) - 100%)); +} +#urlbar[breakout-extend]:not([usertyping]) > .urlbar-input-container::after{ + display: flex; + content: ""; + height: calc(var(--urlbar-min-height) - 2px - 2 * var(--urlbar-container-padding)); +} +.urlbarView-body-inner{ border-top-style: none !important; } + +@media (-moz-bool-pref: "userchrome.toolbars-below-content.tabs-at-bottom.enabled"), + -moz-pref("userchrome.toolbars-below-content.tabs-at-bottom.enabled"){ + #TabsToolbar{ + order: 3 + } +} diff --git a/userChrome.css b/userChrome.css index e260798..5f272d8 100644 --- a/userChrome.css +++ b/userChrome.css @@ -1,3 +1,7 @@ +@import url(navbar_below_content.css); +@import url(tabs_below_content.css); +@import url(toolbars_below_content.css); + @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */ #eme-notification-icon[firstplay=true] { diff --git a/userContent.css b/userContent.css new file mode 100644 index 0000000..e69de29