citadel

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

config.py (5980B)


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