Refactor qutebrowser searchengine config
This commit is contained in:
parent
f47badde11
commit
ed65fd6c29
5 changed files with 32 additions and 12 deletions
6
.config/qutebrowser/.gitignore
vendored
Normal file
6
.config/qutebrowser/.gitignore
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
autoconfig.yml
|
||||
blocked-hosts
|
||||
bookmarks/
|
||||
dracula/
|
||||
qsettings/
|
||||
quickmarks
|
7
.config/qutebrowser/bangs.txt
Normal file
7
.config/qutebrowser/bangs.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
!lh http://localhost:{}/
|
||||
!12ft http://12ft.io/proxy?q={}/
|
||||
!osm https://www.openstreetmap.org/search?query={}
|
||||
!cheatsheet https://cheatsheets.zip/?q={}
|
||||
!timer https://webuhr.de/timer/#countdown=00:{unquoted}
|
||||
!alarm https://webuhr.de/#time={unquoted}
|
||||
!dndü https://www.dnddeutsch.de/uebersetzer/?search={}
|
|
@ -1,6 +1,6 @@
|
|||
import dracula.draw
|
||||
|
||||
def init(c):
|
||||
def init(c, bangs):
|
||||
c.auto_save.session = True
|
||||
|
||||
#c.colors.webpage.darkmode.enabled = True
|
||||
|
@ -21,21 +21,17 @@ def init(c):
|
|||
c.tabs.background = True
|
||||
c.tabs.mousewheel_switching = False
|
||||
c.tabs.new_position.related = 'last'
|
||||
c.tabs.pinned.frozen = False
|
||||
c.tabs.pinned.frozen = True
|
||||
|
||||
c.qt.workarounds.remove_service_workers = True
|
||||
|
||||
c.url.searchengines = {
|
||||
'DEFAULT': 'https://duckduckgo.com/?q={}',
|
||||
search_engines = {
|
||||
'ddg': 'https://duckduckgo.com/?q={}',
|
||||
'kagi': 'https://kagi.com/search?q={}',
|
||||
'!lh': 'http://localhost:{}/',
|
||||
'!12ft': 'http://12ft.io/proxy?q={}/',
|
||||
'!osm': 'https://www.openstreetmap.org/search?query={}',
|
||||
'!cheatsheet': 'https://cheatsheets.zip/?q={}',
|
||||
'!timer': 'https://webuhr.de/timer/#countdown=00:{unquoted}',
|
||||
'!alarm': 'https://webuhr.de/#time={unquoted}',
|
||||
'qwant': 'https://www.qwant.com/?q={}',
|
||||
}
|
||||
search_engines['DEFAULT'] = search_engines['qwant']
|
||||
c.url.searchengines = search_engines | bangs
|
||||
|
||||
c.url.start_pages = [
|
||||
'https://rss.serguzim.me/',
|
||||
'http://homeassistant-33:8123/',
|
||||
|
|
|
@ -2,9 +2,19 @@ import keybindings
|
|||
import common
|
||||
import linkwarden
|
||||
|
||||
bangs = {}
|
||||
try:
|
||||
with (config.configdir / 'bangs.txt').open() as f:
|
||||
for line in f:
|
||||
key, value = line.strip().split(' ', maxsplit=1)
|
||||
bangs[key] = value
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
config.load_autoconfig()
|
||||
keybindings.init(config)
|
||||
common.init(c)
|
||||
common.init(c, bangs)
|
||||
try:
|
||||
linkwarden.init()
|
||||
except:
|
||||
|
|
|
@ -9,6 +9,7 @@ def get_links_part(cursor):
|
|||
request = urllib.request.Request(linkwarden_url + "/api/v1/links?sort=0&cursor=" + str(cursor), headers={
|
||||
'Authorization': 'Bearer ' + linkwarden_token
|
||||
})
|
||||
request.timeout = 5
|
||||
response = urllib.request.urlopen(request)
|
||||
data = response.read().decode("utf-8")
|
||||
data = data.replace("\\n", " ").replace("\\r", " ").replace("\\t", " ")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue