diff --git a/home/graphical/firefox/chrome/theme/theme.css b/home/graphical/firefox/chrome/theme/theme.css index 20fb79d..488676e 100644 --- a/home/graphical/firefox/chrome/theme/theme.css +++ b/home/graphical/firefox/chrome/theme/theme.css @@ -1,109 +1,56 @@ -/* Dark theme */ -@media (prefers-color-scheme: dark) { +@import "../colors.css"; +@media { #nav-bar, #PersonalToolbar { - background-color: rgb(24, 24, 37) !important; + background-color: var(--mantle) !important; } :root { .tabbrowser-tab[selected="true"] .tab-background { - border: 1px solid #313244 !important; + border: 1px solid var(--surface0) !important; } - --toolbar-bgcolor: rgb(24, 24, 37) !important; - --toolbox-non-lwt-bgcolor: rgb(17, 17, 27) !important; - --toolbox-non-lwt-textcolor: rgb(205, 214, 244) !important; - --input-bgcolor: rgb(17, 17, 27) !important; + --toolbar-bgcolor: var(--mantle) !important; + --toolbox-non-lwt-bgcolor: var(--crust) !important; + --toolbox-non-lwt-textcolor: var(--text) !important; + --input-bgcolor: var(--crust) !important; --toolbar-field-background-color: var(--input-bgcolor) !important; - --input-color: rgb(205, 214, 244) !important; + --input-color: var(--text) !important; --toolbar-field-color: var(--input-color) !important; .tab-background[selected]:not([multiselected]) { - outline: 1px solid rgb(49, 50, 68); + outline: 1px solid var(--surface0); outline-offset: -1px; } .tab-background[multiselected] { - --focus-outline-color: rgb(49, 50, 68); + --focus-outline-color: var(--surface0); } - --arrowpanel-background: rgb(49, 50, 68) !important; - --arrowpanel-color: rgb(205, 214, 244) !important; - --toolbarbutton-active-background: rgb(108, 112, 134) !important; + --arrowpanel-background: var(--surface0) !important; + --arrowpanel-color: var(--text) !important; + --toolbarbutton-active-background: var(--overlay0) !important; &:where([tabsintitlebar]) { - --toolbox-non-lwt-bgcolor-inactive: rgb(17, 17, 27) !important; + --toolbox-non-lwt-bgcolor-inactive: var(--crust) !important; } - --toolbarbutton-icon-fill-attention: rgb(205, 214, 244) !important; - --toolbarbutton-icon-fill: rgb(205, 214, 244) !important; - --arrowpanel-border-color: rgb(49, 50, 68) !important; - --urlbarView-highlight-color: rgb(205, 214, 244) !important; - --urlbarView-highlight-background: rgb(108, 112, 134) !important; + --toolbarbutton-icon-fill-attention: var(--text) !important; + --toolbarbutton-icon-fill: var(--text) !important; + --arrowpanel-border-color: var(--surface0) !important; + --urlbarView-highlight-color: var(--text) !important; + --urlbarView-highlight-background: var(--overlay0) !important; #tabbrowser-tabs { - --tab-loading-fill: rgb(205, 214, 244) !important; + --tab-loading-fill: var(--text) !important; } - --tab-selected-bgcolor: rgb(30, 30, 46) !important; - --tab-selected-textcolor: rgb(205, 214, 244) !important; - --chrome-content-separator-color: rgb(49, 50, 68) !important; - --toolbar-field-focus-border-color: rgb(49, 50, 68) !important; - --input-border-color: rgb(24, 24, 37) !important; + --tab-selected-bgcolor: var(--base) !important; + --tab-selected-textcolor: var(--text) !important; + --chrome-content-separator-color: var(--surface0) !important; + --toolbar-field-focus-border-color: var(--surface0) !important; + --input-border-color: var(--mantle) !important; --toolbar-field-border-color: var(--input-border-color) !important; - --toolbar-field-focus-background-color: rgb(30, 30, 46) !important; + --toolbar-field-focus-background-color: var(--base) !important; #urlbar-input:focus::selection, .searchbar-textbox:focus::selection { - color: rgb(49, 50, 68); + color: var(--surface0); } #urlbar-input:focus::selection, .searchbar-textbox:focus::selection { - background-color: rgb(205, 214, 244); + background-color: var(--text); } - --toolbarseparator-color: rgb(205, 214, 244) !important; - } -} - -/* Light theme */ -@media (prefers-color-scheme: light) { - :root { - .tabbrowser-tab[selected="true"] .tab-background { - border: 1px solid #ccd0da !important; - } - --toolbar-bgcolor: rgb(230, 233, 239) !important; - --toolbox-non-lwt-bgcolor: rgb(220, 224, 232) !important; - --toolbox-non-lwt-textcolor: rgb(76, 79, 105) !important; - --input-bgcolor: rgb(220, 224, 232) !important; - --toolbar-field-background-color: var(--input-bgcolor) !important; - --input-color: rgb(76, 79, 105) !important; - --toolbar-field-color: var(--input-color) !important; - .tab-background[selected]:not([multiselected]) { - outline: 1px solid rgb(76, 79, 105); - outline-offset: -1px; - } - .tab-background[multiselected] { - --focus-outline-color: rgb(76, 79, 105); - } - --arrowpanel-background: rgb(239, 241, 245) !important; - --arrowpanel-color: rgb(76, 79, 105) !important; - --toolbarbutton-active-background: rgb(156, 160, 176) !important; - &:where([tabsintitlebar]) { - --toolbox-non-lwt-bgcolor-inactive: rgb(220, 224, 232) !important; - } - --toolbarbutton-icon-fill-attention: rgb(76, 79, 105) !important; - --toolbarbutton-icon-fill: rgb(76, 79, 105) !important; - --arrowpanel-border-color: rgb(76, 79, 105) !important; - --urlbarView-highlight-color: rgb(76, 79, 105) !important; - --urlbarView-highlight-background: rgb(156, 160, 176) !important; - #tabbrowser-tabs { - --tab-loading-fill: rgb(76, 79, 105) !important; - } - --tab-selected-bgcolor: rgb(239, 241, 245) !important; - --tab-selected-textcolor: rgb(76, 79, 105) !important; - --chrome-content-separator-color: rgb(239, 241, 245) !important; - --toolbar-field-focus-border-color: rgb(76, 79, 105) !important; - --input-border-color: rgb(230, 233, 239) !important; - --toolbar-field-border-color: var(--input-border-color) !important; - --toolbar-field-focus-background-color: rgb(239, 241, 245) !important; - #urlbar-input:focus::selection, - .searchbar-textbox:focus::selection { - color: rgb(204, 208, 218); - } - #urlbar-input:focus::selection, - .searchbar-textbox:focus::selection { - background-color: rgb(76, 79, 105); - } - --toolbarseparator-color: rgb(76, 79, 105) !important; + --toolbarseparator-color: var(--text) !important; } } diff --git a/home/graphical/firefox/default.nix b/home/graphical/firefox/default.nix index 2225bf3..cf91304 100644 --- a/home/graphical/firefox/default.nix +++ b/home/graphical/firefox/default.nix @@ -3,50 +3,47 @@ { pkgs, config, - lib, ... }: { - home.file.".mozilla/firefox/default/chrome/theme" = { - source = ./chrome/theme; + home.file.".librewolf/default/chrome/" = { + source = ./chrome; force = true; recursive = true; }; - home.file.".mozilla/firefox/default/chrome/userChrome.css" = { - source = ./chrome/userChrome.css; - force = true; - }; - - home.file.".mozilla/firefox/default/chrome/colors.css" = { + home.file.".librewolf/default/chrome/colors.css" = let + color = pkgs.catppuccin.rgb.${config.catppuccin.flavor}; + accent = color.${config.catppuccin.accent}; + in { text = '' * { - --accent: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.${config.catppuccin.accent}}; - --rosewater: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.rosewater}; - --flamingo: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.flamingo}; - --pink: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.pink}; - --mauve: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.mauve}; - --red: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.red}; - --maroon: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.maroon}; - --peach: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.peach}; - --yellow: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.yellow}; - --green: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.green}; - --teal: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.teal}; - --sky: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.sky}; - --sapphire: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.sapphire}; - --blue: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.blue}; - --lavender: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.lavender}; - --text: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.text}; - --subtext1: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.subtext1}; - --subtext0: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.subtext0}; - --overlay2: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.overlay2}; - --overlay1: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.overlay1}; - --overlay0: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.overlay0}; - --surface2: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.surface2}; - --surface1: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.surface1}; - --surface0: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.surface0}; - --base: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.base}; - --mantle: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.mantle}; - --crust: ${pkgs.catppuccin.rgb.${config.catppuccin.flavor}.crust}; + --accent: ${accent}; + --rosewater: ${color.rosewater}; + --flamingo: ${color.flamingo}; + --pink: ${color.pink}; + --mauve: ${color.mauve}; + --red: ${color.red}; + --maroon: ${color.maroon}; + --peach: ${color.peach}; + --yellow: ${color.yellow}; + --green: ${color.green}; + --teal: ${color.teal}; + --sky: ${color.sky}; + --sapphire: ${color.sapphire}; + --blue: ${color.blue}; + --lavender: ${color.lavender}; + --text: ${color.text}; + --subtext1: ${color.subtext1}; + --subtext0: ${color.subtext0}; + --overlay2: ${color.overlay2}; + --overlay1: ${color.overlay1}; + --overlay0: ${color.overlay0}; + --surface2: ${color.surface2}; + --surface1: ${color.surface1}; + --surface0: ${color.surface0}; + --base: ${color.base}; + --mantle: ${color.mantle}; + --crust: ${color.crust}; } ''; force = true; @@ -91,9 +88,9 @@ }; }; }; - firefox = { + librewolf = { enable = true; - package = pkgs.firefox.override { + package = pkgs.librewolf.override { nativeMessagingHosts = with pkgs; [ firefoxpwa ]; @@ -105,39 +102,20 @@ # Valid strings for installation_mode are "allowed", "blocked", # "force_installed" and "normal_installed". ExtensionSettings = { - "*" = { - "installation_mode" = "blocked"; - }; - "uBlock0@raymondhill.net" = { - installation_mode = "allowed"; - }; - "gdpr@cavi.au.dk" = { - installation_mode = "allowed"; - }; - "{5cce4ab5-3d47-41b9-af5e-8203eea05245}" = { - installation_mode = "allowed"; - }; - "plasma-browser-integration@kde.org" = { - installation_mode = "allowed"; - }; - "jid1-MnnxcxisBPnSXQ@jetpack" = { - installation_mode = "allowed"; - }; - "firefoxpwa@filips.si" = { - installation_mode = "allowed"; - }; - "sponsorBlocker@ajay.app" = { - installation_mode = "allowed"; - }; - "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}" = { - installation_mode = "allowed"; - }; - "{aecec67f-0d10-4fa7-b7c7-609a2db280cf}" = { - installation_mode = "allowed"; - }; - "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { - installation_mode = "allowed"; - }; + "*".installation_mode = "blocked"; + "uBlock0@raymondhill.net".installation_mode = "allowed"; + "gdpr@cavi.au.dk".installation_mode = "allowed"; + "{5cce4ab5-3d47-41b9-af5e-8203eea05245}".installation_mode = "allowed"; + "plasma-browser-integration@kde.org".installation_mode = "allowed"; + "jid1-MnnxcxisBPnSXQ@jetpack".installation_mode = "allowed"; + "firefoxpwa@filips.si".installation_mode = "allowed"; + "sponsorBlocker@ajay.app".installation_mode = "allowed"; + "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}".installation_mode = "allowed"; + "{aecec67f-0d10-4fa7-b7c7-609a2db280cf}".installation_mode = "allowed"; + "{446900e4-71c2-419f-a6a7-df9c091e268b}".installation_mode = "allowed"; + "CanvasBlocker@kkapsner.de".installation_mode = "allowed"; + "shinigamieyes@shinigamieyes".installation_mode = "allowed"; + # "".installation_mode = "allowed"; }; DisableTelemetry = true; DisableFirefoxStudies = true; @@ -176,6 +154,8 @@ pwas-for-firefox control-panel-for-twitter bitwarden + canvasblocker + shinigami-eyes ]; settings = { "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}".settings = { @@ -240,16 +220,22 @@ # Vertical tabs "sidebar.verticalTabs" = true; "sidebar.verticalTabs.dragToPinPromo.dismissed" = true; - # these are ordered right to left for some fucking reason "browser.uiCustomization.navBarWhenVerticalTabs" = [ + "back-button" + "forward-button" + "stop-reload-button" + "reload-button" + "urlbar-container" + "downloads-button" "unified-extensions-button" "fxa-toolbar-menu-button" - "downloads-button" - "urlbar-container" - "stop-reload-button" - "forward-button" - "back-button" ]; + + "privacy.resistFingerprinting" = false; + "privacy.clearOnShutdown.history" = false; + "privacy.clearOnShutdown.downloads" = false; + "webgl.disabled" = false; + "privacy.clearOnShutdown_v2.cookiesAndStorage" = false; }; bookmarks = { force = true; @@ -270,12 +256,58 @@ } ]; }; - search = { + search = let + nixIcon = "${pkgs.colloid-icon-theme}/share/icons/Colloid/apps/scalable/nix-snowflake.svg"; + googleIcon = "${pkgs.colloid-icon-theme}/share/icons/Colloid/apps/scalable/google.svg"; + in { force = true; default = "google"; order = [ "google" ]; + engines = { + nix-packages = { + name = "Nix Packages"; + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + + icon = nixIcon; + definedAliases = ["@np"]; + }; + + nixos-wiki = { + name = "NixOS Wiki"; + urls = [{template = "https://wiki.nixos.org/w/index.php?search={searchTerms}";}]; + icon = nixIcon; + definedAliases = ["@nw"]; + }; + + google = { + name = "Google"; + urls = [{template = "https://google.com/search?q={searchTerms}";}]; + icon = googleIcon; + definedAliases = ["@go"]; + }; + + wikipedia = { + name = "Wikipedia"; + urls = [{template = "https://en.wikipedia.org/w/index.php?search={searchTerms}";}]; + definedAliases = ["@wi"]; + }; + }; }; }; }; diff --git a/home/kde/default.nix b/home/kde/default.nix index 5b4ff4a..2a0d138 100644 --- a/home/kde/default.nix +++ b/home/kde/default.nix @@ -269,8 +269,7 @@ { iconTasks = { launchers = [ - "applications:firefox.desktop" - # "applications:helium.desktop" + "applications:librewolf.desktop" "applications:org.kde.dolphin.desktop" "applications:vesktop.desktop" "applications:kitty.desktop" diff --git a/system/widevine/default.nix b/system/widevine/default.nix index 127667e..23a6898 100644 --- a/system/widevine/default.nix +++ b/system/widevine/default.nix @@ -7,7 +7,7 @@ }: { nixpkgs.overlays = lib.mkIf (config.nixpkgs.hostPlatform.isLinux) [ (final: prev: { - wrapFirefox = browser: opts: let + wrapLibrewolf = browser: opts: let extraPrefs = (opts.extraPrefs or "") + '' @@ -21,7 +21,7 @@ widevineCdmDir = "${final.widevine-cdm}/share/google/chrome/WidevineCdm"; widevineOutDir = "$out/gmp-widevinecdm/system-installed"; in - (prev.wrapFirefox browser (opts // {inherit extraPrefs;})).overrideAttrs (previousAttrs: { + (prev.wrapLibrewolf browser (opts // {inherit extraPrefs;})).overrideAttrs (previousAttrs: { buildCommand = previousAttrs.buildCommand + ''