diff --git a/hmModules/firefox/catppuccin.css b/hmModules/firefox/catppuccin.css new file mode 100644 index 0000000..8cad578 --- /dev/null +++ b/hmModules/firefox/catppuccin.css @@ -0,0 +1,187 @@ +:root { /* Catppuccin Colors */ + --bg: #1e1e2e; + --currentline: #302D41; + --fg: #d9e0ee; + --comment: #575268; + --flamingo: #f2cdcd; + --mauve: #ddb6f2; + --pink: #f5c2e7; + --maroon: #e8a2af; + --red: #f28fad; + --peach: #f8bd96; + --yellow: #fae3b0; + --green: #abe9b3; + --teal: #b5e8e0; + --blue: #96cdfb; + --sky: #89dceb; + --lavender: #c9cbff; + --rosewater: #f5e0dc; + --font: monospace; /*"FiraCode Nerd Font Mono";*/ + + /* vimium theme uses colors: flamingo, peach, rosewater, green, blue, lavender */ + --tridactyl-fg: var(--fg); + --tridactyl-bg: var(--bg); + --tridactyl-url-fg: var(--rosewater); + --tridactyl-url-bg: var(--bg); + --tridactyl-highlight-box-bg: var(--currentline); + --tridactyl-highlight-box-fg: var(--fg); + --tridactyl-of-fg: var(--fg); + --tridactyl-of-bg: var(--currentline); + --tridactyl-cmdl-fg: var(--bg); + --tridactyl-cmdl-font-family: var(--font); + --tridactyl-cmplt-font-family: var(--font); + --tridactyl-hintspan-font-family: var(--font); + + /* Hint character tags */ + --tridactyl-hintspan-fg: var(--bg) !important; + --tridactyl-hintspan-bg: var(--green) !important; + + /* Element Highlights */ + --tridactyl-hint-active-fg: none; + --tridactyl-hint-active-bg: none; + --tridactyl-hint-active-outline: none; + --tridactyl-hint-bg: none; + --tridactyl-hint-outline: none; +} + +#command-line-holder { + order: 1; + border: 2px solid var(--lavender); + background: var(--tridactyl-bg); +} + +#tridactyl-input { + padding: 1rem; + color: var(--tridactyl-fg); + width: 90%; + font-size: 1.5rem; + line-height: 1.5; + background: var(--tridactyl-bg); + padding-left: unset; + padding: 1rem; +} + +#completions table { + font-size: 0.8rem; + font-weight: 200; + border-spacing: 0; + table-layout: fixed; + padding: 1rem 0; + /* padding-top: 1rem; */ + /* padding-bottom: 1rem; */ +} + +#completions > div { + max-height: calc(20 * var(--option-height)); + min-height: calc(10 * var(--option-height)); +} + +/* COMPLETIONS */ + +#completions { + --option-height: 1.4em; + color: var(--tridactyl-fg); + background: var(--tridactyl-bg); + display: inline-block; + font-size: unset; + font-weight: 200; + overflow: hidden; + width: 100%; + border-top: unset; + order: 2; +} + +/* Olie doesn't know how CSS inheritance works */ +#completions .HistoryCompletionSource { + max-height: unset; + min-height: unset; +} + +#completions .HistoryCompletionSource table { + width: 100%; + font-size: 9pt; + border-spacing: 0; + table-layout: fixed; +} + +/* redundancy 2: redundancy 2: more redundancy */ +#completions .BmarkCompletionSource { + max-height: unset; + min-height: unset; +} + +#completions table tr td.prefix,#completions table tr td.privatewindow,#completions table tr td.container,#completions table tr td.icon { + display: none; +} + +#completions .BufferCompletionSource table { + width: unset; + font-size: unset; + border-spacing: unset; + table-layout: unset; +} + +#completions table tr .title, #completions table tr td.excmd { + width: 50%; + padding-left: 1rem; + color: var(--blue); +} + +#completions table tr .content, #completions table tr td.documentation { + padding-right: 1rem; +} + +#completions table tr { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +#completions table tr td { + padding: .5rem 0; +} + +#completions .sectionHeader { + background: unset; + font-weight: bold; + border-bottom: unset; + padding: 1rem 1rem 0 !important; + padding-left: unset; + padding-bottom: 0.2rem; + color: var(--peach); +} + +#cmdline_iframe { + position: fixed !important; + bottom: unset; + top: 25% !important; + left: 10% !important; + z-index: 2147483647 !important; + width: 80% !important; + box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 20px !important; +} + +.TridactylStatusIndicator { + position: fixed !important; + bottom: 0 !important; + background: var(--tridactyl-bg) !important; + border: unset !important; + border: 1px var(--purple) solid !important; + font-size: 12pt !important; + /*font-weight: 200 !important;*/ + padding: 0.8ex !important; +} + +#completions .focused { + background: var(--currentline); + /* color: var(--blue); */ + font-weight: bold; +} +#completions .focused td.title { + color: var(--pink); +} + +#completions .focused .url { + background: var(--currentline); + color: var(--green); +} diff --git a/hmModules/firefox/default.nix b/hmModules/firefox/default.nix index f6ae31e..4f0a3c2 100644 --- a/hmModules/firefox/default.nix +++ b/hmModules/firefox/default.nix @@ -1,30 +1,69 @@ { pkgs, - username, ... }: +let + mkExtension = shortId: uuid: { + name = uuid; + value = { + install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; + installation_mode = "normal_installed"; + }; + }; +in { programs.firefox = { enable = true; - package = pkgs.wrapFirefox pkgs.firefox-unwrapped { - extraPolicies = { - ExtensionSettings = { }; + nativeMessagingHosts = [ pkgs.tridactyl-native ]; + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + EmailTracking = true; }; - nativeMessagingHosts = [ pkgs.tridactyl-native ]; + HardwareAcceleration = true; + FirefoxHome = { + TopSites = false; + SponsoredTopSites = false; + Highlights = false; + Pocket = false; + SponsoredPocket = false; + Snippets = false; + Locked = false; + }; + FirefoxSuggest = { + WebSuggestions = true; + SponsoredSuggestions = false; + ImproveSuggest = false; + Locked = true; + }; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + DontCheckDefaultBrowser = true; + DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" + SearchBar = "unified"; # alternative: "separate" + HttpsOnlyMode = "force_enabled"; + NoDefaultBookmarks = true; + OfferToSaveLogins = false; + OfferToSaveLoginsDefault = false; + PasswordManagerEnabled = true; + DefaultDownloadDirectory = "\${home}/Downloads"; + PromptForDownloadLocation = false; + RequestedLocales = "en-US"; + + ExtensionSettings = builtins.listToAttrs [ + (mkExtension "ublock-origin" "uBlock0@raymondhill.net") + (mkExtension "tridactyl-vim" "tridactyl.vim@cmcaine.co.uk") + (mkExtension "styl-us" "7a7a4a92-a2a0-41d1-9fd7-1e92480d612d") + ]; }; - profiles.${username} = { - settings = { - "browser.startup.homepage" = "https://google.it"; - "browser.search.region" = "IT"; - "browser.search.isUS" = false; - "distribution.searchplugins.defaultLocale" = "it-IT"; - "general.useragent.locale" = "it-IT"; - "browser.bookmarks.showMobileBookmarks" = true; - "browser.download.folderList" = 2; - "browser.download.lastDir" = "/home/${username}/Downloads/"; - "browser.shell.checkDefaultBrowser" = false; - }; - search.force = true; + profiles.default = { + search.default = "DuckDuckGo"; search.engines = { "Searx" = { urls = [ @@ -40,10 +79,19 @@ ]; }; }; + bookmarks = [ ]; + extensions = [ ]; + userChrome = builtins.readFile ./userchrome.css; }; }; - home.sessionVariables = { - MOZ_ENABLE_WAYLAND = 1; - NIXOS_OZONE_WL = 1; + + xdg.configFile."tridactyl/tridactylrc".text = '' + set editorcmd footclient -e hx %f + + colors catppuccin + ''; + + xdg.configFile."tridactyl/themes/catppuccin.css" = { + source = ./catppuccin.css; }; } diff --git a/hmModules/firefox/userchrome.css b/hmModules/firefox/userchrome.css new file mode 100644 index 0000000..7abb436 --- /dev/null +++ b/hmModules/firefox/userchrome.css @@ -0,0 +1,67 @@ + +/* * Do not remove the @namespace line -- it's required for correct functioning */ +/* set default namespace to XUL */ +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/* Remove Back button when there's nothing to go Back to */ +#back-button[disabled="true"] { display: none; } + +/* Remove Forward button when there's nothing to go Forward to */ +#forward-button[disabled="true"] { display: none; } + +/* Remove Home button (never use it) */ +#home-button { display: none; } + +.titlebar-spacer { + display: none !important; +} + +/* Remove import bookmarks button */ +#import-button { + display: none; +} + +/* Remove bookmark toolbar */ +toolbarbutton.bookmark-item:not(.subviewbutton) { + display: none; +} + +/* Remove whitespace in toolbar */ +#nav-bar toolbarpaletteitem[id^="wrapper-customizableui-special-spring"], #nav-bar toolbarspring { + display: none; +} + +/* Hide dumb Firefox View button */ +#firefox-view-button { + visibility: hidden; +} + +/* Hide Firefox tab icon */ +.tab-icon-image { + display: none; +} + +/* Linux stuff to keep GNOME system theme */ +.titlebar-min { + appearance: auto !important; + -moz-default-appearance: -moz-window-button-minimize !important; +} + +.titlebar-max { + appearance: auto !important; + -moz-default-appearance: -moz-window-button-maximize !important; +} + +.titlebar-restore { + appearance: auto !important; + -moz-default-appearance: -moz-window-button-restore !important; +} + +.titlebar-close { + appearance: auto !important; + -moz-default-appearance: -moz-window-button-close !important; +} + +.titlebar-button { + list-style-image: none !important; +}