diff --git a/.config/qutebrowser/bangs.txt b/.config/qutebrowser/bangs.txt index 2545df6..f064b54 100644 --- a/.config/qutebrowser/bangs.txt +++ b/.config/qutebrowser/bangs.txt @@ -1,7 +1,10 @@ !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} +!cheatsheet https://cheatsheets.zip/?q={} +!dictcc https://www.dict.cc/?s={} !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} diff --git a/.config/qutebrowser/common.py b/.config/qutebrowser/common.py index c0158af..fb27c64 100644 --- a/.config/qutebrowser/common.py +++ b/.config/qutebrowser/common.py @@ -1,6 +1,18 @@ +import os + 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.colors.webpage.darkmode.enabled = True @@ -27,10 +39,11 @@ def init(c, bangs): search_engines = { 'ddg': 'https://duckduckgo.com/?q={}', + 'ecosia': 'https://www.ecosia.org/search?q={}', 'qwant': 'https://www.qwant.com/?q={}', } - search_engines['DEFAULT'] = search_engines['qwant'] - c.url.searchengines = search_engines | bangs + search_engines['DEFAULT'] = search_engines['ecosia'] + c.url.searchengines = search_engines | get_bangs() c.url.start_pages = [ 'https://rss.serguzim.me/', diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index 889e684..7570665 100644 --- a/.config/qutebrowser/config.py +++ b/.config/qutebrowser/config.py @@ -2,19 +2,10 @@ 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, bangs) +common.init(c) try: linkwarden.init() except: