Update qutebrowser bangs handling
This commit is contained in:
parent
92ec8cf500
commit
1213f06bfc
3 changed files with 23 additions and 16 deletions
|
@ -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/',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue