aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <kylie@somas.is>2021-07-03 23:58:11 -0400
committerKylie McClain <kylie@somas.is>2021-07-03 23:58:11 -0400
commit4a74620110d3ca914ba53745cfd79e4022ee7da6 (patch)
tree3641a5dda1ecc09a4779acb3505460744399a864
parentcccbc5ccf8f7f6ae6af0e2884f8d6b636d2f7ad6 (diff)
downloadme-4a74620110d3ca914ba53745cfd79e4022ee7da6.tar.gz
me-4a74620110d3ca914ba53745cfd79e4022ee7da6.tar.xz
me-4a74620110d3ca914ba53745cfd79e4022ee7da6.zip
qutebrowser: commit the rest of the configHEADmain
-rw-r--r--etc/qutebrowser/config.d/adblock.py20
-rw-r--r--etc/qutebrowser/config.d/binds.py55
-rw-r--r--etc/qutebrowser/config.d/completion.py8
-rw-r--r--etc/qutebrowser/config.d/content.py23
-rw-r--r--etc/qutebrowser/config.d/fonts.py13
-rw-r--r--etc/qutebrowser/config.d/integration.py27
-rw-r--r--etc/qutebrowser/config.d/interface.py96
-rw-r--r--etc/qutebrowser/config.d/search.py36
-rw-r--r--etc/qutebrowser/config.d/session.py19
-rw-r--r--etc/qutebrowser/config.py7
10 files changed, 304 insertions, 0 deletions
diff --git a/etc/qutebrowser/config.d/adblock.py b/etc/qutebrowser/config.d/adblock.py
new file mode 100644
index 0000000..d84f8bc
--- /dev/null
+++ b/etc/qutebrowser/config.d/adblock.py
@@ -0,0 +1,20 @@
+c.content.blocking.enabled = True
+c.content.blocking.method = 'both'
+
+c.content.blocking.adblock.lists = [
+ "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt",
+ "https://gitcdn.xyz/repo/uBlockOrigin/uAssets/master/filters/badware.txt",
+ "https://cdn.statically.io/gh/uBlockOrigin/uAssets/master/filters/privacy.txt",
+ "https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssets@master/filters/resource-abuse.txt",
+ "https://combinatronics.io/uBlockOrigin/uAssets/master/filters/unbreak.txt",
+ "https://easylist.to/easylist/easylist.txt",
+ "https://easylist.to/easylist/easyprivacy.txt",
+ "https://secure.fanboy.co.nz/fanboy-cookiemonster.txt",
+ "file://" + str(config.configdir / "adblock.txt")
+]
+
+c.content.blocking.hosts.lists = [
+ "https://gitcdn.xyz/repo/StevenBlack/hosts/master/hosts",
+ "https://gitcdn.xyz/repo/curbengh/urlhaus-filter/master/urlhaus-filter-online.txt",
+ "https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext"
+]
diff --git a/etc/qutebrowser/config.d/binds.py b/etc/qutebrowser/config.d/binds.py
new file mode 100644
index 0000000..e4542ce
--- /dev/null
+++ b/etc/qutebrowser/config.d/binds.py
@@ -0,0 +1,55 @@
+# Disable some default binds.
+config.unbind(';O')
+config.unbind(';R')
+config.unbind(';Y')
+config.unbind(';b')
+config.unbind(';d')
+config.unbind(';h')
+config.unbind(';i')
+config.unbind(';o')
+config.unbind(';r')
+config.unbind(';t')
+config.unbind(';y')
+config.unbind('<Escape>')
+config.unbind('F')
+config.unbind('f')
+config.unbind('gi')
+config.unbind('j')
+config.unbind('k')
+config.unbind('q')
+config.unbind('wf')
+config.unbind('r')
+config.unbind('d')
+config.unbind('b')
+# c.bindings.default = {}
+
+config.unbind('<q>')
+config.bind('<q><a>', 'set-cmd-text :quickmark-add {url} "{title}"')
+config.bind('<q><l>', 'set-cmd-text -s :quickmark-load')
+config.bind('<b><a>', 'set-cmd-text :bookmark-add {url} "{title}"')
+config.bind('<b><l>', 'set-cmd-text -s :bookmark-load')
+
+config.bind("<g><s><w>", "set-cmd-text :open !wiki {title}")
+
+config.bind('<Ctrl+r>', 'reload')
+config.bind('<Ctrl+t>', 'open -t ;; set-cmd-text -s :open')
+config.bind('<Alt+Left>', 'back')
+config.bind('<Alt+Right>', 'forward')
+config.bind('<Ctrl+Tab>', 'tab-next')
+config.bind('<Ctrl+Shift+Tab>', 'tab-prev')
+
+config.bind('<Alt+Left>', 'back')
+config.bind('<Alt+Right>', 'forward')
+config.bind('<Ctrl+Shift+Tab>', 'tab-prev')
+config.bind('<Ctrl+Tab>', 'tab-next')
+config.bind('<Ctrl+l>', 'set-cmd-text -s :open {url:pretty}')
+config.bind('<Ctrl+r>', 'reload')
+config.bind('<Ctrl+Shift+r>', 'reload -f')
+config.bind('<Ctrl+t>', 'open -t')
+config.unbind('<Ctrl+q>')
+
+
+
+# Emulate Tree Style Tabs keyboard shortcuts.
+config.unbind('<F11>')
+config.bind('<F1>', 'config-cycle tabs.show never always ;; config-cycle statusbar.show in-mode always ;; config-cycle scrolling.bar never always')
diff --git a/etc/qutebrowser/config.d/completion.py b/etc/qutebrowser/config.d/completion.py
new file mode 100644
index 0000000..2079c61
--- /dev/null
+++ b/etc/qutebrowser/config.d/completion.py
@@ -0,0 +1,8 @@
+# Shrink the completion menu to the amount of items.
+c.completion.shrink = True
+
+# Width (in pixels) of the scrollbar in the completion window.
+c.completion.scrollbar.width = 16
+
+# Padding (in pixels) of the scrollbar handle in the completion window.
+c.completion.scrollbar.padding = 4
diff --git a/etc/qutebrowser/config.d/content.py b/etc/qutebrowser/config.d/content.py
new file mode 100644
index 0000000..6ce8bd9
--- /dev/null
+++ b/etc/qutebrowser/config.d/content.py
@@ -0,0 +1,23 @@
+# Request websites to minimize non-essential animations and motion.
+c.content.prefers_reduced_motion = True
+
+# Don't send any DoNotTrack headers; they're pointless.
+c.content.headers.do_not_track = None
+
+# Allow JavaScript to read from or write to the clipboard.
+c.content.javascript.can_access_clipboard = True
+
+# Draw the background color and images also when the page is printed.
+c.content.print_element_backgrounds = False
+
+# List of user stylesheet filenames to use.
+# c.content.user_stylesheets = 'stylesheet.css'
+
+c.content.prefers_reduced_motion = True
+
+# Languages to use for spell checking.
+# TODO Add es-MX in hopes it is added someday.
+c.spellcheck.languages = ['en-US', 'en-AU', 'en-GB', 'es-ES']
+
+# Allow for more precise zooming increments.
+c.zoom.mouse_divider = 2048
diff --git a/etc/qutebrowser/config.d/fonts.py b/etc/qutebrowser/config.d/fonts.py
new file mode 100644
index 0000000..e395617
--- /dev/null
+++ b/etc/qutebrowser/config.d/fonts.py
@@ -0,0 +1,13 @@
+c.fonts.default_family = 'sans-serif'
+c.fonts.default_size = '11pt'
+c.fonts.completion.entry = 'default_size monospace'
+c.fonts.completion.category = 'bold default_size monospace'
+c.fonts.statusbar = 'default_size monospace'
+
+c.fonts.tabs.selected = 'bold default_size default_family'
+
+c.fonts.web.size.default_fixed = c.fonts.web.size.default
+c.fonts.web.family.standard = 'sans-serif'
+c.fonts.web.family.fixed = 'monospace'
+c.fonts.web.family.serif = 'serif'
+c.fonts.web.family.sans_serif = 'sans-serif'
diff --git a/etc/qutebrowser/config.d/integration.py b/etc/qutebrowser/config.d/integration.py
new file mode 100644
index 0000000..c12bcda
--- /dev/null
+++ b/etc/qutebrowser/config.d/integration.py
@@ -0,0 +1,27 @@
+# Integrate with lunch(1).
+
+# Default program used to open downloads.
+c.downloads.open_dispatcher = "lunch"
+
+# Editor (and arguments) to use for the `edit-*` commands.
+c.editor.command = ["terminal", "lunch", "-o", "editor", "+{line}:{column}", "{file}"]
+
+# Integrate with pass(1).
+# -n: Don't automatically enter into insert mode, so as to match the c.input.insert_mode.* settings.
+config.bind("<z><l><l>", "spawn --userscript qute-pass -d 'dmenu -p \"pass[qutebrowser]\"' -n")
+config.bind("<z><l><u>", "spawn --userscript qute-pass -d 'dmenu -p \"pass[qutebrowser]\"' -n -e")
+config.bind("<z><l><p>", "spawn --userscript qute-pass -d 'dmenu -p \"pass[qutebrowser]\"' -n -w")
+
+# Akin to the browserpass Firefox extension.
+config.bind("<Ctrl+Shift+F>", "spawn --userscript qute-pass -d 'dmenu -p \"pass[qutebrowser]\"' -n")
+
+# Integrate with kdeconnect.
+config.bind("<z><k><u>", "spawn --userscript kdeconnect {url}")
+
+# Integrate with list-add(1).
+config.bind("<z><t><w>", "spawn --userscript todo-add {title} {url} -l wish")
+
+# XDG integration.
+
+# TODO Isn't there some way to get the XDG download directory from ~/etc/user-dirs.dirs?
+c.downloads.location.directory = "~/mess/current/incoming"
diff --git a/etc/qutebrowser/config.d/interface.py b/etc/qutebrowser/config.d/interface.py
new file mode 100644
index 0000000..98c15d4
--- /dev/null
+++ b/etc/qutebrowser/config.d/interface.py
@@ -0,0 +1,96 @@
+import subprocess
+
+def read_xresources(prefix):
+ props = {}
+ x = subprocess.run(["xrdb", "-query"], stdout=subprocess.PIPE)
+ lines = x.stdout.decode().split("\n")
+ for line in filter(lambda l : l.startswith(prefix), lines):
+ prop, _, value = line.partition(":\t")
+ props[prop] = value
+ return props
+
+xresources = read_xresources("*")
+
+# Downloads bar.
+c.downloads.position = "bottom"
+c.colors.downloads.start.bg = xresources["*background"]
+c.colors.downloads.stop.bg = xresources["*color2"]
+c.colors.downloads.error.bg = xresources["*color1"]
+c.colors.downloads.bar.bg = xresources["*background"]
+
+# Statusbar.
+c.statusbar.position = "top"
+c.statusbar.padding = {"bottom": 8, "left": 4, "right": 8, "top": 8}
+c.completion.open_categories = ["quickmarks", "searchengines", "bookmarks", "history", "filesystem"]
+
+c.colors.statusbar.command.bg = xresources["*background"]
+c.colors.statusbar.command.fg = xresources["*foreground"]
+c.colors.statusbar.insert.bg = xresources["*color2"]
+c.colors.statusbar.insert.fg = xresources["*foreground"]
+c.colors.statusbar.normal.bg = xresources["*background"]
+c.colors.statusbar.normal.fg = xresources["*foreground"]
+c.colors.statusbar.passthrough.bg = xresources["*color4"]
+c.colors.statusbar.passthrough.fg = xresources["*foreground"]
+c.colors.statusbar.private.bg = xresources["*color5"]
+c.colors.statusbar.private.fg = xresources["*foreground"]
+c.colors.statusbar.progress.bg = xresources["*color2"]
+c.colors.statusbar.url.error.fg = xresources["*color9"]
+c.colors.statusbar.url.fg = xresources["*color4"]
+c.colors.statusbar.url.hover.fg = xresources["*color4"]
+c.colors.statusbar.url.success.http.fg = xresources["*color4"]
+c.colors.statusbar.url.success.https.fg = xresources["*color4"]
+c.colors.statusbar.url.warn.fg = xresources["*color3"]
+
+# Completion.
+
+c.colors.completion.category.bg = xresources["*colorAccent"]
+c.colors.completion.category.border.bottom = xresources["*colorAccent"]
+c.colors.completion.category.border.top = xresources["*colorAccent"]
+c.colors.completion.even.bg = xresources["*foreground"]
+c.colors.completion.fg = xresources["*background"]
+c.colors.completion.item.selected.bg = xresources["*colorAccent"]
+c.colors.completion.item.selected.border.bottom = xresources["*colorAccent"]
+c.colors.completion.item.selected.border.top = xresources["*colorAccent"]
+c.colors.completion.item.selected.fg = xresources["*foreground"]
+c.colors.completion.item.selected.match.fg = xresources["*foreground"]
+c.colors.completion.odd.bg = xresources["*foreground"]
+
+# Tabs.
+c.tabs.position = "left"
+c.tabs.padding = {"bottom": 8, "left": 8, "right": 0, "top": 8}
+
+c.tabs.title.format = "{perc}{audio}{current_title}"
+c.tabs.title.format_pinned = "{perc}{current_title}"
+
+c.tabs.favicons.scale = 1.25
+c.tabs.indicator.width = 0
+c.tabs.width = "20%"
+c.tabs.close_mouse_button = "right"
+c.tabs.select_on_remove = "next"
+
+# Colors (themed like Arc-Darker).
+c.colors.tabs.bar.bg = "#ededee"
+c.colors.tabs.odd.bg = "#f5f6f7"
+c.colors.tabs.even.bg = "#f5f6f7"
+
+c.colors.tabs.even.fg = xresources["*background"]
+c.colors.tabs.odd.fg = xresources["*background"]
+c.colors.tabs.pinned.even.bg = xresources["*background"]
+c.colors.tabs.pinned.odd.bg = xresources["*background"]
+c.colors.tabs.pinned.selected.even.bg = xresources["*colorAccent"]
+c.colors.tabs.pinned.selected.odd.bg = xresources["*colorAccent"]
+c.colors.tabs.selected.even.bg = xresources["*colorAccent"]
+c.colors.tabs.selected.even.fg = xresources["*foreground"]
+c.colors.tabs.selected.odd.bg = xresources["*colorAccent"]
+c.colors.tabs.selected.odd.fg = xresources["*foreground"]
+
+# Window.
+c.window.title_format = "qutebrowser{title_sep}{current_title}"
+
+# Messages.
+c.messages.timeout = 5000
+
+# Interacting with page elements.
+c.input.insert_mode.auto_enter = False
+c.input.insert_mode.auto_leave = False
+c.input.insert_mode.leave_on_load = False
diff --git a/etc/qutebrowser/config.d/search.py b/etc/qutebrowser/config.d/search.py
new file mode 100644
index 0000000..bd66c66
--- /dev/null
+++ b/etc/qutebrowser/config.d/search.py
@@ -0,0 +1,36 @@
+c.url.searchengines = {
+ 'DEFAULT': 'https://duckduckgo.com/?q={}',
+ '!i': 'https://duckduckgo.com/?q={}&ia=images&iax=images',
+ '!alpinepkg': 'https://pkgs.alpinelinux.org/packages?name={}',
+ '!appstate': 'https://gb1.appstate.edu/search?q={}',
+ '!archpkg': 'https://archlinux.org/packages/?sort=&q={}',
+ '!archwiki': 'https://wiki.archlinux.org/index.php?title=Special%3ASearch&search={}',
+ '!discogs': 'https://www.discogs.com/search/?q={}',
+ '!gh': 'https://github.com/search?q={}',
+ '!gi': 'https://www.google.com/search?tbm=isch&source=hp&q={}',
+ '!gmaps': 'https://www.google.com/maps/search/{}',
+ '!greasyfork': 'https://greasyfork.org/en/scripts?q={}',
+ '!jira': 'https://jira.appstate.edu/secure/QuickSearch.jspa?searchString={}',
+ '!libgenfic': 'http://libgen.rs/fiction/?q={}',
+ '!libgen': 'http://libgen.rs/search.php?req={}',
+ '!lobsters': 'https://lobste.rs/search?q={}&what=stories&order=relevance',
+ '!mbartist': 'https://musicbrainz.org/search?query={}&type=artist&method=advanced',
+ '!mbrecording': 'https://musicbrainz.org/search?query={}&type=recording&method=advanced',
+ '!mbreleasegroup': 'https://musicbrainz.org/search?query={}&type=release_group&method=advanced',
+ '!mbrelease': 'https://musicbrainz.org/search?query={}&type=release&method=advanced',
+ '!mbwork': 'https://musicbrainz.org/search?query={}&type=work&method=advanced',
+ '!openuserjs': 'https://openuserjs.org/?q={}',
+ '!osm': 'https://www.openstreetmap.org/search?query={}',
+ '!redartist': 'https://redacted.ch/artist.php?artistname={}',
+ '!redforums': 'https://redacted.ch/forums.php?action=search&search={}',
+ '!red': 'https://redacted.ch/torrents.php?searchstr={}',
+ '!redlog': 'https://redacted.ch/log.php?search={}',
+ '!redrequests': 'https://redacted.ch/requests.php?search={}',
+ '!redusers': 'https://redacted.ch/user.php?action=search&search={}',
+ '!tss': 'https://jira.appstate.edu/issues/?jql={}',
+ '!twitter': 'https://twitter.com/search?q={}',
+ '!whosampled': 'https://www.whosampled.com/search/?q={}',
+ '!wiki': 'https://www.wikipedia.org/search-redirect.php?family=wikipedia&language=en&language=en&go=Go&search={}',
+ '!wikt': 'https://www.wiktionary.org/search-redirect.php?family=wiktionary&language=en&go=Go&search={}',
+ '!yt': 'https://www.youtube.com/results?search_query={}',
+}
diff --git a/etc/qutebrowser/config.d/session.py b/etc/qutebrowser/config.d/session.py
new file mode 100644
index 0000000..5414211
--- /dev/null
+++ b/etc/qutebrowser/config.d/session.py
@@ -0,0 +1,19 @@
+# Always restore open sites when qutebrowser is reopened.
+# Equivalent of Firefox's "Restore previous session" setting.
+c.auto_save.session = True
+
+# Load a restored tab as soon as it takes focus.
+c.session.lazy_restore = True
+
+# Unlimited tab focus switching history.
+c.tabs.focus_stack_size = -1
+
+# Close when the last tab is closed.
+c.tabs.last_close = 'close'
+
+# Open a blank page when :open is given with no arguments.
+c.url.default_page = 'about:blank'
+c.url.start_pages = c.url.default_page
+
+# I seem to have better performance with process-per-site rather than process-per-site-instance...
+c.qt.process_model = "process-per-site"
diff --git a/etc/qutebrowser/config.py b/etc/qutebrowser/config.py
new file mode 100644
index 0000000..98aeb41
--- /dev/null
+++ b/etc/qutebrowser/config.py
@@ -0,0 +1,7 @@
+import glob
+
+config.load_autoconfig(True)
+
+for file in glob.iglob(str(config.configdir / 'config.d/*.py')):
+ if file.endswith('.py'):
+ config.source(file)