diff options
Diffstat (limited to 'modules/firefox.home')
| -rw-r--r-- | modules/firefox.home/default.nix | 151 | ||||
| -rw-r--r-- | modules/firefox.home/tridactyl/themes/phenax.css | 173 | ||||
| -rw-r--r-- | modules/firefox.home/tridactyl/tridactylrc | 56 | ||||
| -rw-r--r-- | modules/firefox.home/userChrome.css | 120 |
4 files changed, 500 insertions, 0 deletions
diff --git a/modules/firefox.home/default.nix b/modules/firefox.home/default.nix new file mode 100644 index 0000000..b315a36 --- /dev/null +++ b/modules/firefox.home/default.nix @@ -0,0 +1,151 @@ +{ config, pkgs, lib, ... }: +let + unwrapped-firefox-package = pkgs.firefox-devedition-unwrapped; + + homepage-url = "file://${config.xdg.configHome}/qutebrowser/homepage/index.html"; + + extensions = [ + "https://addons.mozilla.org/firefox/downloads/file/3792127/firefox_dracula-1.0.xpi" + "https://addons.mozilla.org/firefox/downloads/file/4261352/tridactyl_vim-1.24.1.xpi" + + # dev + "https://addons.mozilla.org/firefox/downloads/file/4218479/font_inspect-0.5.8.xpi" + "https://addons.mozilla.org/firefox/downloads/file/4314064/react_devtools-5.3.1.xpi" + + # content + "https://addons.mozilla.org/firefox/downloads/file/4332776/languagetool-8.11.6.xpi" + "https://addons.mozilla.org/firefox/downloads/file/4317971/darkreader-4.9.88.xpi" + ]; + + # about:config + preferences = { + "browser.newtabpage.enabled" = false; + "browser.startup.homepage" = homepage-url; + + "browser.startup.blankWindow" = false; + "browser.tabs.drawInTitlebar" = true; + "browser.uidensity" = 0; + "browser.theme.dark-private-windows" = true; + "browser.theme.toolbar-theme" = 0; + "browser.aboutConfig.showWarning" = false; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "devtools.theme" = "dark"; + "devtools.toolbox.alwaysOnTop" = true; + "devtools.toolbox.host" = "window"; + "layers.acceleration.force-enabled" = true; + "gfx.webrender.all" = true; + "svg.context-properties.content.enabled" = true; + + "extensions.pocket.enabled" = false; + "extensions.pocket.showHome" = false; + "browser.urlbar.suggest.pocket" = false; + "privacy.donottrackheader.enabled" = true; + "privacy.globalprivacycontrol.enabled" = true; + "browser.search.suggest.enabled" = false; + "browser.urlbar.suggest.searches" = false; + "browser.urlbar.suggest.recentsearches" = false; + "browser.sessionstore.restore_tabs_lazily" = false; + "browser.dataFeatureRecommendations.enabled" = false; + "extensions.htmlaboutaddons.recommendations.enabled" = false; + + "browser.toolbars.bookmarks.visibility" = "never"; + "identity.fxaccounts.toolbar.enabled" = false; + "browser.tabs.insertAfterCurrent" = true; + "browser.urlbar.shortcuts.bookmarks" = false; + "browser.urlbar.suggest.bookmark" = false; + }; + + # https://mozilla.github.io/policy-templates + policies = { + ManagedBookmarks = [ + { toplevel_name = "Managed bookmarks"; } + { name = "Daily Dev"; url = "https://app.daily.dev"; } + # { name = "Shtuff"; children = [] } + ]; + DisplayBookmarksToolbar = "never"; + NoDefaultBookmarks = true; + + DisableTelemetry = true; + DisableFirefoxStudies = true; + DisableAccounts = true; + DontCheckDefaultBrowser = true; + OfferToSaveLogins = false; + PasswordManagerEnabled = false; + DefaultDownloadDirectory = "\${home}/Downloads/firefox"; + NewTabPage = false; + Homepage = { URL = homepage-url; StartPage = "previous-session"; }; + + # PopupBlocking = []; + SearchEngines = { + Default = "DuckDuckGo"; + SearchSuggestEnabled = false; + Add = [ + { + Name = "DuckDuckGo"; + URLTemplate = "https://duckduckgo.com/?q={searchTerms}"; + Alias = "google"; + } + { + Name = "Google"; + URLTemplate = "https://google.com/?q={searchTerms}"; + Alias = "google"; + } + ]; + }; + + UserMessaging = { + ExtensionRecommendations = false; + SkipOnboarding = true; + }; + + ShowHomeButton = false; + + # Permissions = { + # Camera = { + # Allow = [ "https://meet.google.com" ]; + # Block = []; + # }; + # }; + + Extensions = { Install = extensions; }; + + Preferences = lib.mapAttrs (_key: val: { Status = "locked"; Value = val; }) preferences; + }; + + firefox = pkgs.wrapFirefox unwrapped-firefox-package {}; + + profilePath = "default"; +in { + programs.firefox = { + enable = true; + package = firefox; + + nativeMessagingHosts = [ pkgs.tridactyl-native ]; + + policies = policies; + }; + + home.file = { + ".config/tridactyl".source = ./tridactyl; + + ".mozilla/firefox/${profilePath}/chrome/userChrome.css".text = builtins.readFile ./userChrome.css; + + ".mozilla/firefox/profiles.ini".text = lib.generators.toINI {} { + Profile1 = { + Name = "default"; + IsRelative = 1; + Path = profilePath; + }; + Profile0 = { + Name = "dev-edition-default"; + Default = 1; + IsRelative = 1; + Path = profilePath; + }; + General = { + StartWithLastProfile = 1; + Version = 2; + }; + }; + }; +} diff --git a/modules/firefox.home/tridactyl/themes/phenax.css b/modules/firefox.home/tridactyl/themes/phenax.css new file mode 100644 index 0000000..43f2ad8 --- /dev/null +++ b/modules/firefox.home/tridactyl/themes/phenax.css @@ -0,0 +1,173 @@ +:root { + /* Dracula Colors */ + --bg: #0f0c19; + --currentline: #44475a; + --fg: #f8f8f2; + --comment: #6272a4; + --cyan: #8be9fd; + --green: #50fa7b; + --orange: #ffb86c; + --pink: #ff79c6; + --violet: #4e3aA3; + --red: #ff5555; + --yellow: #f1fa8c; + --font: "JetBrainsMono Nerd Font", "JetBrains Mono", sans-serif; + + --tridactyl-fg: var(--fg); + --tridactyl-bg: var(--bg); + --tridactyl-url-fg: var(--violet); + --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(--violet); + background: var(--tridactyl-bg); +} + +#tridactyl-colon { + color: var(--violet) !important; + font-size: 1rem; +} + +#tridactyl-input { + color: var(--tridactyl-fg); + width: 90%; + font-size: 1.1rem !important; + line-height: 1em; + background: var(--tridactyl-bg); + padding: 0.5rem 0.2rem !important; +} + +#completions table { + font-size: 0.8rem; + font-weight: 200; + border-spacing: 0; + table-layout: fixed; + padding: 0.5rem 1rem !important; +} + +#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 { + width: 50%; +} + +#completions table tr { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +#completions .sectionHeader { + background: unset; + font-weight: bold; + border-bottom: unset; + font-size: 0.8rem !important; + color: var(--violet) !important; + text-transform: uppercase; + padding: 0.4rem 1rem !important; +} + +#cmdline_iframe:not(.hidden) { + position: fixed !important; + bottom: unset; + top: 25% !important; + left: 10% !important; + z-index: 2147483647 !important; + transition: none !important; + width: 80% !important; + box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 20px !important; + border: 1px solid #1b1825 !important; +} + +.TridactylStatusIndicator { + position: fixed !important; + bottom: 0 !important; + background: var(--tridactyl-bg) !important; + border: unset !important; + border: 1px var(--violet) solid !important; + font-size: 10pt !important; + /*font-weight: 200 !important;*/ + padding: 0.3ex 0.8ex !important; +} + +#completions .focused { + background: var(--violet); + color: var(--fg); +} + +#completions .focused .url { + background: var(--violet); + color: var(--fg); +} diff --git a/modules/firefox.home/tridactyl/tridactylrc b/modules/firefox.home/tridactyl/tridactylrc new file mode 100644 index 0000000..cb1a043 --- /dev/null +++ b/modules/firefox.home/tridactyl/tridactylrc @@ -0,0 +1,56 @@ +colorscheme phenax + +bind o fillcmdline tabopen +bind O fillcmdline open +bind p clipboard tabopen +bind P clipboard open + +set hintnames numeric +set editorcmd sensible-terminal -e nvim +set newtab about:blank +set viewsource default +set browsermaps { "<c-//>": "escapehatch", "<c-,>": "escapehatch" } + +" Tab control +unbind d +unbind D +unbind <c-s-j> +unbind <c-s-k> +bind <c-d> tabclose +bind <c-j> tabnext +bind <c-k> tabprev +bind <cs-j> tabmove +1 +bind <cs-k> tabmove -1 + +unbind t +unbind T +" unbind tt +" bind tt tabopen file:///home/imsohexy/.config/qutebrowser/homepage/index.html + +unbind <s-j> +unbind <s-k> +bind <s-j> scrollpx 0 200 +bind <s-k> scrollpx 0 -200 + +" Open tab by index +bind <space>1 tab 1 +bind <c-1> tab 1 +bind <space>2 tab 2 +bind <c-2> tab 2 +bind <space>3 tab 3 +bind <c-3> tab 3 +bind <space>4 tab 4 +bind <c-4> tab 4 +bind <space>5 tab 5 +bind <c-5> tab 5 +bind <space>6 tab 6 +bind <c-6> tab 6 +bind <space>7 tab 7 +bind <c-7> tab 7 +bind <space>8 tab 8 +bind <c-8> tab 8 +bind <space>9 tab 9 +bind <c-9> tab 9 +bind <space>0 tab 10 +bind <c-0> tab 10 + diff --git a/modules/firefox.home/userChrome.css b/modules/firefox.home/userChrome.css new file mode 100644 index 0000000..67809b0 --- /dev/null +++ b/modules/firefox.home/userChrome.css @@ -0,0 +1,120 @@ +:root { + --ff-accent-color: #4e3aA3; + --ff-bg-color: #0f0c19; + --ff-bg-color-1: #16121f; + --ff-bg-color-2: #26222f; + --ff-urlbar-height: 28px; +} + +#navigator-toolbox { + --tab-min-height: 16px; + --tab-border-radius: 0; + --tab-block-margin: 0; + --toolbarbutton-inner-padding: 6px; + --toolbar-bgcolor: var(--ff-bg-color); + --toolbar-field-background-color: var(--ff-bg-color-2); + --toolbarbutton-border-radius: 0; + --toolbar-start-end-padding: 2px; +} + +toolbarbutton { + --toolbarbutton-inner-padding: 6px; +} + +#TabsToolbar { + background-color: var(--ff-bg-color) !important; +} + +.browser-toolbar { + padding: 0 !important; + min-height: 0; +} + + + +/* Tabs */ + +.tabbrowser-tab { + padding: 0 !important; + font-size: 0.86rem !important; +} + +.tabbrowser-tab .tab-label-container { + height: 2.2rem !important; +} + +.tabbrowser-tab .tab-text { + line-height: 0; +} + +.tabbrowser-tab .tab-background { + background-color: transparent !important; + border-bottom: 3px solid transparent; +} +.tabbrowser-tab .tab-background[selected] { + background-color: rgba(255, 255, 255, 0.04) !important; + border-bottom-color: var(--ff-accent-color); +} +.tabbrowser-tab:hover .tab-background:not([selected]) { + background-color: rgba(255, 255, 255, 0.06) !important; +} + +.tab-close-button { + opacity: 0.6; + padding: 2px !important; + width: 14px !important; + height: 14px !important; +} + +#tabbrowser-tabs[haspinnedtabs]:not([positionpinnedtabs]) > #tabbrowser-arrowscrollbox > .tabbrowser-tab:nth-child(1 of :not([pinned], [hidden])) { + margin-inline-start: 0 !important; +} + + + + + + +/* Nav bar with url */ + +#nav-bar { + border-top: none !important; + background-color: var(--ff-bg-color-1) !important; +} + +#urlbar-container { + min-height: var(--ff-urlbar-height) !important; +} + +#urlbar { + font-size: 0.95rem !important; + min-height: 0 !important; + height: var(--ff-bg-color-1) !important; +} + +.urlbar-input-container { + background-color: var(--ff-bg-color-2) !important; + border-color: transparent !important; + min-height: 0 !important; +} + +#urlbar[breakout-extend] .urlbar-input-container { + background-color: var(--ff-bg-color-2) !important; +} +#urlbar[breakout-extend] .urlbar-input-container #identity-box { + display: none; +} + +#urlbar-container { + margin: 0 !important; +} + +#urlbar[focused='true'] > #urlbar-background { + --bxackground-color: var(--ff-bg-color) !important; + box-shadow: none !important; +} + +#navigator-toolbox { + --border: none !important; +} + |
