From dfb47f17f59736cb0854db6a7b247fa7bda87400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 19 Nov 2023 23:09:10 +0100 Subject: [PATCH] nix: Add qutebrowser --- config/nix/hm/desktop.nix | 54 +++++++++++++++++++++++- config/qutebrowser/.dfrecur | 0 config/qutebrowser/config.py | 81 ------------------------------------ 3 files changed, 53 insertions(+), 82 deletions(-) delete mode 100644 config/qutebrowser/.dfrecur delete mode 100644 config/qutebrowser/config.py diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 8e4b5b7..21ede78 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -329,7 +329,59 @@ programs = { # Browser - qutebrowser.enable = true; + qutebrowser = { + enable = true; + keyBindings = { + normal = { + # Match tab behaviour to i3. Not that I use them. + "H" = "tab-prev"; + "J" = "back"; + "K" = "forward"; + "L" = "tab-next"; + # "T" = null; + "af" = "spawn --userscript freshrss"; # TODO Broken? + "as" = "spawn --userscript shaarli"; # TODO I don't use shaarli anymore + # "d" = null; + "u" = "undo --window"; + # TODO Unbind d and T (?) + }; + }; + loadAutoconfig = true; # FIXME Salvage stuff from autoconfig.yml + searchEngines = rec { + DEFAULT = ecosia; + ampwhat = "http://www.amp-what.com/unicode/search/{}"; + aw = ampwhat; + ddg = duckduckgo; + duckduckgo = "https://duckduckgo.com/?q={}&ia=web"; + ecosia = "https://www.ecosia.org/search?q={}"; + github = "https://github.com/search?q={}"; + google = "https://www.google.fr/search?q={}"; + g = google; + npm = "https://www.npmjs.com/search?q={}"; + q = qwant; + qwant = "https://www.qwant.com/?t=web&q={}"; + wolfram = "https://www.wolframalpha.com/input/?i={}"; + youtube = "https://www.youtube.com/results?search_query={}"; + yt = youtube; + }; + settings = { + downloads.location.prompt = false; + tabs = { + show = "never"; + tabs_are_windows = true; + }; + url = { + open_base_url = true; + start_pages = "https://geoffrey.frogeye.fr/blank.html"; + }; + content = { + # I had this setting below, not sure if it did something special + # config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*") + cookies.accept = "no-3rdparty"; + prefers_reduced_motion = true; + }; + }; + }; # Terminal alacritty = { diff --git a/config/qutebrowser/.dfrecur b/config/qutebrowser/.dfrecur deleted file mode 100644 index e69de29..0000000 diff --git a/config/qutebrowser/config.py b/config/qutebrowser/config.py deleted file mode 100644 index 82d5b3b..0000000 --- a/config/qutebrowser/config.py +++ /dev/null @@ -1,81 +0,0 @@ -import os - -# Public static configuration for qutebrowser -# Note that private stuff (permissions, per-site rules) -# are in autoconfig in gdotfiles - -# Prompt the user for the download location. If set to false, -# `downloads.location.directory` will be used. -# Type: Bool -c.downloads.location.prompt = False - -# When to show the tab bar. -# Type: String -# Valid values: -# - always: Always show the tab bar. -# - never: Always hide the tab bar. -# - multiple: Hide the tab bar if only one tab is open. -# - switching: Show the tab bar when switching tabs. -c.tabs.show = "never" - -# Open a new window for every tab. -# Type: Bool -c.tabs.tabs_are_windows = True - -# Open base URL of the searchengine if a searchengine shortcut is -# invoked without parameters. -# Type: Bool -c.url.open_base_url = True - -# Search engines which can be used via the address bar. Maps a search -# engine name (such as `DEFAULT`, or `ddg`) to a URL with a `{}` -# placeholder. The placeholder will be replaced by the search term, use -# `{{` and `}}` for literal `{`/`}` signs. The search engine named -# `DEFAULT` is used when `url.auto_search` is turned on and something -# else than a URL was entered to be opened. Other search engines can be -# used by prepending the search engine name to the search term, e.g. -# `:open google qutebrowser`. -# Type: Dict -c.url.searchengines = { - "DEFAULT": "https://www.ecosia.org/search?q={}", - "aw": "http://www.amp-what.com/unicode/search/{}", - "ddg": "https://duckduckgo.com/?q={}&ia=web", - "duckduckgo": "https://duckduckgo.com/?q={}&ia=web", - "ecosia": "https://www.ecosia.org/search?q={}", - "github": "https://github.com/search?q={}", - "google": "https://www.google.fr/search?q={}", - "npm": "https://www.npmjs.com/search?q={}", - "q": "https://www.qwant.com/?t=web&q={}", - "qwant": "https://www.qwant.com/?t=web&q={}", - "wolfram": "https://www.wolframalpha.com/input/?i={}", - "youtube": "https://www.youtube.com/results?search_query={}", -} - -# Only allow first party cookies -config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*") - -# Request websites to reduce non-essential motion/animations -config.set("content.prefers_reduced_motion", True) - -# Page(s) to open at the start. -# Type: List of FuzzyUrl, or FuzzyUrl -c.url.start_pages = "https://geoffrey.frogeye.fr/blank.html" - -# Bindings for normal mode -config.bind("H", "tab-prev") -config.bind("J", "back") -config.bind("K", "forward") -config.bind("L", "tab-next") -config.unbind("T") -config.bind("af", "spawn --userscript freshrss") -config.bind("as", "spawn --userscript shaarli") -config.bind("u", "undo --window") - -dirname = os.path.dirname(__file__) -filename = os.path.join(dirname, "theme.py") -if os.path.exists(filename): - with open(filename) as file: - exec(file.read()) - -# Uncomment this to still load settings configured via autoconfig.yml -config.load_autoconfig()