diff --git a/README.md b/README.md new file mode 100644 index 0000000..f1a2749 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# Firefox theme installer +Automated installation of userChrome theming for Firefox and its derivatives' interface via a shell script. +Included theme originally modified from [Filip Sutkowy's *blurclean-firefox-theme* (GitHub)](https://github.com/Filip-Sutkowy/blurclean-firefox-theme). + +## Description +This script will create or modify the following files and directories: ++ `/chrome/` and subsidiary CSS files will be created if they do not exist, or overwritten if `-o` is passed, in order to provide the necessary styles ++ `/user.js` will be created if it does not exist, or appended to in the case of an existing `user.js`, in order to modify the necessary `about:config` settings for the theme ++ `/user-overrides.js` will be created if it does not exist, or appended to in the case of an existing `user-overrides.js`, with the same modifications as the regular `user.js` file in order to ensure current or a potential future compatibility with the [arkenfox user.js (GitHub)](https://github.com/arkenfox/user.js) or similar + +Note: `user.js` files are read "top-to-bottom" by the browser, thus giving priority to the final alteration of a given preference that appears within the file. As such, the appending of the necessary preferences for this theme may overwrite users' existing settings for those preferences. + +## Options +``` +Usage: ./foxtheme.sh [OPTIONS] [PROFILE | -a PROFILESDIR] +-a Apply theme to all (current) browser profiles +-j Just create or modify user.js and not user-overrides.js +-o Remove and replace an existing theme if found +-h Display this help message +``` +## Custom themes +This script is ultimately just a glorified wrapper for: +``` +cp -r chrome/ / +cat user.js >> /user.js +cat user.js >> /user-overrides.js +``` +As such, replacing the `user.js` or contents of the `chrome` directory with custom preferences and themes should offer the same functionality. diff --git a/chrome/components/elements-transparencies.css b/chrome/components/elements-transparencies.css new file mode 100644 index 0000000..8315d84 --- /dev/null +++ b/chrome/components/elements-transparencies.css @@ -0,0 +1,14 @@ +/* url bar */ +#widget-overflow-mainView, +#urlbar[open="true"] > #urlbar-background { + background: var(--bct-e-urlbar-bg) !important; + backdrop-filter: contrast(100%) blur(var(--bct-blur)) saturate(25%) !important; + border: none !important; +} + +/* overfow menu in customize menu */ +vbox#customization-panelWrapper box.panel-arrowcontent { + background: #0000 !important; + backdrop-filter: contrast(100%) blur(6px) !important; + border: none !important; +} \ No newline at end of file diff --git a/chrome/components/hide-tabbar.css b/chrome/components/hide-tabbar.css new file mode 100644 index 0000000..eb0431f --- /dev/null +++ b/chrome/components/hide-tabbar.css @@ -0,0 +1,43 @@ +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/hide_tabs_toolbar.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* Hides tabs toolbar */ +/* For OSX use hide_tabs_toolbar_osx.css instead */ + +/* IMPORTANT */ +/* +Get window_control_placeholder_support.css +Window controls will be all wrong without it +*/ + +:root{ --uc-toolbar-height: 32px; } + +:root:not([uidensity="compact"]){--uc-toolbar-height: 38px} + +#TabsToolbar{ visibility: collapse !important } +:root[sizemode="fullscreen"] #TabsToolbar > #window-controls{ visibility: visible !important; z-index: 2 } + +:root:not([inFullscreen]) #nav-bar{ + margin-top: calc(0px - var(--uc-toolbar-height)); +} + +#toolbar-menubar{ + min-height:unset !important; + height:var(--uc-toolbar-height) !important; + position: relative; +} + +#main-menubar{ + -moz-box-flex: 1; + background-color: var(--toolbar-bgcolor,--toolbar-non-lwt-bgcolor); + background-clip: padding-box; + border-right: 30px solid transparent; + border-image: linear-gradient(to left, transparent, var(--toolbar-bgcolor,--toolbar-non-lwt-bgcolor) 30px) 20 / 30px +} + +#toolbar-menubar:not([inactive]){ z-index: 2 } +#toolbar-menubar[inactive] > #menubar-items { + opacity: 0; + pointer-events: none; + margin-left: var(--uc-window-drag-space-width,0px) +} \ No newline at end of file diff --git a/chrome/components/menu-icons.css b/chrome/components/menu-icons.css new file mode 100644 index 0000000..816bd6d --- /dev/null +++ b/chrome/components/menu-icons.css @@ -0,0 +1,411 @@ +/* +This component is made by u/qaz69wsx +https://www.reddit.com/r/FirefoxCSS/comments/osles3/menu_icons +*/ + +.subviewbutton:not(.subviewbutton-iconic, .subviewbutton-back, [checked="true"], [targetURI]) > .toolbarbutton-icon { + width: 16px; + height: 16px; + margin-inline-end: 8px !important; + -moz-context-properties: fill; + fill: currentColor; +} +#appMenu-zoom-controls2 > .toolbarbutton-text { + margin-inline-start: 24px !important; +} +#appMenu-fxa-label2::before { + content: ""; + display: block; + width: 16px; + height: 16px; + margin-inline-end: 8px; + border-radius: 50%; + background: var(--avatar-image-url) no-repeat center/16px; +} +.PanelUI-remotetabs-notabsforclient-label { + margin-inline-start: 40px !important; +} +#fxa-menu-avatar { + display: -moz-inline-box; + -moz-box-ordinal-group: 2; +} +#fxa-manage-account-button vbox { + margin-inline-start: 24px; +} +.syncNowBtn { + visibility: visible !important; + -moz-box-ordinal-group: 0 !important; + margin-inline-end: 8px; +} +#PanelUI-fxa-menu-setup-sync-button { + list-style-image: url("chrome://browser/skin/sync.svg"); +} +#PanelUI-fxa-menu-sendtab-button { + list-style-image: url("chrome://browser/skin/send-to-device.svg"); +} +#PanelUI-fxa-menu-sync-prefs-button, +#appMenu-settings-button { + list-style-image: url("chrome://global/skin/icons/settings.svg"); +} +#PanelUI-fxa-menu-account-signout-button { + list-style-image: url("chrome://browser/skin/sign-out.svg"); +} +#appMenu-new-tab-button2 { + list-style-image: url("chrome://browser/skin/new-tab.svg"); +} +#appMenu-new-window-button2, +#appMenuRecentlyClosedWindows { + list-style-image: url("chrome://browser/skin/window.svg"); +} +#appMenu-new-private-window-button2 { + list-style-image: url("chrome://browser/skin/privateBrowsing.svg"); +} +#appMenu-bookmarks-button, +#panelMenuBookmarkThisPage[starred], +#appMenu-library-bookmarks-button, +#sidebar-switcher-bookmarks { + list-style-image: url("chrome://browser/skin/bookmark.svg"); +} +#panelMenuBookmarkThisPage { + list-style-image: url("chrome://browser/skin/bookmark-hollow.svg"); +} +#panelMenu_searchBookmarks, +#appMenu-find-button2, +#allTabsMenu-searchTabs { + list-style-image: url("chrome://global/skin/icons/search-glass.svg"); +} +:is(toolbarbutton, menuitem)[id$="_viewBookmarksToolbar"] { + list-style-image: url("chrome://browser/skin/bookmarks-toolbar.svg") !important; +} +#appMenu-history-button, +#appMenu-library-history-button, +#sidebar-switcher-history { + list-style-image: url("chrome://browser/skin/history.svg"); +} +#appMenuRecentlyClosedTabs { + list-style-image: url("chrome://devtools/skin/images/debugging-tabs.svg"); +} +#appMenuRestoreSession { + list-style-image: url("chrome://browser/skin/restore-session.svg"); +} +#appMenuClearRecentHistory { + list-style-image: url("chrome://browser/skin/forget.svg"); +} +#appMenu-downloads-button, +#appMenu-library-downloads-button { + list-style-image: url("chrome://browser/skin/downloads/downloads.svg"); +} +#appMenu-passwords-button { + list-style-image: url("chrome://browser/skin/login.svg"); +} +#appMenu-extensions-themes-button { + list-style-image: url("chrome://mozapps/skin/extensions/extension.svg"); +} +#appMenu-print-button2 { + list-style-image: url("chrome://global/skin/icons/print.svg"); +} +#appMenu-save-file-button2 { + list-style-image: url("chrome://browser/skin/save.svg"); +} +#appmenu-moreTools-button, +#overflowMenu-customize-button { + list-style-image: url("chrome://browser/skin/customize.svg"); +} +#appmenu-developer-tools-view > [oncommand="switchToTabHavingURI('about:performance', true)"] { + list-style-image: url("chrome://global/skin/icons/performance.svg"); +} +#appmenu-developer-tools-view > [key="key_browserToolbox"] { + list-style-image: url("chrome://devtools/skin/images/fox-smiling.svg"); +} +#appmenu-developer-tools-view > [key="key_responsiveDesignMode"] + .subviewbutton { + list-style-image: url("chrome://devtools/skin/images/command-eyedropper.svg"); +} +#appmenu-developer-tools-view > [key="key_viewSource"] + .subviewbutton { + list-style-image: url("chrome://activity-stream/content/data/content/assets/glyph-webextension-16.svg"); +} +#appMenu-help-button2 { + list-style-image: url("chrome://global/skin/icons/help.svg"); +} +#appMenu_aboutName { + list-style-image: url("chrome://devtools/skin/images/browsers/firefox.svg"); +} +#appMenu-quit-button2 { + list-style-image: url("chrome://browser/skin/quit.svg"); +} +#allTabsMenu-containerTabsButton { + list-style-image: url('data:image/svg+xml,'); +} +#BMB_bookmarksPopup .subviewbutton > .menu-iconic-left { + margin-inline-end: 8px !important; +} +#BMB_bookmarksShowAll { + padding-inline-start: calc(1em + 20px) !important; +} +#BMB_bookmarksPopup .openintabs-menuitem .menu-text { + margin-inline-start: -4px !important; +} +#BMB_viewBookmarksSidebar, +#sidebar-reverse-position[label="Move Sidebar to Left"] { + list-style-image: url("chrome://browser/skin/sidebars.svg") !important; +} +#sidebar-switcher-tabs { + list-style-image: url("chrome://browser/skin/tab.svg"); +} +#sidebar-reverse-position[label="Move Sidebar to Right"] { + list-style-image: url("chrome://browser/skin/sidebars-right.svg"); +} +#sidebarMenu-popup > [data-l10n-id="sidebar-menu-close"] { + list-style-image: url("chrome://global/skin/icons/close.svg"); +} + +menupopup > :is(menu:not(.menu-iconic), menuitem:not(.menuitem-iconic, [checked="true"])) { + padding-inline-start: calc(1em + 24px) !important; + background-position: left 1em center; + background-repeat: no-repeat; + background-size: 16px; + -moz-context-properties: fill; + fill: currentColor; +} +#menu_newNavigatorTab, +menuitem[id$="openANewTab"] { + background-image: url("chrome://browser/skin/new-tab.svg"); +} +#menu_newUserContext { + background-image: url('data:image/svg+xml,'); +} +#menu_newNavigator, +#historyUndoWindowMenu { + background-image: url("chrome://browser/skin/window.svg"); +} +menuitem[data-l10n-id$="-private-window"] { + background-image: url("chrome://browser/skin/privateBrowsing.svg"); +} +#menu_openFile { + background-image: url("chrome://browser/skin/open.svg"); +} +#menu_savePage, +#context-savepage { + background-image: url("chrome://browser/skin/save.svg"); +} +menuitem[data-l10n-id*="-email"] { + background-image: url("chrome://browser/skin/mail.svg"); +} +menuitem[data-l10n-id*="-print"] { + background-image: url("chrome://global/skin/icons/print.svg"); +} +#menu_importFromAnotherBrowser, +#browserImport { + background-image: url("chrome://browser/skin/import.svg"); +} +#menu_FileQuitItem { + background-image: url("chrome://browser/skin/quit.svg"); +} +menuitem[data-l10n-id="text-action-undo"], +menuitem[data-l10n-id$="-reopen-closed-tabs"] { + background-image: url("chrome://global/skin/icons/undo.svg"); +} +menuitem[data-l10n-id="text-action-cut"] { + background-image: url("chrome://browser/skin/edit-cut.svg"); +} +menuitem[data-l10n-id="text-action-copy"], +#syncedTabsCopySelected { + background-image: url("chrome://browser/skin/edit-copy.svg"); +} +menuitem[data-l10n-id="text-action-paste"] { + background-image: url("chrome://browser/skin/edit-paste.svg"); +} +menuitem[data-l10n-id="text-action-delete"], +menuitem[id^="placesContext_delete"], +menuitem[data-l10n-id="toolbar-context-menu-remove-from-toolbar"], +.downloadRemoveFromHistoryMenuItem { + background-image: url("chrome://global/skin/icons/delete.svg"); +} +#menu_find, +#context-searchselect { + background-image: url("chrome://global/skin/icons/search-glass.svg"); +} +#toggle_PersonalToolbar { + background-image: url("chrome://browser/skin/bookmarks-toolbar.svg"); +} +menuitem[data-l10n-id*="-customize-toolbar"] { + background-image: url("chrome://browser/skin/customize.svg"); +} +#viewSidebarMenuMenu { + background-image: url("chrome://browser/skin/sidebars.svg"); +} +#menu_zoomEnlarge { + background-image: url("chrome://browser/skin/zoom-in.svg"); +} +#menu_zoomReduce { + background-image: url("chrome://browser/skin/zoom-out.svg"); +} +#charsetMenu { + background-image: url("chrome://browser/skin/characterEncoding.svg"); +} +#fullScreenItem { + background-image: url("chrome://browser/skin/fullscreen.svg"); +} +#sanitizeItem, +#placesContext_deleteHost { + background-image: url("chrome://browser/skin/forget.svg"); +} +#sync-tabs-menuitem { + background-image: url("chrome://browser/skin/tab.svg"); +} +#historyRestoreLastSession { + background-image: url("chrome://browser/skin/restore-session.svg"); +} +#historyUndoMenu { + background-image: url("chrome://devtools/skin/images/debugging-tabs.svg"); +} +menuitem[data-l10n-id*="bookmark-"]:not(.menuitem-iconic), +#placesContext_createBookmark { + background-image: url("chrome://browser/skin/bookmark-hollow.svg"); +} +menuitem[data-l10n-id="menu-bookmark-edit"] { + background-image: url("chrome://browser/skin/bookmark.svg") !important; +} +#menu_openDownloads { + background-image: url("chrome://browser/skin/downloads/downloads.svg"); +} +#menu_openAddons { + background-image: url("chrome://mozapps/skin/extensions/extension.svg"); +} +menuitem[data-l10n-id$="-sync-now"] { + background-image: url("chrome://browser/skin/sync.svg"); +} +#webDeveloperMenu { + background-image: url("chrome://browser/skin/developer.svg"); +} +#menu_taskManager { + background-image: url("chrome://global/skin/icons/performance.svg"); +} +#menu_browserToolbox { + background-image: url("chrome://devtools/skin/images/fox-smiling.svg"); +} +#menu_eyedropper { + background-image: url("chrome://devtools/skin/images/command-eyedropper.svg"); +} +#extensionsForDevelopers { + background-image: url("chrome://activity-stream/content/data/content/assets/glyph-webextension-16.svg"); +} +#menu_pageInfo { + background-image: url("chrome://global/skin/icons/info.svg"); +} +#menu_preferences, +#openSettingsMenuItem { + background-image: url("chrome://global/skin/icons/settings.svg"); +} +#aboutName { + background-image: url("chrome://devtools/skin/images/browsers/firefox.svg"); +} +menuitem[data-l10n-id*="reload-"] { + background-image: url("chrome://browser/skin/reload.svg"); +} +menuitem[id^="context_toggleMute"]:not([soundplaying], [muted]), +menuitem[id^="context_toggleMute"][soundplaying]:not([muted]), +#context-media-mute { + background-image: url("chrome://global/skin/media/audio-muted.svg"); +} +menuitem[id^="context_toggleMute"][muted], +#context-media-unmute { + background-image: url("chrome://global/skin/media/audio.svg"); +} +menuitem[data-l10n-id^="pin-"], +.customize-context-moveToPanel { + background-image: url("chrome://activity-stream/content/data/content/assets/glyph-pin-16.svg"); +} +menuitem[data-l10n-id^="unpin-"], +.customize-context-moveToToolbar { + background-image: url("chrome://activity-stream/content/data/content/assets/glyph-unpin-16.svg"); +} +menuitem[id^="context_duplicateTab"] { + background-image: url('data:image/svg+xml,'); +} +#context_moveTabOptions { + background-image: url('data:image/svg+xml,'); +} +#context_sendTabToDevice, +#context-sendpagetodevice, +#context-sendlinktodevice { + background-image: url("chrome://browser/skin/send-to-device.svg"); +} +:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice-popup) > [clientType="desktop"] { + background-image: url("chrome://browser/skin/device-desktop.svg"); +} +:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice-popup) > [clientType="phone"] { + background-image: url("chrome://browser/skin/device-phone.svg"); +} +:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice-popup) > [clientType="tablet"] { + background-image: url("chrome://browser/skin/device-tablet.svg"); +} +:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice-popup) > [clientType="tv"] { + background-image: url("chrome://browser/skin/device-tv.svg"); +} +:is(#context_sendTabToDevicePopupMenu, #context-sendpagetodevice-popup, #context-sendlinktodevice-popup) > [clientType="vr"] { + background-image: url("chrome://browser/skin/device-vr.svg"); +} +#context_shareTabURL { + background-image: url('data:image/svg+xml,'); +} +#context_reopenInContainer, +#context-openlinkinusercontext-menu { + background-image: url('data:image/svg+xml,'); +} +#context_closeTab, +#orgClose { + background-image: url("chrome://global/skin/icons/close.svg"); +} +#context_closeTabOptions { + background-image: url('data:image/svg+xml,'); +} +menuitem[data-l10n-id="full-screen-exit"] { + background-image: url("chrome://browser/skin/fullscreen-exit.svg"); +} +#paste-and-go { + background-image: url("chrome://browser/skin/forward.svg"); +} +.downloadShowMenuItem { + background-image: url("chrome://global/skin/icons/folder.svg"); +} +#context-pocket, +#context-savelinktopocket { + background-image: url("chrome://browser/skin/pocket-outline.svg"); +} +#context-take-screenshot { + background-image: url("chrome://browser/skin/screenshot.svg"); +} +#context-searchselect[label^="Search Google"] { + background-image: url("chrome://activity-stream/content/data/content/tippytop/favicons/google-com.ico"); +} +#context-searchselect[label^="Search DuckDuckGo"] { + background-image: url("chrome://activity-stream/content/data/content/tippytop/favicons/duckduckgo-com.ico"); +} +#context-inspect-a11y { + background-image: url("chrome://devtools/skin/images/tool-accessibility.svg"); +} +#context-inspect { + background-image: url("chrome://devtools/skin/images/command-pick.svg"); +} +#context-media-play { + background-image: url("chrome://global/skin/media/play-fill.svg"); +} +#context-media-pause, +#doNotDisturbMenuItem { + background-image: url("chrome://global/skin/media/pause-fill.svg"); +} +#context-video-fullscreen { + background-image: url("chrome://global/skin/media/fullscreenEnterButton.svg"); +} +#context-leave-dom-fullscreen { + background-image: url("chrome://global/skin/media/fullscreenExitButton.svg"); +} +#context-video-saveimage { + background-image: url("chrome://devtools/skin/images/command-screenshot.svg"); +} +#disableForOriginMenuItem { + background-image: url("chrome://browser/skin/notification-icons/desktop-notification-blocked.svg"); +} +menuitem[data-l10n-id^="places-edit-"] { + background-image: url("chrome://global/skin/icons/edit.svg"); +} \ No newline at end of file diff --git a/chrome/components/tst-tweaks.css b/chrome/components/tst-tweaks.css new file mode 100644 index 0000000..5c92c08 --- /dev/null +++ b/chrome/components/tst-tweaks.css @@ -0,0 +1,11 @@ +/* removes sidebar header, you can change sidebar content +with keyboard shortcuts, for example ctrl+B for bookmarks menu */ +#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header { + visibility: collapse; +} + +/* removes handle used to change sidebar width, you can modify width +when you open something else in sidebar, for example bookmarks menu */ +#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] + #sidebar-splitter { + display: none !important; +} diff --git a/chrome/components/variables.css b/chrome/components/variables.css new file mode 100644 index 0000000..584b83a --- /dev/null +++ b/chrome/components/variables.css @@ -0,0 +1,53 @@ +/* default variables */ +:root { + --bct-blur: 10px; + + --bct-tab-toolbar-bg: #000000AA; + + + --bct-bg: #00000077; + --bct-color: #F2F2F2; + + + --bct-e-urlbar-bg: var(--bct-bg); + --bct-e-popups-bg: var(--bct-bg); + + + --bct-w-sidebar-bg: var(--bct-bg); + --bct-w-sidebar-color: var(--bct-color); + + /* transparent window variables */ + --bct-main-window: transparent; + --bct-w-pages-bg: var(--bct-bg); + --bct-w-nav-bg: var(--bct-bg); + --bct-w-url-bg: #000000CC; + --bct-w-tab-bg: #00000022; + --bct-w-tab-selected-bg: #77777788; + --bct-moz-appearance: -moz-win-glass !important; +} + +/* light theme */ +:root:-moz-lwtheme-darktext { + --bct-tab-toolbar-bg: #ffffffaa; + + --bct-bg-mt: #ffffff40; + --bct-bg-lt: #ffffff80; + --bct-color: #0A0A0A; + + + --bct-w-sidebar-bg: var(--bct-bg-mt); + --bct-w-sidebar-color: var(--bct-color); + + --bct-e-urlbar-bg: var(--bct-bg-lt); + --bct-e-popups-bg: #ffffffaa; + + /* transparent window variables */ + --bct-w-pages-bg: var(--bct-bg-lt); + --bct-w-nav-bg: var(--bct-bg-lt); + --bct-w-url-bg: var(--bct-bg-mt); +} + +/* dark theme */ +:root:-moz-lwtheme-brighttext { + /* there is nothing here, I treat default theme as dark */ +} diff --git a/chrome/components/window-control-placeholder.css b/chrome/components/window-control-placeholder.css new file mode 100644 index 0000000..28d23f1 --- /dev/null +++ b/chrome/components/window-control-placeholder.css @@ -0,0 +1,40 @@ +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/window_control_placeholder_support.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* Creates placeholders for window controls */ +/* This is a supporting file used by other stylesheets */ + +/* This stylesheet is pretty much unnecessary if window titlebar is enabled */ + +/* This file should preferably be imported before other stylesheets */ + +/* Defaults for window controls on RIGHT side of the window */ +/* Modify these values to match your preferences */ +:root[tabsintitlebar]{ + --uc-window-control-width: 138px; /* Space reserved for window controls */ + --uc-window-drag-space-width: 24px; /* Extra space reserved on both sides of the nav-bar to be able to drag the window */ +} +:root[sizemode="fullscreen"] .titlebar-buttonbox-container{ display: none !important } +:root[sizemode="fullscreen"] #window-controls{ + position: fixed; + display: flex; + top: 0; + right:0; + height: 40px; +} +:root[uidensity="compact"][sizemode="fullscreen"] #window-controls{ height: 32px } +#nav-bar{ + border-inline: var(--uc-window-drag-space-width,0px) solid var(--toolbar-bgcolor); + border-inline-style: solid !important; + border-right-width: calc(var(--uc-window-control-width,0px) + var(--uc-window-drag-space-width,0px)); +} + +/* Use this pref to check Mac OS where window controls are on left */ +/* This pref defaults to true on Mac and doesn't actually do anything on other platforms. So if your system has window controls on LEFT side you can set the pref to true */ +@supports -moz-bool-pref("layout.css.osx-font-smoothing.enabled"){ + :root{ --uc-window-control-width: 72px; } + :root[tabsintitlebar="true"]:not([inFullscreen]) #nav-bar{ + border-inline-width: calc(var(--uc-window-control-width,0px) + var(--uc-window-drag-space-width,0px)) var(--uc-window-drag-space-width,0px) + } +} + diff --git a/chrome/components/window-transparencies.css b/chrome/components/window-transparencies.css new file mode 100644 index 0000000..142b8bc --- /dev/null +++ b/chrome/components/window-transparencies.css @@ -0,0 +1,53 @@ +/* window transparencies */ +#main-window { + background: var(--bct-main-window) !important; + -moz-appearance: var(--bct-moz-appearance) !important; +} +/* customization page */ +#customization-container { + background: var(--bct-w-pages-bg) !important; +} +/* blank page */ +#tabbrowser-tabpanels{ + background: var(--bct-w-pages-bg) !important; +} + +/* navbar / tabbar / titlebar */ +#nav-bar { + background: transparent !important; + border-color: transparent !important; +} +#navigator-toolbox { + background: var(--bct-w-nav-bg) !important; + border: none !important; +} +#urlbar-background { + background: var(--bct-w-url-bg) !important; +} + +#TabsToolbar, #titlebar { + background: var(--bct-w-tab-bg) !important; + appearance: none; + -moz-appearance: none !important; + box-shadow: none !important; + border: none !important; +} + +.tab-background[selected="true"] { + background: var(--bct-w-tab-selected-bg) !important; +} + + +/* Sidebar */ +#sidebar-box, +#sidebar-box:-moz-lwtheme-darktext, +#sidebar-box:-moz-lwtheme-brighttext { + --sidebar-background-color: var(--bct-w-sidebar-bg) !important; + --sidebar-text-color: var(--bct-w-sidebar-color) !important; + background: var(--bct-w-sidebar-bg) !important; + +} +#sidebar, +.sidebar-panel { + background: transparent !important; +} diff --git a/chrome/userChrome.css b/chrome/userChrome.css new file mode 100644 index 0000000..f8d7e47 --- /dev/null +++ b/chrome/userChrome.css @@ -0,0 +1,19 @@ +/* variables used in styling */ +@import url('components/variables.css'); + +/* optional styles for TST, +hide tabbar and move addressbar to the top */ +/* @import url('components/window-control-placeholder.css'); */ +/* @import url('components/hide-tabbar.css'); */ + +/* icons in menu */ +@import url('components/menu-icons.css'); + +/* transparencies for browser elements (popups mostly) */ +@import url('components/elements-transparencies.css'); + +/* optional transparencies for window (broken on non GNU/linux systems) */ +@import url('components/window-transparencies.css'); + +/* optional TST tweaks */ +/* @import url('components/tst-tweaks.css'); */ diff --git a/chrome/userContent.css b/chrome/userContent.css new file mode 100644 index 0000000..c7c613f --- /dev/null +++ b/chrome/userContent.css @@ -0,0 +1,8 @@ +@import url('components/variables.css'); + +/* Removes the white loading page */ +@-moz-document url(about:blank) { + html:not(#ublock0-epicker), html:not(#ublock0-epicker) body, #newtab-customize-overlay { + background: var(--bct-w-pages-bg) !important; + } +} diff --git a/foxtheme.sh b/foxtheme.sh new file mode 100755 index 0000000..21576ba --- /dev/null +++ b/foxtheme.sh @@ -0,0 +1,77 @@ +#!/bin/sh + +SCRIPTLOCATION=$(dirname -- "$(readlink -f "$0")") +[ -d "$SCRIPTLOCATION" ] || { echo "$0: Could not verify script location as an existing directory. This is probably a bug."; exit 2; } +[ -d "$SCRIPTLOCATION"/chrome ] || { echo "$0: Could not proceed with installation as 'chrome' directory is missing from '$SCRIPTLOCATION'."; exit 2; } +[ -f "$SCRIPTLOCATION"/user.js ] || { echo "$0: Could not proceed with installation as 'user.js' file is missing from '$SCRIPTLOCATION'."; exit 2; } + +helptext() { + echo "Usage: ./foxtheme.sh [OPTIONS] [PROFILE | -a PROFILESDIR] " + echo "-a Apply theme to all (current) browser profiles" + echo "-j Just create or modify user.js and not user-overrides.js" + echo "-o Remove and replace an existing theme if found" + echo "-h Display this help message" +} + +installtoprofile() { + targetprofile="$1" + [ -d "$targetprofile" ] || { echo "$0: Profile at '$targetprofile' does not exist"; exit 2; } + [ -d "$targetprofile/chrome/" ] && { + [ "$OVERWRITE" ] || { echo "$0: A theme for this profile '${targetprofile}/chrome/' already exists. Pass -o to overwrite existing themes."; exit 2; } + rm -r "${targetprofile:?}/chrome/" + } + cp -r "${SCRIPTLOCATION}/chrome/" "${targetprofile}/" + cat "${SCRIPTLOCATION}/user.js" >> "${targetprofile:?}/user.js" + [ "$NOOVERRIDE" ] || cat "${SCRIPTLOCATION}/user.js" >> "${targetprofile:?}/user-overrides.js" + echo "Successfully installed to '${targetprofile}'" +} + +while getopts "ajoh" opt; do + case $opt in + a) + ALL=1 + ;; + j) + NOOVERRIDE=1 + ;; + o) + OVERWRITE=1 + ;; + h) + helptext + exit + ;; + *) + helptext + exit 2 + ;; + esac +done + +[ -z "$*" ] && { helptext; exit; } +shift $((OPTIND -1)) + +[ "$2" ] && { echo "$0: Too many arguments"; helptext; exit 2; } + +[ -d "$1" ] || { echo "$0: '$1' is not a valid directory"; helptext; exit 2; } + +arg="$1" + +if [ "$ALL" ]; then + profilesdir=$(realpath "$arg") + [ -f "$profilesdir"/installs.ini ] && [ -f "$profilesdir"/profiles.ini ] || { echo "$0: '$profilesdir' does not appear to be a valid Firefox (or derivative) profiles directory (could not find 'profiles.ini' or 'installs.ini'). Run without the -a option if you intended to apply the theme to only a single profile."; exit 2; } + IFS_=$IFS + IFS=" + " + profiles=$(grep "^Path=" "$profilesdir/profiles.ini" | sed "s/^Path=//") + for profile in $profiles; do + installtoprofile "$profilesdir/$profile" + done + IFS=$IFS_ +else + profile=$(realpath "$arg") + [ -f "$profile/times.json" ] || { echo "$0: '$profile' does not appear to be a valid Firefox (or derivative) profile directory (could not find 'times.json')."; exit 2; } + installtoprofile "$profile" +fi + +echo "All done." diff --git a/user.js b/user.js new file mode 100644 index 0000000..274f2b0 --- /dev/null +++ b/user.js @@ -0,0 +1,6 @@ +user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); +user_pref("layers.acceleration.force-enabled", true); +user_pref("gfx.webrender.all", true); +user_pref("gfx.webrender.enabled", true); +user_pref("svg.context-properties.content.enabled", true); +user_pref("layout.css.backdrop-filter.enabled", true);