Update qutebrowser bangs handling
This commit is contained in:
parent
92ec8cf500
commit
1213f06bfc
3 changed files with 23 additions and 16 deletions
|
@ -1,7 +1,10 @@
|
||||||
!lh http://localhost:{}/
|
!lh http://localhost:{}/
|
||||||
!12ft http://12ft.io/proxy?q={}/
|
!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}
|
!alarm https://webuhr.de/#time={unquoted}
|
||||||
|
!cheatsheet https://cheatsheets.zip/?q={}
|
||||||
|
!dictcc https://www.dict.cc/?s={}
|
||||||
!dndü https://www.dnddeutsch.de/uebersetzer/?search={}
|
!dndü https://www.dnddeutsch.de/uebersetzer/?search={}
|
||||||
|
!ede https://www.ebay.de/sch/items/?_nkw={}
|
||||||
|
!gm https://google.com/maps/place/{}
|
||||||
|
!osm https://www.openstreetmap.org/search?query={}
|
||||||
|
!timer https://webuhr.de/timer/#countdown=00:{unquoted}
|
||||||
|
|
|
@ -1,6 +1,18 @@
|
||||||
|
import os
|
||||||
|
|
||||||
import dracula.draw
|
import dracula.draw
|
||||||
|
|
||||||
def init(c, bangs):
|
def get_bangs():
|
||||||
|
bangs = {}
|
||||||
|
config_home = os.environ.get('XDG_CONFIG_HOME', os.path.expanduser('~/.config'))
|
||||||
|
bangs_file = os.path.join(config_home, 'qutebrowser', 'bangs.txt')
|
||||||
|
with open(bangs_file) as f:
|
||||||
|
for line in f:
|
||||||
|
key, value = line.strip().split(' ', maxsplit=1)
|
||||||
|
bangs[key] = value
|
||||||
|
return bangs
|
||||||
|
|
||||||
|
def init(c):
|
||||||
c.auto_save.session = True
|
c.auto_save.session = True
|
||||||
|
|
||||||
#c.colors.webpage.darkmode.enabled = True
|
#c.colors.webpage.darkmode.enabled = True
|
||||||
|
@ -27,10 +39,11 @@ def init(c, bangs):
|
||||||
|
|
||||||
search_engines = {
|
search_engines = {
|
||||||
'ddg': 'https://duckduckgo.com/?q={}',
|
'ddg': 'https://duckduckgo.com/?q={}',
|
||||||
|
'ecosia': 'https://www.ecosia.org/search?q={}',
|
||||||
'qwant': 'https://www.qwant.com/?q={}',
|
'qwant': 'https://www.qwant.com/?q={}',
|
||||||
}
|
}
|
||||||
search_engines['DEFAULT'] = search_engines['qwant']
|
search_engines['DEFAULT'] = search_engines['ecosia']
|
||||||
c.url.searchengines = search_engines | bangs
|
c.url.searchengines = search_engines | get_bangs()
|
||||||
|
|
||||||
c.url.start_pages = [
|
c.url.start_pages = [
|
||||||
'https://rss.serguzim.me/',
|
'https://rss.serguzim.me/',
|
||||||
|
|
|
@ -2,19 +2,10 @@ import keybindings
|
||||||
import common
|
import common
|
||||||
import linkwarden
|
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()
|
config.load_autoconfig()
|
||||||
keybindings.init(config)
|
keybindings.init(config)
|
||||||
common.init(c, bangs)
|
common.init(c)
|
||||||
try:
|
try:
|
||||||
linkwarden.init()
|
linkwarden.init()
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue