citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

config.py (5735B)


      1 # Autogenerated config.py
      2 # Documentation:
      3 #   qute://help/configuring.html
      4 #   qute://help/settings.html
      5 import socket
      6 hostname = socket.gethostname()
      7 
      8 config.load_autoconfig(False)
      9 
     10 # Uncomment this to still load settings configured via autoconfig.yml
     11 # config.load_autoconfig()
     12 
     13 # Aliases for commands. The keys of the given dictionary are the
     14 # aliases, while the values are the commands they map to.
     15 # Type: Dict
     16 c.aliases = {'q': 'quit', 'w': 'session-save', 'wq': 'quit --save'}
     17 
     18 config.set('downloads.location.directory', '~/dl')
     19 
     20 # Enable JavaScript.
     21 # Type: Bool
     22 config.set('content.javascript.enabled', True, 'file://*')
     23 
     24 # Enable JavaScript.
     25 # Type: Bool
     26 config.set('content.javascript.enabled', True, 'chrome://*/*')
     27 
     28 # Enable JavaScript.
     29 # Type: Bool
     30 config.set('content.javascript.enabled', True, 'qute://*/*')
     31 
     32 config.set('fonts.default_family', 'terminus')
     33 
     34 if hostname == 'monad':
     35     config.set('zoom.default', 125)
     36 else:
     37     config.set('zoom.default', 125)
     38 
     39 
     40 # Editor (and arguments) to use for the `open-editor` command. The
     41 # following placeholders are defined: * `{file}`: Filename of the file
     42 # to be edited. * `{line}`: Line in which the caret is found in the
     43 # text. * `{column}`: Column in which the caret is found in the text. *
     44 # `{line0}`: Same as `{line}`, but starting from index 0. * `{column0}`:
     45 # Same as `{column}`, but starting from index 0.
     46 # Type: ShellCommand
     47 c.editor.command = ['edit-gui', '{file}', '+{line}']
     48 
     49 # This setting can be used to map keys to other keys. When the key used
     50 # as dictionary-key is pressed, the binding for the key used as
     51 # dictionary-value is invoked instead. This is useful for global
     52 # remappings of keys, for example to map Ctrl-[ to Escape. Note that
     53 # when a key is bound (via `bindings.default` or `bindings.commands`),
     54 # the mapping is ignored.
     55 # Type: Dict
     56 c.bindings.key_mappings = {'<Ctrl+6>': '<Ctrl+^>', '<Ctrl+Enter>': '<Ctrl+Return>', '<Ctrl+j>': '<Return>', '<Ctrl+m>': '<Return>', '<Ctrl+[>': '<Escape>', '<Enter>': '<Return>', '<Shift+Enter>': '<Return>', '<Shift+Return>': '<Return>'}
     57 
     58 # Bindings for normal mode
     59 config.unbind('r')
     60 config.bind('(', 'zoom 100')
     61 config.bind(')', 'zoom 150')
     62 config.bind('d', 'scroll-page 0 1')
     63 config.bind('u', 'scroll-page 0 -1')
     64 config.bind('<Ctrl-m>', 'set-mark')
     65 #config.bind('<Ctrl-d>', 'scroll-page 0 1')
     66 #config.bind('<Ctrl-u>', 'scroll-page 0 -1')
     67 #config.bind('d', 'repeat 10 scroll down')
     68 #config.bind('u', 'repeat 10 scroll up')
     69 #config.bind('<Ctrl-d>', 'scroll-page 0 0.5')
     70 #config.bind('<Ctrl-u>', 'scroll-page 0 -0.5')
     71 config.bind('<Ctrl-r>', 'reload')
     72 config.bind('<Ctrl-e>', 'edit-text')
     73 
     74 config.bind('e', 'open-editor')
     75 config.bind('co', 'tab-only')
     76 config.bind('gl', 'tab-move +')
     77 config.bind('E', 'tab-focus last')
     78 config.bind('gh', 'tab-move -')
     79 
     80 # Remove fixed, sticky elements from pages.
     81 # This is useful to recover full page scrolling
     82 #config.bind(',s', 'jseval javascript:(function(){x=document.querySelectorAll(`*`);for(i=0;i<x.length;i++){elementStyle=getComputedStyle(x[i]);if(elementStyle.position.startsWith("fixed")||elementStyle.position.startsWith("sticky")){x[i].style.position=`absolute`;}}}())')
     83 
     84 config.bind(',s', "jseval javascript:(function(){var elements=document.querySelectorAll(`*`);Array.from(elements).forEach(function(element){var style=getComputedStyle(element);if(style.position.startsWith(`fixed`)||style.position.startsWith(`sticky`)){element.style.cssText+=`position: absolute !important;`;}});})()")
     85 
     86 config.bind('gF', 'hint all tab-bg')
     87 config.unbind('D')
     88 config.bind('Do', 'download-open')
     89 
     90 config.set('downloads.position', 'bottom')
     91 config.set('tabs.select_on_remove', 'last-used')
     92 
     93 config.set('url.default_page', 'about:blank')
     94 #config.set('colors.webpage.darkmode.enabled', True)
     95 #config.set('colors.webpage.preferred_color_scheme', 'light')
     96 config.set('colors.webpage.preferred_color_scheme', 'dark')
     97 
     98 
     99 config.set('url.searchengines', {
    100   'DEFAULT': 'https://google.com/search?q={}',
    101   #'DEFAULT': 'http://duckduckgo.com/?q={}',
    102   'star': 'https://github.com/stars?utf8=%E2%9C%93&q={}',
    103   'so': 'https://google.com/search?q=site:stackoverflow.com {}',
    104   'gl': 'http://www.google.com/search?q={}&btnI=Im+Feeling+Lucky',
    105   'ghi': 'https://github.com/{}/issues',
    106   'wa': 'http://www.wolframalpha.com/input/?i={}',
    107   'ha': 'https://google.com/search?q=site:hackage.haskell.org {}',
    108   'gamedev': 'http://gamedev.stackexchange.com/search?q={}',
    109   'npm': 'https://npmjs.org/search?q={}',
    110   'cargo': 'https://crates.io/search?q={}',
    111   'zen': 'http://brandalliance.zendesk.com/search?query={}',
    112   'g': 'https://www.google.com/search?q={}',
    113   'ud': 'http://www.urbandictionary.com/define.php?term={}',
    114   'alert': 'http://alrt.io/{}',
    115   'hackage': 'http://hackage.haskell.org/package/{}',
    116   'travis': 'https://travis-ci.org/{}',
    117   'ttx': 'https://testnet.smartbit.com.au/tx/{}/',
    118   'e': 'https://www.google.com/search?q=site%3Apackage.elm-lang.org+{}&btnI=Im+Feeling+Lucky',
    119   'key': 'https://www.npmjs.org/browse/keyword/{}',
    120   'h': 'http://holumbus.fh-wedel.de/hayoo/hayoo.html?query={}',
    121   'lh': 'http://localhost:8088/?hoogle={} -package:Cabal',
    122   'hoogle': 'http://www.haskell.org/hoogle/?hoogle={}',
    123   'github': 'http://github.com/search?q={}',
    124   'r': 'https://old.reddit.com/r/{}',
    125   'a': 'http://blockstream.info/address/{}',
    126   'bgg': 'http://www.boardgamegeek.com/metasearch.php?searchtype=game&search={}',
    127   'pgp': 'http://pgp.mit.edu/pks/lookup?search={}&op=index',
    128   'gh': 'https://github.com/{}',
    129   'srht': 'https://sr.ht/~{}',
    130   'rs': 'https://docs.rs/{}/latest',
    131   'crate': 'https://crates.io/crates/{}',
    132   'repo': 'http://npmrepo.com/{}',
    133   'ec': 'http://package.elm-lang.org/packages/elm-lang/{}/latest',
    134   'tx': 'https://blockstream.info/tx/{}'
    135 })
    136 
    137 
    138