From abacae837945282b17342b2d58dbd9c39a8c1d15 Mon Sep 17 00:00:00 2001 From: Emmet Date: Wed, 27 Sep 2023 20:17:55 -0500 Subject: [PATCH] Trying qutebrowser again! --- flake.nix | 4 +- profiles/work/home.nix | 1 + user/app/browser/qutebrowser.nix | 165 +++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+), 2 deletions(-) create mode 100644 user/app/browser/qutebrowser.nix diff --git a/flake.nix b/flake.nix index 2026e04..47f85d8 100644 --- a/flake.nix +++ b/flake.nix @@ -15,10 +15,10 @@ name = "Emmet"; # name/identifier email = "librephoenix3@pm.me"; # email (used for certain configurations) dotfilesDir = "~/.dotfiles"; # absolute path of the local repo - theme = "caret"; # selcted theme from my themes directory (./themes/) + theme = "uwunicorn"; # selcted theme from my themes directory (./themes/) wm = "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/ wmType = "wayland"; # x11 or wayland - browser = "librewolf"; # Default browser; must select one from ./user/app/browser/ + browser = "qutebrowser"; # Default browser; must select one from ./user/app/browser/ editor = "emacsclient"; # Default editor; defaultRoamDir = "Personal.p"; # Default org roam directory relative to ~/Org term = "alacritty"; # Default terminal command; diff --git a/profiles/work/home.nix b/profiles/work/home.nix index 243b972..19feb74 100644 --- a/profiles/work/home.nix +++ b/profiles/work/home.nix @@ -36,6 +36,7 @@ alacritty librewolf brave + qutebrowser dmenu rofi git diff --git a/user/app/browser/qutebrowser.nix b/user/app/browser/qutebrowser.nix new file mode 100644 index 0000000..93c5d35 --- /dev/null +++ b/user/app/browser/qutebrowser.nix @@ -0,0 +1,165 @@ +{ config, lib, pkgs, font, ... }: + +{ + home.packages = [ pkgs.qutebrowser ]; + home.sessionVariables = { DEFAULT_BROWSER = "${pkgs.qutebrowser}/bin/qutebrowser"; }; + + programs.qutebrowser.enable = true; + programs.qutebrowser.extraConfig = '' +config.load_autoconfig(False) + +base00 = "#''+config.lib.stylix.colors.base00+''" +base01 = "#''+config.lib.stylix.colors.base01+''" +base02 = "#''+config.lib.stylix.colors.base02+''" +base03 = "#''+config.lib.stylix.colors.base03+''" +base04 = "#''+config.lib.stylix.colors.base04+''" +base05 = "#''+config.lib.stylix.colors.base05+''" +base06 = "#''+config.lib.stylix.colors.base06+''" +base07 = "#''+config.lib.stylix.colors.base07+''" +base08 = "#''+config.lib.stylix.colors.base08+''" +base09 = "#''+config.lib.stylix.colors.base09+''" +base0A = "#''+config.lib.stylix.colors.base0A+''" +base0B = "#''+config.lib.stylix.colors.base0B+''" +base0C = "#''+config.lib.stylix.colors.base0C+''" +base0D = "#''+config.lib.stylix.colors.base0D+''" +base0E = "#''+config.lib.stylix.colors.base0E+''" +base0F = "#''+config.lib.stylix.colors.base0F+''" + +# TODO stylix user CSS +# current_stylesheet_directory = '~/.config/qutebrowser/themes/' +# current_stylesheet = base16_theme+'-all-sites.css' +# current_stylesheet_path = current_stylesheet_directory + current_stylesheet +# config.set('content.user_stylesheets', current_stylesheet_path) + +config.set('content.cookies.accept', 'no-3rdparty', 'chrome-devtools://*') +config.set('content.cookies.accept', 'no-3rdparty', 'devtools://*') + +config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}; rv:90.0) Gecko/20100101 Firefox/90.0', 'https://accounts.google.com/*') +config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99 Safari/537.36', 'https://*.slack.com/*') + +config.set('content.images', True, 'chrome-devtools://*') +config.set('content.images', True, 'devtools://*') + +config.set('content.javascript.enabled', True, 'chrome-devtools://*') +config.set('content.javascript.enabled', True, 'devtools://*') +config.set('content.javascript.enabled', True, 'chrome://*/*') +config.set('content.javascript.enabled', True, 'qute://*/*') +c.tabs.favicons.scale = 1.0 +c.tabs.last_close = 'close' +c.tabs.position = 'left' +c.tabs.width = '3%' +c.window.transparent = True +c.colors.webpage.darkmode.enabled = True + +c.url.default_page = str(config.configdir)+'/qute-home.html' +c.url.start_pages = str(config.configdir)+'/qute-home.html' + +c.url.searchengines = {'DEFAULT': 'https://startpage.com/do/search?query={}', + 'd' : 'https://duckduckgo.com/?q={}&ia=web', + 'sb' : 'https://www.serebii.net/search.shtml?q={}&sa=Search', + 'bp' : 'https://bulbapedia.bulbagarden.net/wiki/index.php?title=Special%3ASearch&search={}&go=Go', + 'aw' : 'https://wiki.archlinux.org/index.php?search={}&title=Special%3ASearch&wprov=acrw1', + 'az' : 'https://www.amazon.com/s?k={}'} + +config.bind('t', 'open -t') +config.bind('x', 'tab-close') +config.bind('yf', 'hint links yank') +config.bind(',m', 'hint links spawn freetube {hint-url}') +#config.bind(',s', 'set content.user_stylesheets \'\' ') +#config.bind(',S', 'set content.user_stylesheets '+current_stylesheet_path) + +c.colors.completion.fg = base05 +c.colors.completion.odd.bg = base01 +c.colors.completion.even.bg = base00 +c.colors.completion.category.fg = base0A +c.colors.completion.category.bg = base00 +c.colors.completion.category.border.top = base00 +c.colors.completion.category.border.bottom = base00 +c.colors.completion.item.selected.fg = base05 +c.colors.completion.item.selected.bg = base02 +c.colors.completion.item.selected.border.top = base02 +c.colors.completion.item.selected.border.bottom = base02 +c.colors.completion.item.selected.match.fg = base0B +c.colors.completion.match.fg = base0B +c.colors.completion.scrollbar.fg = base05 +c.colors.completion.scrollbar.bg = base00 +c.colors.contextmenu.disabled.bg = base01 +c.colors.contextmenu.disabled.fg = base04 +c.colors.contextmenu.menu.bg = base00 +c.colors.contextmenu.menu.fg = base05 +c.colors.contextmenu.selected.bg = base02 +c.colors.contextmenu.selected.fg = base05 +c.colors.downloads.bar.bg = base00 +c.colors.downloads.start.fg = base00 +c.colors.downloads.start.bg = base0D +c.colors.downloads.stop.fg = base00 +c.colors.downloads.stop.bg = base0C +c.colors.downloads.error.fg = base08 +c.colors.hints.fg = base00 +c.colors.hints.bg = base0A +c.colors.hints.match.fg = base05 +c.colors.keyhint.fg = base05 +c.colors.keyhint.suffix.fg = base05 +c.colors.keyhint.bg = base00 +c.colors.messages.error.fg = base00 +c.colors.messages.error.bg = base08 +c.colors.messages.error.border = base08 +c.colors.messages.warning.fg = base00 +c.colors.messages.warning.bg = base0E +c.colors.messages.warning.border = base0E +c.colors.messages.info.fg = base05 +c.colors.messages.info.bg = base00 +c.colors.messages.info.border = base00 +c.colors.prompts.fg = base05 +c.colors.prompts.border = base00 +c.colors.prompts.bg = base00 +c.colors.prompts.selected.bg = base02 +c.colors.prompts.selected.fg = base05 +c.colors.statusbar.normal.fg = base0B +c.colors.statusbar.normal.bg = base00 +c.colors.statusbar.insert.fg = base00 +c.colors.statusbar.insert.bg = base0D +c.colors.statusbar.passthrough.fg = base00 +c.colors.statusbar.passthrough.bg = base0C +c.colors.statusbar.private.fg = base00 +c.colors.statusbar.private.bg = base01 +c.colors.statusbar.command.fg = base05 +c.colors.statusbar.command.bg = base00 +c.colors.statusbar.command.private.fg = base05 +c.colors.statusbar.command.private.bg = base00 +c.colors.statusbar.caret.fg = base00 +c.colors.statusbar.caret.bg = base0E +c.colors.statusbar.caret.selection.fg = base00 +c.colors.statusbar.caret.selection.bg = base0D +c.colors.statusbar.progress.bg = base0D +c.colors.statusbar.url.fg = base05 +c.colors.statusbar.url.error.fg = base08 +c.colors.statusbar.url.hover.fg = base05 +c.colors.statusbar.url.success.http.fg = base0C +c.colors.statusbar.url.success.https.fg = base0B +c.colors.statusbar.url.warn.fg = base0E +c.colors.tabs.bar.bg = base00 +c.colors.tabs.indicator.start = base0D +c.colors.tabs.indicator.stop = base0C +c.colors.tabs.indicator.error = base08 +c.colors.tabs.odd.fg = base05 +c.colors.tabs.odd.bg = base01 +c.colors.tabs.even.fg = base05 +c.colors.tabs.even.bg = base00 +c.colors.tabs.pinned.even.bg = base0C +c.colors.tabs.pinned.even.fg = base07 +c.colors.tabs.pinned.odd.bg = base0B +c.colors.tabs.pinned.odd.fg = base07 +c.colors.tabs.pinned.selected.even.bg = base02 +c.colors.tabs.pinned.selected.even.fg = base05 +c.colors.tabs.pinned.selected.odd.bg = base02 +c.colors.tabs.pinned.selected.odd.fg = base05 +c.colors.tabs.selected.odd.fg = base05 +c.colors.tabs.selected.odd.bg = base02 +c.colors.tabs.selected.even.fg = base05 +c.colors.tabs.selected.even.bg = base02 +c.colors.webpage.bg = base00 + +# TODO Configure fonts + ''; +}