config.py (10434B)
1 from qutebrowser.api import interceptor 2 # Autogenerated config.py 3 # 4 # NOTE: config.py is intended for advanced users who are comfortable 5 # with manually migrating the config file on qutebrowser upgrades. If 6 # you prefer, you can also configure qutebrowser using the 7 # :set/:bind/:config-* commands without having to write a config.py 8 # file. 9 # 10 # Documentation: 11 # qute://help/configuring.html 12 # qute://help/settings.html 13 14 # Change the argument to True to still load settings configured via autoconfig.yml 15 config.load_autoconfig(False) 16 17 # Which cookies to accept. With QtWebEngine, this setting also controls 18 # other features with tracking capabilities similar to those of cookies; 19 # including IndexedDB, DOM storage, filesystem API, service workers, and 20 # AppCache. Note that with QtWebKit, only `all` and `never` are 21 # supported as per-domain values. Setting `no-3rdparty` or `no- 22 # unknown-3rdparty` per-domain on QtWebKit will have the same effect as 23 # `all`. If this setting is used with URL patterns, the pattern gets 24 # applied to the origin/first party URL of the page making the request, 25 # not the request URL. With QtWebEngine 5.15.0+, paths will be stripped 26 # from URLs, so URL patterns using paths will not match. With 27 # QtWebEngine 5.15.2+, subdomains are additionally stripped as well, so 28 # you will typically need to set this setting for `example.com` when the 29 # cookie is set on `somesubdomain.example.com` for it to work properly. 30 # To debug issues with this setting, start qutebrowser with `--debug 31 # --logfilter network --debug-flag log-cookies` which will show all 32 # cookies being set. 33 # Type: String 34 # Valid values: 35 # - all: Accept all cookies. 36 # - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail. 37 # - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty. 38 # - never: Don't accept cookies at all. 39 config.set('content.cookies.accept', 'all', 'chrome-devtools://*') 40 41 # Setting dark mode 42 config.set("colors.webpage.darkmode.enabled", False) 43 44 # Which cookies to accept. With QtWebEngine, this setting also controls 45 # other features with tracking capabilities similar to those of cookies; 46 # including IndexedDB, DOM storage, filesystem API, service workers, and 47 # AppCache. Note that with QtWebKit, only `all` and `never` are 48 # supported as per-domain values. Setting `no-3rdparty` or `no- 49 # unknown-3rdparty` per-domain on QtWebKit will have the same effect as 50 # `all`. If this setting is used with URL patterns, the pattern gets 51 # applied to the origin/first party URL of the page making the request, 52 # not the request URL. With QtWebEngine 5.15.0+, paths will be stripped 53 # from URLs, so URL patterns using paths will not match. With 54 # QtWebEngine 5.15.2+, subdomains are additionally stripped as well, so 55 # you will typically need to set this setting for `example.com` when the 56 # cookie is set on `somesubdomain.example.com` for it to work properly. 57 # To debug issues with this setting, start qutebrowser with `--debug 58 # --logfilter network --debug-flag log-cookies` which will show all 59 # cookies being set. 60 # Type: String 61 # Valid values: 62 # - all: Accept all cookies. 63 # - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail. 64 # - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty. 65 # - never: Don't accept cookies at all. 66 config.set('content.cookies.accept', 'all', 'devtools://*') 67 68 # Value to send in the `Accept-Language` header. Note that the value 69 # read from JavaScript is always the global value. 70 # Type: String 71 config.set('content.headers.accept_language', '', 'https://matchmaker.krunker.io/*') 72 73 # User agent to send. The following placeholders are defined: * 74 # `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`: 75 # The underlying WebKit version (set to a fixed value with 76 # QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for 77 # QtWebEngine. * `{qt_version}`: The underlying Qt version. * 78 # `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for 79 # QtWebEngine. * `{upstream_browser_version}`: The corresponding 80 # Safari/Chrome version. * `{qutebrowser_version}`: The currently 81 # running qutebrowser version. The default value is equal to the 82 # unchanged user agent of QtWebKit/QtWebEngine. Note that the value 83 # read from JavaScript is always the global value. With QtWebEngine 84 # between 5.12 and 5.14 (inclusive), changing the value exposed to 85 # JavaScript requires a restart. 86 # Type: FormatString 87 config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version}', 'https://web.whatsapp.com/') 88 89 # User agent to send. The following placeholders are defined: * 90 # `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`: 91 # The underlying WebKit version (set to a fixed value with 92 # QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for 93 # QtWebEngine. * `{qt_version}`: The underlying Qt version. * 94 # `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for 95 # QtWebEngine. * `{upstream_browser_version}`: The corresponding 96 # Safari/Chrome version. * `{qutebrowser_version}`: The currently 97 # running qutebrowser version. The default value is equal to the 98 # unchanged user agent of QtWebKit/QtWebEngine. Note that the value 99 # read from JavaScript is always the global value. With QtWebEngine 100 # between 5.12 and 5.14 (inclusive), changing the value exposed to 101 # JavaScript requires a restart. 102 # Type: FormatString 103 config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}; rv:90.0) Gecko/20100101 Firefox/90.0', 'https://accounts.google.com/*') 104 #Ad/Tracker blocking 105 def filter_discord(info: interceptor.Request): 106 url=info.request_url 107 if ( 108 url.host()=="discord.com" 109 and url.path()=="/api/v9/science" 110 ): 111 info.block() 112 113 interceptor.register(filter_discord) 114 115 #Start pages 116 config.set('url.default_page', 'https://discord.com/channels/@me') 117 c.url.start_pages = ['https://discord.com/channels/@me'] 118 119 #File manager 120 config.set("fileselect.handler", "external") 121 config.set("fileselect.single_file.command", ['st', '-e', 'ranger', '--choosefile', '{}']) 122 config.set("fileselect.multiple_files.command", ['st', '-e', 'ranger', '--choosefiles', '{}']) 123 124 #Color scheme 125 config.set('colors.completion.category.bg', '#667bc4') 126 config.set('colors.completion.odd.bg', '#313338') 127 config.set('colors.completion.even.bg', '#1e1f22') 128 config.set('colors.completion.item.selected.bg', '#5b209a') 129 config.set('colors.completion.item.selected.fg', 'white') 130 config.set('colors.completion.item.selected.border.bottom', '#7e61ab') 131 config.set('colors.completion.item.selected.border.top', '#7e61ab') 132 config.set('colors.statusbar.normal.bg', '#313338') 133 config.set('colors.hints.bg', '#5b209a') 134 config.set('colors.hints.fg', 'white') 135 config.set('hints.border', '1px solid #cab2fb') 136 config.set('colors.tabs.bar.bg', '#313338') 137 config.set('colors.tabs.odd.bg', '#313338') 138 config.set('colors.tabs.even.bg', '#313338') 139 config.set('colors.tabs.selected.odd.bg', '#313338') 140 config.set('colors.tabs.selected.even.bg', '#313338') 141 142 #Bindings for normal mode 143 config.bind('h', 'back') 144 config.bind('j', 'tab-prev') 145 config.bind('k', 'tab-next') 146 config.bind('l', 'forward') 147 config.bind('J', 'tab-prev') 148 config.bind('K', 'tab-next') 149 config.bind('m', 'hint links spawn -d /home/plat/scripts/append_music.sh') 150 config.bind('M', 'hint links spawn ./scripts/play_video.sh {hint-url}') 151 config.bind('I', 'hint links spawn mpv --loop=inf --pause {hint-url}') 152 config.bind('<', 'spawn ./scripts/discord_min.sh') 153 config.bind('>', 'spawn ./scripts/discord_big.sh') 154 config.bind('G', 'spawn ./scripts/discord_bottom.sh') 155 config.bind('D', 'spawn ./scripts/discord_recent.sh') 156 config.bind('s', 'click-element position 350,1030;; cmd-later 1 click-element id channel-attach-upload-file') 157 config.bind('/', 'spawn ./scripts/discord_search.sh') 158 159 #Preferences 160 config.set('window.title_format', 'Discord') 161 config.set('statusbar.widgets', ["keypress", "search_match", "history", "tabs", "progress"]) 162 config.set('tabs.show', 'never') 163 config.set('completion.scrollbar.width', 0) 164 config.set('tabs.indicator.width', 0) 165 config.set('tabs.title.format', '{index}{audio}') 166 config.set('tabs.favicons.show', 'pinned') 167 config.set('tabs.title.alignment', 'center') 168 config.set('tabs.title.format_pinned', '{audio}{index}') 169 170 config.set('content.unknown_url_scheme_policy', 'allow-all') 171 172 #Search engines 173 c.url.searchengines = {'DEFAULT': 'https://searx.stellar-nexus.ru/searxng/search?q={}', 174 } 175 # User agent to send. The following placeholders are defined: * 176 # `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`: 177 # The underlying WebKit version (set to a fixed value with 178 # QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for 179 # QtWebEngine. * `{qt_version}`: The underlying Qt version. * 180 # `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for 181 # QtWebEngine. * `{upstream_browser_version}`: The corresponding 182 # Safari/Chrome version. * `{qutebrowser_version}`: The currently 183 # running qutebrowser version. The default value is equal to the 184 # unchanged user agent of QtWebKit/QtWebEngine. Note that the value 185 # read from JavaScript is always the global value. With QtWebEngine 186 # between 5.12 and 5.14 (inclusive), changing the value exposed to 187 # JavaScript requires a restart. 188 # Type: FormatString 189 config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99 Safari/537.36', 'https://*.slack.com/*') 190 191 # Load images automatically in web pages. 192 # Type: Bool 193 config.set('content.images', True, 'chrome-devtools://*') 194 195 # Load images automatically in web pages. 196 # Type: Bool 197 config.set('content.images', True, 'devtools://*') 198 199 # Enable JavaScript. 200 # Type: Bool 201 config.set('content.javascript.enabled', True, 'chrome-devtools://*') 202 203 # Enable JavaScript. 204 # Type: Bool 205 config.set('content.javascript.enabled', True, 'devtools://*') 206 207 # Enable JavaScript. 208 # Type: Bool 209 config.set('content.javascript.enabled', True, 'chrome://*/*') 210 211 # Enable JavaScript. 212 # Type: Bool 213 config.set('content.javascript.enabled', True, 'qute://*/*')