[qutebrowser] Lint and update options to 1.13

Updated legacy options to conform to qutebrowser 1.13 format.
Made file conform to pylint linter.
This commit is contained in:
Marty Oehme 2020-07-08 09:52:14 +02:00
parent 966d87b3ea
commit 14d56b5544
No known key found for this signature in database
GPG key ID: 0CCB0526EFB9611A

View file

@ -1,8 +1,8 @@
from qutebrowser.config.configfiles import ConfigAPI # noqa: F401
from qutebrowser.config.config import ConfigContainer # noqa: F401
import os import os
from qutebrowser.config.config import ConfigContainer # noqa: F401
from qutebrowser.config.configfiles import ConfigAPI # noqa: F401
# Autogenerated config.py # Autogenerated config.py
# Documentation: # Documentation:
# qute://help/configuring.html # qute://help/configuring.html
@ -22,7 +22,7 @@ c.content.host_blocking.lists = [
"http://malwaredomains.lehigh.edu/files/justdomains.zip", "http://malwaredomains.lehigh.edu/files/justdomains.zip",
"http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext", "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext",
] ]
c.content.host_blocking.whitelist = ['piwik.org'] c.content.host_blocking.whitelist = ["piwik.org"]
c.content.autoplay = False c.content.autoplay = False
c.content.pdfjs = False c.content.pdfjs = False
@ -31,7 +31,7 @@ js_whitelist = [
"*://*.youtube.com/*", "*://*.youtube.com/*",
"*://127.0.0.1/*", "*://127.0.0.1/*",
"*://asciinema.org/*", "*://asciinema.org/*",
"*://darksky.net/*" "*://darksky.net/*",
"*://deepl.com/*", "*://deepl.com/*",
"*://duckduckgo.com/*", "*://duckduckgo.com/*",
"*://github.com/*", "*://github.com/*",
@ -61,17 +61,18 @@ c.editor.command = ["alacritty", "-e", "nvim", "-f", "{file}"]
# Tab-Bar # Tab-Bar
# have tab bar on the right, not on the top # have tab bar on the right, not on the top
c.tabs.background = True c.tabs.background = True
c.tabs.title.format = '{index} {audio}{perc}{current_title}' c.tabs.title.format = "{index} {audio}{perc}{current_title}"
c.tabs.position = "right" c.tabs.position = "right"
c.tabs.width = "15%" c.tabs.width = "15%"
# give the browser nice theme colors # give the browser nice theme colors
config.source('colorscheme.py') config.source("colorscheme.py")
# Status bar # Status bar
# should be visible to prevent 'jumping' bug, see https://github.com/qutebrowser/qutebrowser/issues/2236 # should be visible to prevent 'jumping' bug,
# TODO think about implementing a simple toggle for the statusbar, like for the tabs # see https://github.com/qutebrowser/qutebrowser/issues/2236
c.statusbar.hide = False # TODO think about implementing a simple toggle for the statusbar
c.statusbar.show = "in-mode"
# FUNCTION # FUNCTION
# -------- # --------
@ -84,19 +85,22 @@ c.session.lazy_restore = True
leader = "<Space>" leader = "<Space>"
# toggles ('cycles') between tabs always showing, or only when switching between them # toggles ('cycles') between tabs always showing, or only when switching between them
config.bind(leader + 'tt', 'config-cycle -t tabs.show switching always') config.bind(leader + "tt", "config-cycle -t tabs.show switching always")
config.bind(leader + 'th', 'set tabs.position bottom') config.bind(leader + "th", "set tabs.position bottom")
config.bind(leader + 'tH', 'set tabs.position top') config.bind(leader + "tH", "set tabs.position top")
config.bind(leader + 'tv', 'set tabs.position right') config.bind(leader + "tv", "set tabs.position right")
config.bind(leader + 'tV', 'set tabs.position left') config.bind(leader + "tV", "set tabs.position left")
# [M]edia shortcuts - watch, queue, download media # [M]edia shortcuts - watch, queue, download media
# bind mpv to play the current page/links, using a single instance which queues the next link passed # bind mpv to play the current page/links, using a single instance which queues the next link passed
config.bind(leader + 'M', 'spawn umpv {url}') config.bind(leader + "M", "spawn umpv {url}")
config.bind(leader + 'm', 'hint links spawn umpv {hint-url}') config.bind(leader + "m", "hint links spawn umpv {hint-url}")
# bind youtube-dl to download the current page/links # bind youtube-dl to download the current page/links
config.bind(leader + 'dM', 'spawn youtube-dl -o ~/videos/%(title)s.%(ext)s {url}') config.bind(leader + "dM", "spawn youtube-dl -o ~/videos/%(title)s.%(ext)s {url}")
config.bind(leader + 'dm', 'hint --rapid links spawn youtube-dl -o ~/videos/%(title)s.%(ext)s {url}') config.bind(
leader + "dm",
"hint --rapid links spawn youtube-dl -o ~/videos/%(title)s.%(ext)s {url}",
)
# Use q for quitting a tab (mimicks vim buffer) - qa is used for exiting # Use q for quitting a tab (mimicks vim buffer) - qa is used for exiting
c.aliases["q"] = "tab-close" c.aliases["q"] = "tab-close"
@ -104,28 +108,31 @@ c.aliases["q"] = "tab-close"
c.aliases["e"] = "session-load" c.aliases["e"] = "session-load"
# edit current form field in vim # edit current form field in vim
config.bind(leader + 'e', 'open-editor') config.bind(leader + "e", "open-editor")
# bookmarklet aliases: # bookmarklet aliases:
# currently the idea is to prefix bookmarklets with b (as in open "bookmarklet") # currently the idea is to prefix bookmarklets with b (as in open "bookmarklet")
# wallabag add current page, either with walla command, or <leader>bw # wallabag add current page, either with walla command, or <leader>bw
c.aliases["add-wallabag"] = "spawn --userscript wallabag_add.sh" c.aliases["add-wallabag"] = "spawn --userscript wallabag_add.sh"
config.bind(leader + 'bw', 'add-wallabag', mode='normal') config.bind(leader + "bw", "add-wallabag", mode="normal")
# add to (my) shaarli instance # add to (my) shaarli instance
c.aliases["add-shaarli"] = "spawn --userscript shaarli_add.sh" c.aliases["add-shaarli"] = "spawn --userscript shaarli_add.sh"
config.bind(leader + 'bs', 'add-shaarli', mode='normal') config.bind(leader + "bs", "add-shaarli", mode="normal")
# re-opens the current page on the web archive overview page # re-opens the current page on the web archive overview page
c.aliases["archive-open"] = "open https://web.archive.org/web/{url}" c.aliases["archive-open"] = "open https://web.archive.org/web/{url}"
config.bind(leader + 'ba', 'archive-open', mode='normal') config.bind(leader + "ba", "archive-open", mode="normal")
# save current page to pdf file # save current page to pdf file
c.aliases["printpdf"] = "spawn --userscript pagetopdf.sh" c.aliases["printpdf"] = "spawn --userscript pagetopdf.sh"
# set to gp, to mirror gd (download) just as go-Pdfdownload # set to gp, to mirror gd (download) just as go-Pdfdownload
config.bind('gp', 'printpdf', mode='normal') config.bind("gp", "printpdf", mode="normal")
# set stylesheets for the browser to use # set stylesheets for the browser to use
# leader - ss to remove all applied stylesheets # leader - ss to remove all applied stylesheets
config.bind(leader + 's', 'config-cycle content.user_stylesheets ' + 'stylesheets/stylesheet.css ""') config.bind(
leader + "s",
"config-cycle content.user_stylesheets " + 'stylesheets/stylesheet.css ""',
)
# Enable and disable javascript # Enable and disable javascript
config.bind(leader + "js", "config-cycle content.javascript.enabled true false") config.bind(leader + "js", "config-cycle content.javascript.enabled true false")