diff --git a/flake.lock b/flake.lock index 1d5ba9c..4bcb2a1 100644 --- a/flake.lock +++ b/flake.lock @@ -137,6 +137,21 @@ "type": "indirect" } }, + "nur": { + "locked": { + "lastModified": 1687838990, + "narHash": "sha256-pIXsJaH12VL5Zcu5UHEZg7wGFNVwFhSlhK8rhacwG/o=", + "owner": "nix-community", + "repo": "NUR", + "rev": "97f9d34d27b1e74b9ae891828938ba04136ff44c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", @@ -144,6 +159,7 @@ "hyprland-hy3": "hyprland-hy3", "hyprpaper": "hyprpaper", "nixpkgs": "nixpkgs", + "nur": "nur", "rust-overlay": "rust-overlay", "stable": "stable" } diff --git a/flake.nix b/flake.nix index 5ee8b49..a0029ed 100755 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,8 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nur.url = "github:nix-community/NUR"; + # devenv rust-overlay = { url = "github:oxalica/rust-overlay"; diff --git a/modules/devenv/flake.nix b/modules/devenv/flake.nix index 130e909..66da17d 100644 --- a/modules/devenv/flake.nix +++ b/modules/devenv/flake.nix @@ -24,6 +24,8 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nur.url = "github:nix-community/NUR"; + # devenv rust-overlay = { url = "github:oxalica/rust-overlay"; diff --git a/modules/overlay-pkgs/default.nix b/modules/overlay-pkgs/default.nix index 2bbc392..a70a1a3 100644 --- a/modules/overlay-pkgs/default.nix +++ b/modules/overlay-pkgs/default.nix @@ -1,6 +1,10 @@ -{ - nixpkgs.overlays = [(final: prev: { - kwrite = final.callPackage ./kwrite.nix {}; - qt5ct = final.callPackage ./qt5ct {}; - })]; +{ inputs, ... }: { + nixpkgs.overlays = [ + inputs.nur.overlay + + (final: prev: { + kwrite = final.callPackage ./kwrite.nix {}; + qt5ct = final.callPackage ./qt5ct {}; + }) + ]; } diff --git a/modules/user/general.nix b/modules/user/general.nix index 87be530..f9ebcfc 100644 --- a/modules/user/general.nix +++ b/modules/user/general.nix @@ -5,6 +5,7 @@ imports = [ ./modules/wofi ./modules/dolphin + ./modules/firefox ]; home.packages = with pkgs; [ diff --git a/modules/user/modules/firefox/default.nix b/modules/user/modules/firefox/default.nix new file mode 100755 index 0000000..57e830d --- /dev/null +++ b/modules/user/modules/firefox/default.nix @@ -0,0 +1,106 @@ +{ lib, pkgs, ... }@inputs: +let + inherit (import ./prefgroups.nix inputs) modules prefgroups; + + extra-addons = let + buildFirefoxXpiAddon = lib.makeOverridable ({ + stdenv ? pkgs.stdenv, + fetchurl ? pkgs.fetchurl, + pname, + version, + addonId, + url, + sha256, + ... + }: stdenv.mkDerivation { + name = "${pname}-${version}"; + + src = fetchurl { inherit url sha256; }; + + preferLocalBuild = true; + allowSubstitutes = true; + + buildCommand = '' + dst="$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" + mkdir -p "$dst" + install -v -m644 "$src" "$dst/${addonId}.xpi" + ''; + }); + in { + github-reposize = buildFirefoxXpiAddon { + pname = "github-reposize"; + version = "1.7.0"; + addonId = "github-repo-size@mattelrah.com"; + url = "https://addons.mozilla.org/firefox/downloads/file/3854469/github_repo_size-1.7.0.xpi"; + sha256 = "2zGY12esYusaw2IzXM+1kP0B/0Urxu0yj7xXlDlutto="; + }; + vencord = buildFirefoxXpiAddon { + pname = "vencord"; + version = "1.2.7"; + addonId = "vencord-firefox@vendicated.dev"; + url = "https://addons.mozilla.org/firefox/downloads/file/4123132/vencord_web-1.2.7.xpi"; + sha256 = "A/XKdT0EuDHsQ7mcK9hsXAoAJYUt4Uvp/rtCf/9dAS0="; + }; + }; +in { + programs.firefox = { + enable = true; + + package = pkgs.firefox.overrideAttrs (pkg: let + imEntry = pkg.desktopItem.override (entry: { + name = "discord-firefox"; + desktopName = "IMs (Firefox)"; + exec = "${entry.exec} -no-remote -P Im"; + mimeTypes = []; + }); + in { + buildCommand = '' + ${pkg.buildCommand} + cp ${imEntry}/share/applications/* $out/share/applications + ''; + }); + + profiles = { + base = { + id = 1; + name = "BaseFF"; + userChrome = builtins.readFile ./sideberry_chrome.css; + }; + default = { + id = 0; + name = "Default"; + userChrome = '' + ${builtins.readFile ./sideberry_chrome.css} + ${builtins.readFile ./sideberry_hide_ext_button.css} + ''; + settings = with modules; {} + // base + // minor-1 + // annoying; + + extensions = with pkgs.nur.repos.rycee.firefox-addons; with extra-addons; [ + bitwarden + darkreader + github-reposize + sidebery + simplelogin + sponsorblock + ublock-origin + umatrix + ]; + }; + im = { + id = 2; + name = "Im"; + userChrome = builtins.readFile ./inline_tabs_chrome.css; + settings = modules.base + // prefgroups.misc.restore-pages; + + extensions = with pkgs.nur.repos.rycee.firefox-addons; with extra-addons; [ + ublock-origin + vencord + ]; + }; + }; + }; +} diff --git a/modules/user/modules/firefox/inline_tabs_chrome.css b/modules/user/modules/firefox/inline_tabs_chrome.css new file mode 100644 index 0000000..4c795e1 --- /dev/null +++ b/modules/user/modules/firefox/inline_tabs_chrome.css @@ -0,0 +1,60 @@ +/* Title bar */ +.titlebar-buttonbox { + display: none !important; +} + +.titlebar-spacer { + display: none !important; +} + +/* Tab bar */ +#navigator-toolbox { + border: 0px !important; +} + +#TabsToolbar { + margin-left: 40vw !important; +} + +/* Nav bar*/ +#nav-bar { + background: transparent !important; + margin-top: -42px !important; + margin-bottom: 1px !important; + margin-right: 60vw !important; +} + +/* URL bar */ +#back-button { + display: none !important; +} + +#forward-button { + display: none !important; +} + +#tracking-protection-icon-container { + display: none !important; +} + +#urlbar-container { + min-width: 100px !important; +} + +#urlbar { + background: transparent !important; + border: none !important; + box-shadow: none !important; +} + +#page-action-buttons { + display: none !important; +} + +#PanelUI-button { + display: none !important; +} + +#unified-extensions-button { + display: none; +} diff --git a/modules/user/modules/firefox/prefgroups.nix b/modules/user/modules/firefox/prefgroups.nix new file mode 100644 index 0000000..fe0536c --- /dev/null +++ b/modules/user/modules/firefox/prefgroups.nix @@ -0,0 +1,569 @@ +{ lib, ... }: +rec { + prefgroups = { + base = { + "browser.aboutConfig.showWarning" = false; + "browser.startup.homepage_override.mstone" = "ignore"; + # "browser.startup.homepage" = "about:newtab"; + # "browser.newtab.preload" = false; + + # Show whole url + "browser.urlbar.trimURLs" = false; + + # disable disk cache to preserve ssd + "browser.cache.disk.enable" = false; + "browser.sessionstore.interval" = 6000000; + + "widget.gtk.overlay-scrollbars.enabled" = false; + + # disable the nag icon in the corner + "browser.tabs.firefox-view" = false; + + # disable plugin signing requirements + "xpinstall.signatures.required" = false; + "xpinstall.whitelist.required" = false; + }; + + security = { + disable-form-autofill = { + "browser.formfill.enable" = false; + "extensions.formautofill.available" = "off"; + "extensions.formautofill.addresses.enabled" = false; + "extensions.formautofill.creditCards.available" = false; + "extensions.formautofill.creditCards.enabled" = false; + "extensions.formautofill.heuristics.enabled" = false; + }; + + disable-password-manager = { + # Just in case its somehow enabled + "security.ask_for_password" = 1; + "security.password_lifetime" = 0; + + "signon.autofillForms" = false; + "signon.formlessCapture.enabled" = false; + + "signon.rememberSignons" = false; + }; + + # UNTESTED + disable-cross-origin-auth-dialogs = { + "network.auth.subresource-http-auth-allow" = 1; + }; + + disable-tls-mitm = { + "security.ssl.require_safe_negotiation" = true; + "security.tls.enable_0rtt_data" = false; + }; + + certificate = { + validity = { + "security.OCSP.enabled" = 1; + "security.OCSP.require" = true; + + # CRLite (external service, any concernes unknown?) - certificate revocation + "security.remote_settings.crlite_filters.enabled" = true; + "security.pki.crlite_mode" = 2; + + # Firefox certificate blocklist + "extensions.blocklist.enabled" = true; + + }; + + # Disabled local MITM on certificates (Fiddler, AV, etc) + enforcement = { + "security.pki.sha1_enforcement_level" = 1; + "security.cert_pinning.enforcement_level" = 2; + }; + }; + + # HTTP resources on HTTPS pages + disable-http-resources = { + "security.mixed_content.block_display_content" = false; + "dom.security.https_only_mode" = true; + "dom.security.https_only_mode_send_http_background_request" = false; + }; + + # Display more and better warning information (+ advanced info) for SSL + ssl-ui = { + "security.ssl.treat_unsafe_negotiation_as_broken" = true; + "browser.ssl_override_behavior" = 1; + "browser.xul.error_pages.expert_bad_cert" = true; + }; + + cross-origin = { + trimming = { + "network.http.referer.XOriginTrimmingPolicy" = 2; + }; + + same-host = { + "network.http.referer.XOriginPolicy" = 2; + }; + + same-domain = { + "network.http.referer.XOriginPolicy" = 1; + }; + }; + + # No real reason to ever have this enabled + disable-uitour = { + "browser.uitour.enabled" = false; + "browser.uitour.url" = ""; + }; + + disable-middlemouse-paste = { + "middlemouse.paste" = false; + + # With this one enabled, just middleclicking will go to the url in clipboard + "middlemouse.contentLoadURL" = false; + }; + + # Punycode can be used to make fake domain names + show-punycode = { + "network.IDN_show_punycode" = true; + }; + + use-pdfjs = { + "pdfjs.disabled" = false; + "pdfjs.enableScripting" = false; + }; + + # Applies to cross origin permission requests + disable-permission-delegation = { + "permissions.delegation.enabled" = false; + }; + + # Only allow extionsions installed in profile + lockdown-extension-dirs = { + "extensions.enabledScopes" = 5; + "extensions.autoDisableScopes" = 15; + }; + + always-ask-extension-install = { + "extensions.postDownloadThirdPartyPrompt" = false; + }; + + # UNTESTED/UNKNOWN + remove-webchannel-whitelist = { + "webchannel.allowObject.urlWhitelist" = ""; + }; + + # Remove extra permissions on mozilla pages + remove-mozilla-permissions = { + "permissions.manager.defaultsUrl" = ""; + }; + + # Enable ETP Strict mode + # Enable Total Cookie Protection (xss cookie protection) + etp-strict = { + "browser.contentblocking.category" = "strict"; + + # Disable compat features + # "privacy.antitracking.enableWebcompat" = false; + }; + + # UNTESTED + partition-serviceworkers = { + "privacy.partition.serviceWorkers" = true; + }; + + disable-system-ui = { + "browser.display.use_system_colors" = false; + "widget.non-native-theme.enabled" = true; + }; + + disable-webgl = { + "webgl.disabled" = true; + }; + + disable-sessionrestore = { + "browser.sessionstore.resume_from_crash" = false; + }; + + # Yoinked from arkenfox/user.js + enforce-defaults = { + "network.http.referer.spoofSource" = false; + "dom.targetBlankNoOpener.enabled" = true; + "privacy.window.name.update.enabled" = true; + "dom.storage.next_gen" = true; + "privacy.firstparty.isolate" = false; + "extensions.webcompat.enable_shims" = true; + "security.tls.version.enable-deprecated" = false; + "extensions.webcompat-reporter.enabled" = false; + }; + disable-js-jit = { + "javascript.options.baselinejit" = false; + "javascript.options.ion" = false; + "javascript.options.wasm" = false; + "javascript.options.asmjs" = false; + }; + }; + + privacy = { + disable-activity-stream = { + "browser.newtabpage.activity-stream.telemetry" = false; + "browser.newtabpage.activity-stream.feeds.telemetry" = false; + "browser.newtabpage.activity-stream.feeds.snippets" = false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.feeds.discoverystreamfeed" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.activity-stream.feeds.topsites" = false; + "browser.newtabpage.activity-stream.asrouter.userprefs.cfg.addons" = false; + "browser.newtabpage.activity-stream.asrouter.userprefs.cfg.features" = false; + + # Remove default sites + "browser.newtabpage.activity-stream.default.sites" = ""; + }; + + geolocation = { + # Use mozilla's location provider over google's + "geo.provider.network.url" = "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%"; + + # Disable OS geolocation services + "geo.provider.use_gpsd" = false; + + # Disable region + "browser.region.network.url" = ""; + "browser.region.update.enabled" = false; + + # Languages + "intl.accept_languages" = "en-US, en"; + "javascript.use_us_english_locale" = true; + }; + + # Uses google analytics + disable-addon-reccomendation = { + "extensions.getAddons.showPane" = false; + "extensions.htmlaboutaddons.recommendations.enabled" = false; + "browser.discovery.enabled" = false; + }; + + disable-mozilla-telemetry = { + "datareporting.policy.dataSubmissionEnabled" = false; + "datareporting.healthreport.uploadEnabled" = false; + "toolkit.telemetry.unified" = false; + "toolkit.telemetry.enabled" = false; + "toolkit.telemetry.server" = "data:,"; + "toolkit.telemetry.archive.enabled" = false; + "toolkit.telemetry.newProfilePing.enabled" = false; + "toolkit.telemetry.shutdownPingSender.enabled" = false; + "toolkit.telemetry.updatePing.enabled" = false; + "toolkit.telemetry.bhrPing.enabled" = false; + "toolkit.telemetry.firstShutdownPing.enabled" = false; + "toolkit.telemetry.coverage.opt-out" = true; + "toolkit.coverage.opt-out" = true; + "toolkit.coverage.endpoint.base" = ""; + "browser.ping-centre.telemetry" = false; + "toolkit.telemetry.pioneer-new-studies-available" = false; + + "devtools.onboarding.telemetry.logged" = false; + }; + + disable-studies = { + "app.shield.optoutstudies.enabled" = false; + "app.normandy.enabled" = false; + "app.normandy.api_url" = ""; + }; + + disable-crash-reports = { + "breakpad.reportURL" = ""; + "browser.tabs.crashReporting.sendReport" = false; + "browser.crashReports.unsubmittedCheck.autoSubmit2" = false; + }; + + # Impact unchecked (public wifi captive portals) + disable-captive-portals = { + "captivedetect.canonicalURL" = ""; + "network.captive-portal-service.enabled" = false; + "network.connectivity-service.enabled" = false; + }; + + # Calls back to google + disable-safebrowsing = { + "browser.safebrowsing.downloads.enabled" = false; + + # May be blocked by `downloads.enabled` already + "browser.safebrowsing.downloads.remote.enabled" = false; + "browser.safebrowsing.downloads.remote.url" = ""; + "browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false; + "browser.safebrowsing.downloads.remote.block_uncommon" = false; + + "browser.safebrowsing.malware.enabled" = false; + "browser.safebrowsing.phishing.enabled" = false; + }; + + disable-speculative-connections = { + "browser.places.speculativeConnect.enabled" = false; + "browser.urlbar.speculativeConnect.enabled" = false; + }; + + disable-search-corrections = { + "keyword.enabled" = false; + + # Adds www. or .com + "browser.fixup.alternate.enabled" = false; + }; + + disable-search-suggestions = { + "browser.search.suggest.enabled" = false; + "browser.urlbar.suggest.searches" = false; + "browser.urlbar.suggest.quicksuggest.nonsponsored" = false; + "browser.urlbar.suggest.quicksuggest.sponsored" = false; + }; + + disable-dns-query-leak = { + "browser.urlbar.dnsResolveSingleWordsAfterSearch" = false; + }; + + webrtc = { + # Untrusted = no camera/mic granted + hide-ip-untrusted = { + "media.peerconnection.ice.proxy_only_if_behind_proxy" = true; + "media.peerconnection.ice.default_address_only" = true; + }; + + hide-ip-trusted = { + "media.peerconnection.ice.no_host" = true; + }; + + disable = { + "media.peerconnection.enabled" = false; + "media.navigator.enabled" = false; + }; + }; + + disable-accessability = { + "accessibility.force_disabled" = 1; + }; + + # Intended for analytics + disable-beacon = { + "beacon.enabled" = false; + }; + + # Clear cookies on exit + ephemeral-cookies = { + "network.cookie.lifetimePolicy" = 2; + "network.cookie.thirdparty.sessionOnly" = true; + "network.cookie.thirdparty.nonsecureSessionOnly" = true; + }; + + sanitize-on-shutdown = { + "privacy.sanitize.sanitizeOnShutdown" = true; + "privacy.clearOnShutdown.cache" = true; + "privacy.clearOnShutdown.downloads" = true; + "privacy.clearOnShutdown.formdata" = true; + "privacy.clearOnShutdown.history" = true; + "privacy.clearOnShutdown.sessions" = true; + + "privacy.cpd.cache" = true; + "privacy.cpd.formdata" = true; + "privacy.cpd.history" = true; + "privacy.cpd.sessions" = true; + + # Disabled because they have to be explicitly allowed per site + "privacy.clearOnShutdown.offlineApps" = false; + "privacy.clearOnShutdown.cookies" = false; + + "privacy.cpd.offlineApps" = false; + "privacy.cpd.cookies" = false; + + "privacy.sanitize.timeSpan" = 0; + }; + + resist-fingerprinting = { + "privacy.resistFingerprinting" = true; + }; + + # Snap window resizing (tor browser does this) + letterboxing = { + "privacy.resistFingerprinting.letterboxing" = true; + }; + + # Can break login pages + # Correction: Breaks a lot of shit. A LOT of shit. + disable-referrer-headers = { + "network.http.sendRefererHeader" = 0; + }; + }; + + misc = { + disable-mozilla-account = { + "identity.fxaccounts.enabled" = false; + }; + + disable-pocket = { + "extensions.pocket.enabled" = false; + }; + + container-tabs = { + "privacy.userContext.enabled" = true; + "privacy.userContext.ui.enabled" = true; + + # Make default + tab action + # "privacy.userContext.newTabContainerOnLeftClick.enabled" = true; + }; + + # Prefetching may make sites faster, but also causes unwanted background downloads + disable-prefetching = { + "network.prefetch-next" = false; + "network.dns.disablePrefetch" = true; + "network.predictor.enabled" = false; + "network.predictor.enable-prefetch" = false; + "network.http.speculative-parallel-limit" = 0; + }; + + disable-drm = { + "media.eme.enabled" = false; + }; + + disable-autoplay = { + "media.autoplay.default" = 5; + "media.autoplay.blocking_policy" = 2; + }; + + # Disallow sites resizing or moving the browser window + disable-window-manipulation = { + "dom.disable_window_move_resize" = true; + }; + + limited-popups = { + "dom.disable_open_during_load" = false; + "dom.popup_allowed_events" = "click dblclick mousedown pointerdown"; + }; + + ask-downloads = { + "browser.download.useDownloadDir" = false; + + # Disable panel opening, lumped together + "browser.download.alwaysOpenPanel" = false; + }; + + ask-new-mimetypes = { + "browser.download.always_ask_before_handling_new_types" = true; + }; + + # Disable js opening new windows + always-newtab = { + "browser.link.open_newwindow" = 3; + "browser.link.open_newwindow.restriction" = 0; + }; + + # Stop save dialog delay + reduce-dialog-delay = { + # Still 500 to be less annoying, while avoiding click hijacking + "security.dialog_enable_delay" = 500; + }; + + # Handled by nix already + disable-extension-updates = { + "extensions.update.enabled" = false; + "extensions.update.autoUpdateDefault" = false; + }; + + always-show-downloads = { + "browser.download.autohideButton" = false; + }; + + bookmark-new-tab = { + "browser.tabs.loadBookmarksInTabs" = true; + }; + + enable-userchrome = { + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + }; + + restore-pages = { + "browser.startup.page" = 3; + }; + + hide-bookmark-bar = { + "browser.toolbars.bookmarks.visibility" = "never"; + }; + + default-dark-theme = { + "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; + "layout.css.prefers-color-scheme.content-override" = 0; + }; + }; + }; + + modules = with prefgroups; { + base = {} + // base + // misc.disable-mozilla-account + // misc.container-tabs + // privacy.disable-activity-stream + // privacy.disable-addon-reccomendation + // privacy.disable-mozilla-telemetry + // privacy.disable-studies + // privacy.disable-crash-reports + // privacy.disable-safebrowsing + // privacy.disable-dns-query-leak + // security.disable-form-autofill + // security.disable-password-manager + // security.disable-cross-origin-auth-dialogs + // security.disable-tls-mitm + // security.certificate.validity + // security.certificate.enforcement + // security.ssl-ui + // privacy.webrtc.hide-ip-untrusted + // misc.disable-drm + // misc.disable-autoplay + // misc.disable-window-manipulation + // misc.limited-popups + // privacy.disable-accessability + // privacy.disable-beacon + // security.disable-uitour + // security.disable-middlemouse-paste + // security.show-punycode + // security.use-pdfjs + // security.disable-permission-delegation + // misc.ask-downloads + // misc.ask-new-mimetypes + // security.lockdown-extension-dirs + // security.always-ask-extension-install + // security.remove-mozilla-permissions + // security.partition-serviceworkers + // misc.always-newtab + // misc.reduce-dialog-delay + // security.enforce-defaults + // misc.bookmark-new-tab + // misc.disable-pocket + // misc.always-show-downloads + // misc.enable-userchrome + // misc.hide-bookmark-bar + // misc.default-dark-theme + ; + + # Minor breakage / inconvenience + minor-1 = {} + // misc.disable-prefetching + // privacy.disable-captive-portals + // privacy.disable-search-suggestions + // security.disable-http-resources + // security.cross-origin.trimming + // security.cross-origin.same-host + // security.remove-webchannel-whitelist + // security.etp-strict + // privacy.sanitize-on-shutdown + // privacy.resist-fingerprinting + // security.disable-system-ui + // security.disable-webgl + // security.disable-sessionrestore + // security.disable-js-jit + ; + + annoying = {} + // privacy.webrtc.hide-ip-trusted + // privacy.ephemeral-cookies + // privacy.webrtc.disable + # // privacy.disable-referrer-headers + ; + }; + + mkUserJs = prefs: lib.concatStrings (lib.mapAttrsToList (name: value: '' + user_pref("${name}", "${builtins.toJSON value}"); + '') prefs); +} diff --git a/modules/user/modules/firefox/sideberry_chrome.css b/modules/user/modules/firefox/sideberry_chrome.css new file mode 100755 index 0000000..58d9457 --- /dev/null +++ b/modules/user/modules/firefox/sideberry_chrome.css @@ -0,0 +1,166 @@ +/* Sidebery */ +#main-window[titlepreface*="​​​​​"] .tabbrowser-tab { + visibility: collapse; +} + +#main-window[titlepreface*="​​​​​"] .titlebar-button { + height: 40px; +} + +#main-window[titlepreface*="​​​​​"] #nav-bar { + margin-top: -40px; +} +#main-window[titlepreface*="​​​​​"][tabsintitlebar="true"] #nav-bar { + margin-right: 137px; +} +#main-window[titlepreface*="​​​​​"] #titlebar-spacer { + background-color: var(--chrome-secondary-background-color); +} + +#main-window[titlepreface*="​​​​​"] #titlebar-buttonbox-container { + background-color: var(--chrome-secondary-background-color); +} + +#main-window[titlepreface*="​​​​​"] .titlebar-color { + background-color: var(--toolbar-bgcolor); +} + +#sidebar-box #sidebar-header { + visibility: collapse; +} + +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_sidebar.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* Show sidebar only when the cursor is over it */ +/* The border controlling sidebar width will be removed so you'll need to modify these values to change width */ + +#sidebar-box { + --uc-sidebar-width: 47px; + --uc-sidebar-hover-width: 232px; + --uc-autohide-sidebar-delay: 050ms; /* Wait 0.6s before hiding sidebar */ + position: relative; + min-width: var(--uc-sidebar-width) !important; + width: var(--uc-sidebar-width) !important; + max-width: var(--uc-sidebar-width) !important; + z-index:1; + margin-top: -1px; +} + +#sidebar-box[positionend] { + direction: rtl; +} +#sidebar-box[positionend] > *{ + direction: ltr; +} + +#sidebar-box[positionend]:-moz-locale-dir(rtl){ + direction: ltr; +} +#sidebar-box[positionend]:-moz-locale-dir(rtl) > *{ + direction: rtl; +} + +#sidebar-box > #sidebar { + transition: min-width 115ms linear !important; + min-width: var(--uc-sidebar-width) !important; + will-change: min-width; +} + +#sidebar-box:hover > #sidebar { + min-width: var(--uc-sidebar-hover-width) !important; + transition: min-width 100ms linear var(--uc-autohide-sidebar-delay), box-shadow 500ms linear !important; + box-shadow: 0 0 4px rgba(10,10,10, .5); + clip-path: inset(0px -15px 0px -15px); +} + +/* Add sidebar divider and give it background */ + +#sidebar, +#sidebar-header { + background-color: var(--toolbar-bgcolor) !important; + border-inline: 1px solid var(--chrome-content-separator-color); + border-inline-width: 0px 1px; +} + +#sidebar-box:not([positionend]) > :-moz-locale-dir(rtl), +#sidebar-box[positionend] > * { + border-inline-width: 1px 0px; +} + +/* Move statuspanel to the other side when sidebar is hovered so it doesn't get covered by sidebar */ + +#sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel { + inset-inline: auto 0px !important; +} +#sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel-label { + margin-inline: 0px !important; + border-left-style: solid !important; +} +#sidebar-splitter{ + width: 0px !important; + background-color: #f00 !important; + border: none !important; +} + +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_bookmarks_toolbar.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +#PersonalToolbar{ + --uc-bm-height: 20px; /* Might need to adjust if the toolbar has other buttons */ + --uc-bm-padding: 7px; /* Vertical padding to be applied to bookmarks */ + --uc-autohide-toolbar-delay: 600ms; /* The toolbar is hidden after 0.6s */ + + /* 0deg = "show" ; 90deg = "hide" ; Set the following to control when bookmarks are shown */ + --uc-autohide-toolbar-focus-rotation: 0deg; /* urlbar is focused */ + --uc-autohide-toolbar-hover-rotation: 0deg; /* cursor is over the toolbar area */ +} + +:root[uidensity="compact"] #PersonalToolbar{ --uc-bm-padding: 1px; } +:root[uidensity="touch"] #PersonalToolbar{ --uc-bm-padding: 7px } + +#PersonalToolbar:not([customizing]){ + position: relative; + margin-bottom: calc(0px - var(--uc-bm-height) - 2 * var(--uc-bm-padding)); + transform: rotateX(90deg); + transform-origin: top; + transition: transform 135ms linear var(--uc-autohide-toolbar-delay) !important; + z-index: 1; + /* The following properties should allow the themes with trasparent toolbars to work */ + background-color: transparent !important; + background-repeat: no-repeat,no-repeat,var(--lwt-background-tiling); + --uc-bg-y: calc(-2 * (var(--tab-block-margin) + var(--toolbarbutton-inner-padding) + var(--toolbarbutton-outer-padding)) - var(--tab-min-height) - 16px - var(--bookmark-block-padding)); + background-position: top left,top left,var(--lwt-background-alignment,top left); + background-position-y:top,top,var(--uc-bg-y),var(--uc-bg-y),var(--uc-bg-y); + background-image: var(--toolbar-bgimage), linear-gradient(var(--toolbar-bgcolor),var(--toolbar-bgcolor)),var(--lwt-header-image,var(--lwt-additional-images)) !important; +} + +#PlacesToolbarItems > .bookmark-item, +#OtherBookmarks, +#PersonalToolbar > #import-button{ + padding-block: var(--uc-bm-padding) !important; +} + +#nav-bar:focus-within + #PersonalToolbar{ + transition-delay: 100ms !important; + transform: rotateX(var(--uc-autohide-toolbar-focus-rotation,0)); +} + +#navigator-toolbox:hover > #PersonalToolbar{ + transition-delay: 100ms !important; + transform: rotateX(var(--uc-autohide-toolbar-hover-rotation,0)); +} + +#navigator-toolbox:hover > #nav-bar:focus-within + #PersonalToolbar { + transform: rotateX(0); +} + +/* Uncomment to enable compatibility for multi-row_bookmarks.css */ +/* This would break buttons placed in the toolbar but that is likely not happening if you are using multi-row setup */ +/* +#PersonalToolbar:not([customizing]){ + position: fixed; + display: block; + margin-bottom: 0px !important; +} +*/ diff --git a/modules/user/modules/firefox/sideberry_hide_ext_button.css b/modules/user/modules/firefox/sideberry_hide_ext_button.css new file mode 100644 index 0000000..d9d61b6 --- /dev/null +++ b/modules/user/modules/firefox/sideberry_hide_ext_button.css @@ -0,0 +1,3 @@ +#main-window[titlepreface*="​​​​​"] #unified-extensions-button { + display: none; +} diff --git a/modules/user/modules/firefox/sideberry_settings.json b/modules/user/modules/firefox/sideberry_settings.json new file mode 100644 index 0000000..fcd5cfa --- /dev/null +++ b/modules/user/modules/firefox/sideberry_settings.json @@ -0,0 +1 @@ +{"panels_v4":[{"type":"bookmarks","id":"bookmarks","cookieStoreId":"bookmarks","name":"Bookmarks","icon":"icon_bookmarks","bookmarks":true,"lockedPanel":false,"skipOnSwitching":false},{"type":"default","id":"firefox-default","name":"Default","icon":"icon_tabs","cookieStoreId":"firefox-default","lockedTabs":false,"lockedPanel":false,"skipOnSwitching":false,"noEmpty":false,"newTabCtx":"none","dropTabCtx":"none","moveTabCtx":"none","moveTabCtxNoChild":true}],"settings":{"version":"4.10.2","nativeScrollbars":false,"selWinScreenshots":true,"tabsCheck":true,"tabsFix":"notify","markWindow":true,"markWindowPreface":"​​​​​","ctxMenuNative":false,"autoHideCtxMenu":"none","ctxMenuRenderInact":true,"ctxMenuIgnoreContainers":"","navBarLayout":"hidden","navBarInline":false,"hideAddBtn":false,"hideSettingsBtn":false,"navBtnCount":true,"hideEmptyPanels":true,"navActTabsPanelLeftClickAction":"none","navActBookmarksPanelLeftClickAction":"none","navMidClickAction":"none","navSwitchPanelsWheel":true,"groupLayout":"list","skipEmptyPanels":false,"dndTabAct":true,"dndTabActDelay":750,"dndTabActMod":"none","dndExp":"pointer","dndExpDelay":0,"dndExpMod":"none","stateStorage":"global","warnOnMultiTabClose":"collapsed","activateOnMouseUp":true,"activateLastTabOnPanelSwitching":true,"showTabRmBtn":true,"showTabCtx":true,"hideInact":false,"activateAfterClosing":"next","activateAfterClosingPrevRule":"visible","activateAfterClosingNextRule":"tree","activateAfterClosingGlobal":false,"activateAfterClosingNoFolded":true,"activateAfterClosingNoDiscarded":true,"shiftSelAct":true,"askNewBookmarkPlace":false,"tabsRmUndoNote":true,"nativeHighlight":false,"tabsUnreadMark":false,"tabsReloadLimit":5,"tabsReloadLimitNotif":true,"tabsPanelSwitchActMove":true,"moveNewTabPin":"start","moveNewTabParent":"last_child","moveNewTabParentActPanel":false,"moveNewTab":"end","pinnedTabsPosition":"panel","pinnedTabsList":true,"pinnedAutoGroup":false,"tabsTree":true,"groupOnOpen":true,"tabsTreeLimit":"none","hideFoldedTabs":false,"autoFoldTabs":false,"autoFoldTabsExcept":"none","autoExpandTabs":false,"rmChildTabs":"none","tabsChildCount":true,"tabsLvlDots":false,"discardFolded":false,"discardFoldedDelay":0,"discardFoldedDelayUnit":"sec","tabsTreeBookmarks":true,"treeRmOutdent":"branch","bookmarksPanel":false,"warnOnMultiBookmarkDelete":"collapsed","openBookmarkNewTab":false,"midClickBookmark":"open_new_tab","actMidClickTab":false,"autoCloseBookmarks":false,"autoRemoveOther":false,"highlightOpenBookmarks":false,"activateOpenBookmarkTab":false,"showBookmarkLen":false,"bookmarksRmUndoNote":true,"fontSize":"m","bgNoise":false,"animations":true,"animationSpeed":"fast","theme":"default","style":"dark","sidebarCSS":true,"groupCSS":false,"snapNotify":true,"snapExcludePrivate":false,"snapInterval":0,"snapIntervalUnit":"min","snapLimit":0,"snapLimitUnit":"snap","hScrollThroughPanels":false,"scrollThroughTabs":"none","scrollThroughVisibleTabs":false,"scrollThroughTabsSkipDiscarded":false,"scrollThroughTabsExceptOverflow":true,"scrollThroughTabsCyclic":false,"tabDoubleClick":"none","tabLongLeftClick":"none","tabLongRightClick":"none","tabsPanelLeftClickAction":"none","tabsPanelDoubleClickAction":"tab","tabsPanelRightClickAction":"menu","tabsPanelMiddleClickAction":"tab","syncName":"","syncSaveSettings":false,"syncSaveCtxMenu":false,"syncSaveStyles":false,"syncAutoApply":false},"tabsMenu":[],"bookmarksMenu":[],"cssVars":{"bg":null,"title_fg":null,"sub_title_fg":null,"label_fg":null,"label_fg_hover":null,"label_fg_active":null,"info_fg":null,"true_fg":null,"false_fg":null,"active_fg":null,"inactive_fg":null,"favicons_placeholder_bg":null,"btn_bg":null,"btn_bg_hover":null,"btn_bg_active":null,"btn_fg":null,"btn_fg_hover":null,"btn_fg_active":null,"scroll_progress_h":null,"scroll_progress_bg":null,"ctx_menu_font":null,"ctx_menu_bg":null,"ctx_menu_bg_hover":null,"ctx_menu_fg":null,"nav_btn_fg":null,"nav_btn_width":null,"nav_btn_height":null,"pinned_dock_overlay_bg":null,"pinned_dock_overlay_shadow":null,"tabs_height":null,"tabs_pinned_height":null,"tabs_pinned_width":null,"tabs_indent":null,"tabs_font":null,"tabs_count_font":null,"tabs_fg":null,"tabs_fg_hover":null,"tabs_fg_active":null,"tabs_bg_hover":null,"tabs_bg_active":null,"tabs_activated_bg":null,"tabs_activated_fg":null,"tabs_selected_bg":null,"tabs_selected_fg":null,"tabs_border":null,"tabs_activated_border":null,"tabs_selected_border":null,"tabs_shadow":null,"tabs_activated_shadow":null,"tabs_selected_shadow":null,"tabs_lvl_indicator_bg":null,"bookmarks_bookmark_height":null,"bookmarks_folder_height":null,"bookmarks_separator_height":null,"bookmarks_bookmark_font":null,"bookmarks_folder_font":null,"bookmarks_node_title_fg":null,"bookmarks_node_title_fg_hover":null,"bookmarks_node_title_fg_active":null,"bookmarks_node_bg_hover":null,"bookmarks_node_bg_active":null,"bookmarks_folder_closed_fg":null,"bookmarks_folder_closed_fg_hover":null,"bookmarks_folder_closed_fg_active":null,"bookmarks_folder_open_fg":null,"bookmarks_folder_open_fg_hover":null,"bookmarks_folder_open_fg_active":null,"bookmarks_folder_empty_fg":null,"bookmarks_open_bookmark_fg":null},"sidebarCSS":"#root {\n --tabs-font: 9pt Segoe UI;\n --tabs-count-font: .625rem Segoe UI;\n --bookmarks-bookmark-font: .875rem Segoe UI;\n --bookmarks-folder-font: 9pt Segoe UI;\n --nav-btn-width: 42px;\n --nav-btn-height: 42px;\n}\n \n/* Adjust styles according to sidebar width */\n@media screen and (max-width: 47px) {\n #root {\n --tabs-indent: unset;\n }\n .Tab[data-audible]:not([data-muted]) svg.-loud, .Tab[data-muted] svg.-mute {\n transform: translateY(4px) translateX(-13px);\n }\n .NavigationBar .panel-btn:not([data-active=\"true\"]),\n .Sidebar .settings-btn,\n .Tab .close,\n .Tab .title {\n visibility: collapse;\n }\n \n .Tab .exp,\n .Tab[data-parent][data-folded] .fav {\n pointer-events: none;\n }\n \n}\n \n/*\n * Add margins and rounding around tabs\n */ \n \n#root {\n --tabs-height: 42px;\n}\n \n/* Background layer */\n.Tab .lvl-wrapper:after {\n content: '';\n position: absolute;\n top: 5px;\n left: 5px;\n width: calc(100% - 10px);\n height: calc(100% - 6px);\n border-radius: 4px;\n z-index: -1;\n}\n \n/*@media (prefers-color-scheme:light) {\n #root {\n --tabs-activated-bg: white !important;\n --tabs-bg-active: var(--tabs-activated-bg) !important;\n --tabs-selected-fg: var(--tabs-activated-fg) !important;\n --tabs-selected-bg: var(--tabs-activated-bg) !important;\n --bg: #f9f9fb !important;\n --chrome-content-separator-color: rgb(204,204,204);\n }\n \n .Tab[data-selected] .lvl-wrapper:after,\n .Tab[data-active] .lvl-wrapper:after {\n box-shadow: 0 0 1px rgba(128,128,142,0.9), 0 0 4px rgba(128,128,142,0.5);\n }\n}*/\n \n/*@media (prefers-color-scheme:dark) {*/\n #root {\n --tabs-activated-bg: #42414d !important;\n --tabs-bg-active: var(--tabs-activated-bg) !important;\n --tabs-selected-fg: var(--tabs-activated-fg) !important;\n --tabs-selected-bg: var(--tabs-activated-bg) !important;\n --bg: #1c1b22 !important;\n --chrome-content-separator-color: #0c0c0d;\n --tabs-bg-hover: rgb(51, 51, 62) !important;\n }\n .Tab[data-selected] .lvl-wrapper:after,\n .Tab[data-active] .lvl-wrapper:after {\n box-shadow: 0 0 1px rgba(128,128,142,0.9);\n }\n .Tab .placeholder > svg {\n fill: var(--nav-btn-fg);\n }\n/*}*/\n \n/* Reset default styles */\n.Tab:hover,\n.Tab:active,\n.Tab[data-active],\n.Tab[data-active]:active,\n.Tab[data-selected],\n.Tab[data-selected]:hover,\n.Tab[data-selected]:active {\n background: transparent;\n}\n \n/* Reapply styles */\n \n.Tab:hover .lvl-wrapper:after {\n background-color: var(--tabs-bg-hover);\n}\n \n.NavigationBar .panel-btn[data-active=\"true\"],\n.Tab:active .lvl-wrapper:after,\n.Tab[data-active]:active .lvl-wrapper:after {\n background-color: var(--tabs-bg-active);\n}\n \n.Tab[data-active] .lvl-wrapper:after {\n background-color: var(--tabs-activated-bg);\n}\n \n \n.Tab[data-selected] .lvl-wrapper:after {\n background-color: var(--tabs-selected-bg);,\n}\n \n/* Resize and reposition favicons */\n.Tab .fav {\n margin-left: 15px;\n}\n \n.Tab .fav,\n.Tab .placeholder,\n.Tab .t-box {\n margin-bottom: -3px;\n}\n \n.TabsPanel .container {\n box-shadow: none;\n}\n \n.Sidebar::before {\n --border-margin: 16px;\n content: '';\n width: calc(100% - var(--border-margin));\n margin: 0 calc(var(--border-margin) / 2);\n border-top: 1px solid var(--chrome-content-separator-color);\n}\n \n \n.Tab .audio {\n z-index: 21 !important;\n transform: translateX(5px);\n}\n.Tab .close {\n margin: 0 5px;\n}\n.Tab .t-box {\n width: calc(100% - 50px);\n}\n \n.NavigationBar .panels-box {\n/* flex-wrap: nowrap;*/\n}\n \n#root[data-nav-layout=\"horizontal\"] .NavigationBar, #root[data-nav-layout=\"hidden\"] .NavigationBar {\n box-shadow: none;\n}\n \n.NavigationBar .panel-btn {\n top: 5px;\n left: 5px;\n width: calc(var(--nav-btn-width) - 6px);\n height: calc(var(--nav-btn-height) - 6px);\n border-radius: 4px;\n margin-right: 5px;\n margin-bottom: 10px;\n}\n \n.NavigationBar .panel-btn[data-active=\"true\"] {\n box-shadow: 0 0 1px rgba(128,128,142,0.9);\n}","groupCSS":"","ver":"4.10.2"} \ No newline at end of file