1

Modules/Qutebrowser: Add search engines and bookmarks, use color module for theme

This commit is contained in:
2025-07-21 01:25:48 +02:00
parent da88b7dea8
commit 5faf52836b
4 changed files with 368 additions and 275 deletions

View File

@ -0,0 +1,254 @@
{color}: {
completion = {
## Background color of the completion widget category headers.
category.bg = color.hexS.base;
## Bottom border color of the completion widget category headers.
category.border.bottom = color.hexS.mantle;
## Top border color of the completion widget category headers.
category.border.top = color.hexS.overlay2;
## Foreground color of completion widget category headers.
category.fg = color.hexS.green;
## Background color of the completion widget for even and odd rows.
even.bg = color.hexS.mantle;
odd.bg = color.hexS.mantle;
## Text color of the completion widget.
fg = color.hexS.subtext0;
## Background color of the selected completion item.
item.selected.bg = color.hexS.surface2;
## Bottom border color of the selected completion item.
item.selected.border.bottom = color.hexS.surface2;
## Top border color of the completion widget category headers.
item.selected.border.top = color.hexS.surface2;
## Foreground color of the selected completion item.
item.selected.fg = color.hexS.text;
## Foreground color of the selected completion item.
item.selected.match.fg = color.hexS.rosewater;
## Foreground color of the matched text in the completion.
match.fg = color.hexS.text;
## Color of the scrollbar in completion view
scrollbar.bg = color.hexS.crust;
## Color of the scrollbar handle in completion view.
scrollbar.fg = color.hexS.surface2;
};
downloads = {
bar.bg = color.hexS.base;
error.bg = color.hexS.base;
start.bg = color.hexS.base;
stop.bg = color.hexS.base;
error.fg = color.hexS.red;
start.fg = color.hexS.blue;
stop.fg = color.hexS.green;
system.fg = "none";
system.bg = "none";
};
hints = {
## Background color for hints. Note that you can use a `rgba(...)` value
## for transparency.
bg = color.hexS.peach;
## Font color for hints.
fg = color.hexS.mantle;
## Hints
border = "1px solid " + color.hexS.mantle;
## Font color for the matched part of hints.
match.fg = color.hexS.subtext1;
};
keyhint = {
## Background color of the keyhint widget.
bg = color.hexS.mantle;
## Text color for the keyhint widget.
fg = color.hexS.text;
## Highlight color for keys to complete the current keychain.
suffix.fg = color.hexS.subtext1;
};
messages = {
## Background color of an error message.
error.bg = color.hexS.overlay0;
## Background color of an info message.
info.bg = color.hexS.overlay0;
## Background color of a warning message.
warning.bg = color.hexS.overlay0;
## Border color of an error message.
error.border = color.hexS.mantle;
## Border color of an info message.
info.border = color.hexS.mantle;
## Border color of a warning message.
warning.border = color.hexS.mantle;
## Foreground color of an error message.
error.fg = color.hexS.red;
## Foreground color an info message.
info.fg = color.hexS.text;
## Foreground color a warning message.
warning.fg = color.hexS.peach;
};
prompts = {
## Background color for prompts.
bg = color.hexS.mantle;
# ## Border used around UI elements in prompts.
border = "1px solid " + color.hexS.overlay0;
## Foreground color for prompts.
fg = color.hexS.text;
## Background color for the selected item in filename prompts.
selected.bg = color.hexS.surface2;
## Background color for the selected item in filename prompts.
selected.fg = color.hexS.rosewater;
};
statusbar = {
## Background color of the statusbar.
normal.bg = color.hexS.base;
## Background color of the statusbar in insert mode.
insert.bg = color.hexS.crust;
## Background color of the statusbar in command mode.
command.bg = color.hexS.base;
## Background color of the statusbar in caret mode.
caret.bg = color.hexS.base;
## Background color of the statusbar in caret mode with a selection.
caret.selection.bg = color.hexS.base;
## Background color of the progress bar.
progress.bg = color.hexS.base;
## Background color of the statusbar in passthrough mode.
passthrough.bg = color.hexS.base;
## Foreground color of the statusbar.
normal.fg = color.hexS.text;
## Foreground color of the statusbar in insert mode.
insert.fg = color.hexS.rosewater;
## Foreground color of the statusbar in command mode.
command.fg = color.hexS.text;
## Foreground color of the statusbar in passthrough mode.
passthrough.fg = color.hexS.peach;
## Foreground color of the statusbar in caret mode.
caret.fg = color.hexS.peach;
## Foreground color of the statusbar in caret mode with a selection.
caret.selection.fg = color.hexS.peach;
## Foreground color of the URL in the statusbar on error.
url.error.fg = color.hexS.red;
## Default foreground color of the URL in the statusbar.
url.fg = color.hexS.text;
## Foreground color of the URL in the statusbar for hovered links.
url.hover.fg = color.hexS.sky;
## Foreground color of the URL in the statusbar on successful load
url.success.http.fg = color.hexS.teal;
## Foreground color of the URL in the statusbar on successful load
url.success.https.fg = color.hexS.green;
## Foreground color of the URL in the statusbar when there's a warning.
url.warn.fg = color.hexS.yellow;
## PRIVATE MODE COLORS
## Background color of the statusbar in private browsing mode.
private.bg = color.hexS.mantle;
## Foreground color of the statusbar in private browsing mode.
private.fg = color.hexS.subtext1;
## Background color of the statusbar in private browsing + command mode.
command.private.bg = color.hexS.base;
## Foreground color of the statusbar in private browsing + command mode.
command.private.fg = color.hexS.subtext1;
};
tabs = {
## Background color of the tab bar.
bar.bg = color.hexS.crust;
## Background color of unselected even tabs.
even.bg = color.hexS.surface2;
## Background color of unselected odd tabs.
odd.bg = color.hexS.surface1;
## Foreground color of unselected even tabs.
even.fg = color.hexS.overlay2;
## Foreground color of unselected odd tabs.
odd.fg = color.hexS.overlay2;
## Color for the tab indicator on errors.
indicator.error = color.hexS.red;
## Color gradient interpolation system for the tab indicator.
## Valid values:
## - rgb: Interpolate in the RGB color system.
## - hsv: Interpolate in the HSV color system.
## - hsl: Interpolate in the HSL color system.
## - none: Don't show a gradient.
indicator.system = "none";
# ## Background color of selected even tabs.
selected.even.bg = color.hexS.base;
# ## Background color of selected odd tabs.
selected.odd.bg = color.hexS.base;
# ## Foreground color of selected even tabs.
selected.even.fg = color.hexS.text;
# ## Foreground color of selected odd tabs.
selected.odd.fg = color.hexS.text;
};
contextmenu = {
menu.bg = color.hexS.base;
menu.fg = color.hexS.text;
disabled.bg = color.hexS.mantle;
disabled.fg = color.hexS.overlay0;
selected.bg = color.hexS.overlay0;
selected.fg = color.hexS.rosewater;
};
}

View File

@ -13,12 +13,96 @@ in {
config = lib.mkIf qutebrowser.enable {
programs.qutebrowser = {
enable = true;
loadAutoconfig = true; # Load settings set from GUI
loadAutoconfig = false; # Load settings set from GUI
# TODO: Find a unified version for qutebrowser + firefox (+ other browers ideally)
quickmarks = let
# Use this function to keep the quickmarks (almost) compatible with the firefox bookmarks
mkBm = name: value: {
${name} = value;
};
in
lib.mergeAttrsList [
(mkBm "Package Search" "https://search.nixos.org/packages")
(mkBm "Option Search" "https://search.nixos.org/options?")
(mkBm "Function Search" "https://noogle.dev/")
(mkBm "HM Search" "https://mipmip.github.io/home-manager-option-search/")
(mkBm "NUR Search" "https://nur.nix-community.org/")
(mkBm "Nixpkgs Version Search" "https://lazamar.co.uk/nix-versions/")
(mkBm "Nixpkgs PR Tracker" "https://nixpk.gs/pr-tracker.html")
(mkBm "NixOS Wiki" "https://wiki.nixos.org/wiki/NixOS_Wiki")
(mkBm "Nixpkgs Issues" "https://github.com/NixOS/nixpkgs/issues")
(mkBm "Nixpkgs Manual" "https://nixos.org/manual/nixpkgs/unstable/")
(mkBm "NixOS Manual" "https://nixos.org/manual/nixos/unstable/")
(mkBm "Nix Manual" "https://nix.dev/manual/nix/stable/")
(mkBm "Searchix" "https://searchix.ovh/")
(mkBm "Latest" "https://discourse.nixos.org/latest")
quickmarks = {
nixpkgs = "https://github.com/NixOS/nixpkgs";
home-manager = "https://github.com/nix-community/home-manager";
(mkBm "LAN Smart Switch" "http://192.168.86.2/")
(mkBm "WiFi Access Point" "http://192.168.86.3/")
(mkBm "OPNsense" "https://192.168.86.5/")
(mkBm "Synology DS223j" "https://synology.think.chriphost.de/")
(mkBm "PVE Direct" "https://192.168.86.4:8006/#v1:0:18:4:::::::")
(mkBm "PVF Direct" "https://192.168.86.13:8006/#v1:0:18:4:::::::")
(mkBm "Portainer" "https://portainer.think.chriphost.de/")
(mkBm "Local NGINX" "https://nginx.local.chriphost.de/")
(mkBm "Think NGINX" "https://nginx.think.chriphost.de/")
(mkBm "VPS NGINX" "http://vps.chriphost.de:51810/")
(mkBm "WUD ServeNix" "https://update.local.chriphost.de/")
(mkBm "WUD ThinkNix" "https://update.think.chriphost.de/")
(mkBm "Cloud" "https://nextcloud.local.chriphost.de/apps/files/files")
(mkBm "Immich" "https://immich.local.chriphost.de/photos")
(mkBm "Jelly" "https://jellyfin.local.chriphost.de/web/#/home.html")
(mkBm "HASS" "https://hass.think.chriphost.de/lovelace")
(mkBm "Docs" "https://paperless.local.chriphost.de/documents?sort=created&reverse=1&page=1")
(mkBm "Gitea" "https://gitea.local.chriphost.de/christoph")
# (mkBm "Chat" "http://localhost:11435/") # Local WebUI
(mkBm "C++Ref" "https://en.cppreference.com/w/")
(mkBm "Rust" "https://doc.rust-lang.org/stable/book/ch03-00-common-programming-concepts.html")
(mkBm "RustOS" "https://os.phil-opp.com/")
(mkBm "Interpreters" "https://craftinginterpreters.com/contents.html")
(mkBm "Mistral Chat" "https://chat.mistral.ai/chat")
(mkBm "DeepSeek Chat" "https://chat.deepseek.com/")
(mkBm "Claude Chat" "https://claude.ai/new")
(mkBm "ChatGPT" "https://chatgpt.com/")
(mkBm "Mistral API" "https://console.mistral.ai/usage")
(mkBm "DeepSeek API" "https://platform.deepseek.com/usage")
(mkBm "Claude API" "https://console.anthropic.com/usage")
(mkBm "OpenRouter API" "https://openrouter.ai/activity")
(mkBm "GH" "https://github.com/churl")
(mkBm "GL" "https://gitlab.com/churl")
(mkBm "SO" "https://stackoverflow.com/users/saves/17337508/all")
(mkBm "RegEx" "https://regex101.com/")
(mkBm "Shell" "https://explainshell.com/")
(mkBm "CDecl" "https://cdecl.org/")
(mkBm "ECR" "https://gallery.ecr.aws/")
(mkBm "Chmod" "https://chmod-calculator.com/")
(mkBm "Spiegel" "https://www.spiegel.de/")
(mkBm "Heise" "https://www.heise.de/")
(mkBm "HN" "https://news.ycombinator.com/news")
(mkBm "Reddit" "https://www.reddit.com/user/FightingMushroom/saved/")
(mkBm "F10" "https://f10.local.chriphost.de/race/Everyone")
(mkBm "F11" "https://f11.local.chriphost.de/racepicks")
(mkBm "F11PB" "https://f11pb.local.chriphost.de/_/#/collections?collection=pbc_1736455494&filter=&sort=-%40rowid")
(mkBm "ISBNDB" "https://isbndb.com/")
(mkBm "Music" "https://bandcamp.com/chriphost")
(mkBm "Albums" "https://www.albumoftheyear.org/user/chriphost/list/307966/2025/")
];
# TODO: Find a unified version for qutebrowser + firefox (+ other browsers ideally)
searchEngines = {
k = "https://kagi.com/search?q={}";
w = "https://en.wikipedia.org/wiki/Special:Search?search={}";
np = "https://searchix.ovh/?query={}";
nf = "https://noogle.dev/q?term={}";
nw = "https://wiki.nixos.org/index.php?search={}";
aw = "https://wiki.archlinux.org/?search={}";
g = "https://www.google.com/search?hl=en&q={}";
};
# greasemonkey = [];
@ -26,30 +110,26 @@ in {
# Map keys to other keys
# keyMappings = {};
# Map keys to commands
# keyBindings = {
# normal = {
# "<Ctrl-v>" = "spawn mpv {url}";
# ",p" = "spawn --userscript qute-pass";
# ",l" = ''config-cycle spellcheck.languages ["en-GB"] ["en-US"]'';
# "<F1>" = lib.mkMerge [
# "config-cycle tabs.show never always"
# "config-cycle statusbar.show in-mode always"
# "config-cycle scrolling.bar never always"
# ];
# };
# prompt = {
# "<Ctrl-y>" = "prompt-yes";
# };
# };
enableDefaultBindings = true;
# Map keys to commands
keyBindings = {
# normal = {
# "<Ctrl-v>" = "spawn mpv {url}";
# ",p" = "spawn --userscript qute-pass";
# ",l" = ''config-cycle spellcheck.languages ["en-GB"] ["en-US"]'';
# "<F1>" = mkMerge [
# "config-cycle tabs.show never always"
# "config-cycle statusbar.show in-mode always"
# "config-cycle scrolling.bar never always"
# ];
# };
# prompt = {
# "<Ctrl-y>" = "prompt-yes";
# };
};
searchEngines = {
w = "https://en.wikipedia.org/wiki/Special:Search?search={}&go=Go&ns0=1";
aw = "https://wiki.archlinux.org/?search={}";
nw = "https://wiki.nixos.org/index.php?search={}";
g = "https://www.google.com/search?hl=en&q={}";
settings = {
colors = import ./colors.nix {inherit color;};
};
# Same keys as qutebrowser.settings, but per domain
@ -58,8 +138,14 @@ in {
# };
extraConfig = builtins.concatStringsSep "\n" [
(builtins.readFile ./extraConfig.py)
(builtins.readFile ./theme.py)
# Options
''
c.editor.command = ["neovide", "{file}", "--", "normal {line}G{column0}l"]
''
# Theme
''
''
];
};
};

View File

@ -1 +0,0 @@
c.editor.command = ["neovide", "{file}", "--", "normal {line}G{column0}l"]

View File

@ -1,246 +0,0 @@
palette = {
"rosewater": "#f5e0dc",
"flamingo": "#f2cdcd",
"pink": "#f5c2e7",
"mauve": "#cba6f7",
"red": "#f38ba8",
"maroon": "#eba0ac",
"peach": "#fab387",
"yellow": "#f9e2af",
"green": "#a6e3a1",
"teal": "#94e2d5",
"sky": "#89dceb",
"sapphire": "#74c7ec",
"blue": "#89b4fa",
"lavender": "#b4befe",
"text": "#cdd6f4",
"subtext1": "#bac2de",
"subtext0": "#a6adc8",
"overlay2": "#9399b2",
"overlay1": "#7f849c",
"overlay0": "#6c7086",
"surface2": "#585b70",
"surface1": "#45475a",
"surface0": "#313244",
"base": "#1e1e2e",
"mantle": "#181825",
"crust": "#11111b",
}
# completion {{{
## Background color of the completion widget category headers.
c.colors.completion.category.bg = palette["base"]
## Bottom border color of the completion widget category headers.
c.colors.completion.category.border.bottom = palette["mantle"]
## Top border color of the completion widget category headers.
c.colors.completion.category.border.top = palette["overlay2"]
## Foreground color of completion widget category headers.
c.colors.completion.category.fg = palette["green"]
## Background color of the completion widget for even and odd rows.
c.colors.completion.even.bg = palette["mantle"]
c.colors.completion.odd.bg = c.colors.completion.even.bg
## Text color of the completion widget.
c.colors.completion.fg = palette["subtext0"]
## Background color of the selected completion item.
c.colors.completion.item.selected.bg = palette["surface2"]
## Bottom border color of the selected completion item.
c.colors.completion.item.selected.border.bottom = palette["surface2"]
## Top border color of the completion widget category headers.
c.colors.completion.item.selected.border.top = palette["surface2"]
## Foreground color of the selected completion item.
c.colors.completion.item.selected.fg = palette["text"]
## Foreground color of the selected completion item.
c.colors.completion.item.selected.match.fg = palette["rosewater"]
## Foreground color of the matched text in the completion.
c.colors.completion.match.fg = palette["text"]
## Color of the scrollbar in completion view
c.colors.completion.scrollbar.bg = palette["crust"]
## Color of the scrollbar handle in completion view.
c.colors.completion.scrollbar.fg = palette["surface2"]
# }}}
# downloads {{{
c.colors.downloads.bar.bg = palette["base"]
c.colors.downloads.error.bg = palette["base"]
c.colors.downloads.start.bg = palette["base"]
c.colors.downloads.stop.bg = palette["base"]
c.colors.downloads.error.fg = palette["red"]
c.colors.downloads.start.fg = palette["blue"]
c.colors.downloads.stop.fg = palette["green"]
c.colors.downloads.system.fg = "none"
c.colors.downloads.system.bg = "none"
# }}}
# hints {{{
## Background color for hints. Note that you can use a `rgba(...)` value
## for transparency.
c.colors.hints.bg = palette["peach"]
## Font color for hints.
c.colors.hints.fg = palette["mantle"]
## Hints
c.hints.border = "1px solid " + palette["mantle"]
## Font color for the matched part of hints.
c.colors.hints.match.fg = palette["subtext1"]
# }}}
# keyhints {{{
## Background color of the keyhint widget.
c.colors.keyhint.bg = palette["mantle"]
## Text color for the keyhint widget.
c.colors.keyhint.fg = palette["text"]
## Highlight color for keys to complete the current keychain.
c.colors.keyhint.suffix.fg = palette["subtext1"]
# }}}
# messages {{{
## Background color of an error message.
c.colors.messages.error.bg = palette["overlay0"]
## Background color of an info message.
c.colors.messages.info.bg = palette["overlay0"]
## Background color of a warning message.
c.colors.messages.warning.bg = palette["overlay0"]
## Border color of an error message.
c.colors.messages.error.border = palette["mantle"]
## Border color of an info message.
c.colors.messages.info.border = palette["mantle"]
## Border color of a warning message.
c.colors.messages.warning.border = palette["mantle"]
## Foreground color of an error message.
c.colors.messages.error.fg = palette["red"]
## Foreground color an info message.
c.colors.messages.info.fg = palette["text"]
## Foreground color a warning message.
c.colors.messages.warning.fg = palette["peach"]
# }}}
# prompts {{{
## Background color for prompts.
c.colors.prompts.bg = palette["mantle"]
# ## Border used around UI elements in prompts.
c.colors.prompts.border = "1px solid " + palette["overlay0"]
## Foreground color for prompts.
c.colors.prompts.fg = palette["text"]
## Background color for the selected item in filename prompts.
c.colors.prompts.selected.bg = palette["surface2"]
## Background color for the selected item in filename prompts.
c.colors.prompts.selected.fg = palette["rosewater"]
# }}}
# statusbar {{{
## Background color of the statusbar.
c.colors.statusbar.normal.bg = palette["base"]
## Background color of the statusbar in insert mode.
c.colors.statusbar.insert.bg = palette["crust"]
## Background color of the statusbar in command mode.
c.colors.statusbar.command.bg = palette["base"]
## Background color of the statusbar in caret mode.
c.colors.statusbar.caret.bg = palette["base"]
## Background color of the statusbar in caret mode with a selection.
c.colors.statusbar.caret.selection.bg = palette["base"]
## Background color of the progress bar.
c.colors.statusbar.progress.bg = palette["base"]
## Background color of the statusbar in passthrough mode.
c.colors.statusbar.passthrough.bg = palette["base"]
## Foreground color of the statusbar.
c.colors.statusbar.normal.fg = palette["text"]
## Foreground color of the statusbar in insert mode.
c.colors.statusbar.insert.fg = palette["rosewater"]
## Foreground color of the statusbar in command mode.
c.colors.statusbar.command.fg = palette["text"]
## Foreground color of the statusbar in passthrough mode.
c.colors.statusbar.passthrough.fg = palette["peach"]
## Foreground color of the statusbar in caret mode.
c.colors.statusbar.caret.fg = palette["peach"]
## Foreground color of the statusbar in caret mode with a selection.
c.colors.statusbar.caret.selection.fg = palette["peach"]
## Foreground color of the URL in the statusbar on error.
c.colors.statusbar.url.error.fg = palette["red"]
## Default foreground color of the URL in the statusbar.
c.colors.statusbar.url.fg = palette["text"]
## Foreground color of the URL in the statusbar for hovered links.
c.colors.statusbar.url.hover.fg = palette["sky"]
## Foreground color of the URL in the statusbar on successful load
c.colors.statusbar.url.success.http.fg = palette["teal"]
## Foreground color of the URL in the statusbar on successful load
c.colors.statusbar.url.success.https.fg = palette["green"]
## Foreground color of the URL in the statusbar when there's a warning.
c.colors.statusbar.url.warn.fg = palette["yellow"]
## PRIVATE MODE COLORS
## Background color of the statusbar in private browsing mode.
c.colors.statusbar.private.bg = palette["mantle"]
## Foreground color of the statusbar in private browsing mode.
c.colors.statusbar.private.fg = palette["subtext1"]
## Background color of the statusbar in private browsing + command mode.
c.colors.statusbar.command.private.bg = palette["base"]
## Foreground color of the statusbar in private browsing + command mode.
c.colors.statusbar.command.private.fg = palette["subtext1"]
# }}}
# tabs {{{
## Background color of the tab bar.
c.colors.tabs.bar.bg = palette["crust"]
## Background color of unselected even tabs.
c.colors.tabs.even.bg = palette["surface2"]
## Background color of unselected odd tabs.
c.colors.tabs.odd.bg = palette["surface1"]
## Foreground color of unselected even tabs.
c.colors.tabs.even.fg = palette["overlay2"]
## Foreground color of unselected odd tabs.
c.colors.tabs.odd.fg = palette["overlay2"]
## Color for the tab indicator on errors.
c.colors.tabs.indicator.error = palette["red"]
## Color gradient interpolation system for the tab indicator.
## Valid values:
## - rgb: Interpolate in the RGB color system.
## - hsv: Interpolate in the HSV color system.
## - hsl: Interpolate in the HSL color system.
## - none: Don't show a gradient.
c.colors.tabs.indicator.system = "none"
# ## Background color of selected even tabs.
c.colors.tabs.selected.even.bg = palette["base"]
# ## Background color of selected odd tabs.
c.colors.tabs.selected.odd.bg = palette["base"]
# ## Foreground color of selected even tabs.
c.colors.tabs.selected.even.fg = palette["text"]
# ## Foreground color of selected odd tabs.
c.colors.tabs.selected.odd.fg = palette["text"]
# }}}
# context menus {{{
c.colors.contextmenu.menu.bg = palette["base"]
c.colors.contextmenu.menu.fg = palette["text"]
c.colors.contextmenu.disabled.bg = palette["mantle"]
c.colors.contextmenu.disabled.fg = palette["overlay0"]
c.colors.contextmenu.selected.bg = palette["overlay0"]
c.colors.contextmenu.selected.fg = palette["rosewater"]
# }}}