From m, 3 Weeks ago, written in Plain Text.
This paste will check out in 1 Second.
Embed
  1. # Configuration for qutebrowser
  2. #
  3. # I want to do most of the stuff here because the autoconfig.yml gets
  4. # reset sometimes, especially when using separate profiles. To be sure
  5. # things get configured, do them here.
  6.  
  7. # I still want the config from the GUI
  8. # 1. It is convenient to change a setting in the GUI sometimes
  9. # 2. If it needs to be changed I can override it below explicitly
  10. #config.load_autoconfig()
  11.  
  12. # Backend to use to display websites. qutebrowser supports two different
  13. # web rendering engines / backends, QtWebKit and QtWebEngine. QtWebKit
  14. # was discontinued by the Qt project with Qt 5.6, but picked up as a
  15. # well maintained fork: https://github.com/annulen/webkit/wiki -
  16. # qutebrowser only supports the fork. QtWebEngine is Qt's official
  17. # successor to QtWebKit. It's slightly more resource hungry than
  18. # QtWebKit and has a couple of missing features in qutebrowser, but is
  19. # generally the preferred choice.
  20. # Type: String
  21. # Valid values:
  22. #   - webengine: Use QtWebEngine (based on Chromium).
  23. #   - webkit: Use QtWebKit (based on WebKit, similar to Safari).
  24. # FIXME: I can only use webkit, webengine on Nouveau does not have hardware accell and will be slow
  25. # FIXME: with webkit I cannot use:
  26. #  - netflix : RESOLVED by making webengine profile
  27. #  - trezor : could be resolved by making a separate profile
  28. #
  29.  
  30. #
  31. # Local config variables
  32. USERSCRIPTS="/home/mrb/.config/qutebrowser/userscripts/"
  33.  
  34. # As long as we haven't decided yet, we can use a switch
  35. webkit=False
  36. if webkit:
  37.     c.backend = 'webkit'
  38.     c.content.developer_extras = True
  39.     c.content.dns_prefetch = True
  40.     c.content.frame_flattening = False
  41. else:
  42.     c.backend = 'webengine'
  43.     # 'software-opengl' is the only one that works for me on the T510 (nouveau)
  44.     c.qt.force_software_rendering = 'software-opengl'
  45.     # Additional arguments to pass to Qt, without leading `--`. With
  46.     # QtWebEngine, some Chromium arguments (see
  47.     # https://peter.sh/experiments/chromium-command-line-switches/ for a
  48.     # list) will work.
  49.     # Type: List of String
  50.     # Only useful for webengine which does netflix. Duh.
  51.     # c.qt.args = ['ppapi-widevine-path=/usr/lib/qt/plugins/ppapi/libwidevinecdmadapter.so']
  52.  
  53.  
  54. # Enable extra tools for Web developers. This needs to be enabled for
  55. # `:inspector` to work and also adds an _Inspect_ entry to the context
  56. c.content.geolocation = 'ask'
  57. c.content.headers.accept_language = ':'
  58.  
  59. # Editor integration (for editting config I guess)
  60. c.editor.command = ["emacsclient", "-c", "+{line}:{column}","{file}"]
  61.  
  62.  
  63. # Enable JavaScript for files/local chrome and special pages
  64. config.set('content.javascript.enabled', True, 'file://*')
  65. config.set('content.javascript.enabled', True, 'chrome://*/*')
  66. config.set('content.javascript.enabled', True, 'qute://*/*')
  67.  
  68. ## User interface
  69. c.tabs.background = True
  70. # Create some room around tabs
  71. c.tabs.padding={"top": 5, "bottom": 5, "left": 5, "right": 5}
  72. # Completion window takes 25% of the screen
  73. c.completion.height='25%'
  74.  
  75. # Custom colors, trying to adhere to base16.nord theme
  76. c.colors.statusbar.command.bg = '#2e3440'
  77. c.colors.statusbar.command.private.bg = '#bf616a'
  78. c.colors.statusbar.normal.bg = '#2e3440'
  79. c.colors.statusbar.private.bg = '#bf616a'
  80. c.colors.statusbar.url.success.http.fg = '#eceff4'
  81. c.colors.statusbar.url.success.https.fg = '#ebcb8b'
  82. c.colors.tabs.even.bg = '#4c566a'
  83. c.colors.tabs.even.fg = '#eceff4'
  84. c.colors.tabs.odd.bg = '#434c5e'
  85. c.colors.tabs.odd.fg = '#eceff4'
  86. c.colors.tabs.selected.even.bg = '#ebcb8b'
  87. c.colors.tabs.selected.even.fg = 'black'
  88. c.colors.tabs.selected.odd.bg  = '#ebcb8b'
  89. c.colors.tabs.selected.odd.fg  = 'black'
  90. #c.colors.tabs.pinned.even.bg = '#81a1c1'
  91. #c.colors.tabs.pinned.odd.bg = '#5e81ac'
  92. c.colors.webpage.bg = 'white'
  93.  
  94.  
  95. # Search engines
  96. c.url.searchengines['aw'] = 'https://wiki.archlinux.org/?search={}'
  97. c.url.searchengines['gg'] = 'http://www.google.com/search?hl=en&source=hp&ie=ISO-8859-l&q={}'
  98. c.url.searchengines['yt'] = 'https://www.youtube.com/results?search_query={}'
  99. c.url.searchengines['wp'] = 'https://secure.wikimedia.org/wikipedia/en/w/index.php?title=Special%%3ASearch&search={}'
  100. c.url.searchengines['gh'] = 'https://github.com/search?q={}&type=Code'
  101.  
  102. # Aliases are :-commands, so type :gh to go to github directly
  103. c.aliases['yt']   = 'open -t https://youtube.com'
  104. c.aliases['gh']   = 'open -t https://github.com'
  105. c.aliases['lna']  = 'open -t https://lna.hsdev.com'
  106. c.aliases['qb']   = 'open -t https://qutebrowser.org'
  107. c.aliases['odoo'] = 'open -t https://partners.hsdev.com'
  108.  
  109. # I want to run this while a selection is active and create a qr code on screen
  110. # This does now depend on the auto copy feature in use
  111. c.aliases['qr'] = 'spawn --userscript ' + USERSCRIPTS + 'qrcode'
  112.  
  113. ## Key bindings are in a separate file
  114.  
  115. bindingstyle='mine'
  116. # I want emacs bindings?
  117. # Commenting this out will set everything back to default.
  118. if bindingstyle == 'emacs':
  119.     config.source('qb-emacs-bindings.py')
  120.  
  121. if bindingstyle == 'mine':
  122.     config.source('qb-my-bindings.py')
  123.  
  124.  
  125.  
  126. # Cookie settings per domain (only relevant for webkit?)
  127. # Reference: https://developer.chrome.com/extensions/match_patterns
  128.  
  129. # This is what I want, but it isn't supported yet.
  130. ##config.set('content.cookies.accept', 'never', '*://*.facebook.com/*/*')
  131.  
  132.  
  133. # Plugin support (global off, enable per URL pattern when needed)
  134. c.content.plugins = False
  135.  
  136. # Add a local blocklist (a file)
  137. c.content.host_blocking.lists.append( str(config.configdir) + "/blocked_hosts.local")
  138.  
  139. # Add the contents of the whitelist file
  140. #whitelist=open(str(config.configdir) + "/whitelisted_hosts.local")
  141. #c.content.host_blocking.whitelist = [line.strip() for line in whitelist]
  142.  
  143.  
  144. # Use a user stylesheet to hide some ads here and there
  145. c.content.user_stylesheets.append( str(config.configdir) + "/ad-hiding.css")
  146.