import os import subprocess from colors import * # Inside distrobox the container has no kitty/mpv/nvim, so these have to run on the host. _in_container = os.path.exists('/run/.containerenv') _host_prefix = 'distrobox-host-exec ' if _in_container else '' _host_argv = ['distrobox-host-exec'] if _in_container else [] # Autogenerated config.py # Documentation: # qute://help/configuring.html # qute://help/settings.html config.bind('', 'spawn --detach ' + _host_prefix + '/home/connorjohnstone/.local/bin/kitty --title "rbw_floater" bw_prepopulated {url}') config.bind('', 'spawn --detach ' + _host_prefix + 'mpv --force-window yes {url} --x11-name=mpvFloating') config.bind('', 'hint links spawn --detach ' + _host_prefix + 'mpv --force-window yes {hint-url} --x11-name=mpvFloating') config.bind(',t', 'spawn --userscript traggo-log-video') # This is here so configs done via the GUI are still loaded. # Remove it to not load settings done via the GUI. config.load_autoconfig() # config.load_autoconfig(False) # Aliases for commands. The keys of the given dictionary are the # aliases, while the values are the commands they map to. # Type: Dict # c.aliases = {'w': 'session-save', 'q': 'close', 'qa': 'quit', 'wq': 'quit --save', 'wqa': 'quit --save'} # Time interval (in milliseconds) between auto-saves of # config/cookies/etc. # Type: Int # c.auto_save.interval = 15000 # Always restore open sites when qutebrowser is reopened. # Type: Bool # c.auto_save.session = False # Backend to use to display websites. qutebrowser supports two different # web rendering engines / backends, QtWebKit and QtWebEngine. QtWebKit # was discontinued by the Qt project with Qt 5.6, but picked up as a # well maintained fork: https://github.com/annulen/webkit/wiki - # qutebrowser only supports the fork. QtWebEngine is Qt's official # successor to QtWebKit. It's slightly more resource hungry than # QtWebKit and has a couple of missing features in qutebrowser, but is # generally the preferred choice. # Type: String # Valid values: # - webengine: Use QtWebEngine (based on Chromium). # - webkit: Use QtWebKit (based on WebKit, similar to Safari). # c.backend = 'webengine' # This setting can be used to map keys to other keys. When the key used # as dictionary-key is pressed, the binding for the key used as # dictionary-value is invoked instead. This is useful for global # remappings of keys, for example to map Ctrl-[ to Escape. Note that # when a key is bound (via `bindings.default` or `bindings.commands`), # the mapping is ignored. # Type: Dict # c.bindings.key_mappings = {'': '', '': '', '': '', '': '', '': '', '': '', '': '', '': ''} # Background color of the completion widget category headers. # Type: QssColor # c.colors.completion.category.bg = 'qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050)' # Bottom border color of the completion widget category headers. # Type: QssColor # c.colors.completion.category.border.bottom = 'black' # Top border color of the completion widget category headers. # Type: QssColor # c.colors.completion.category.border.top = 'black' # Foreground color of completion widget category headers. # Type: QtColor # c.colors.completion.category.fg = 'white' # Background color of the completion widget for even rows. # Type: QssColor # c.colors.completion.even.bg = '#333333' # Text color of the completion widget. May be a single color to use for # all columns or a list of three colors, one for each column. # Type: List of QtColor, or QtColor # c.colors.completion.fg = ['white', 'white', 'white'] # Background color of the selected completion item. # Type: QssColor # c.colors.completion.item.selected.bg = '#e8c000' # Bottom border color of the selected completion item. # Type: QssColor # c.colors.completion.item.selected.border.bottom = '#bbbb00' # Top border color of the selected completion item. # Type: QssColor # c.colors.completion.item.selected.border.top = '#bbbb00' # Foreground color of the selected completion item. # Type: QtColor # c.colors.completion.item.selected.fg = 'black' # Foreground color of the matched text in the selected completion item. # Type: QtColor # c.colors.completion.item.selected.match.fg = '#ff4444' # Foreground color of the matched text in the completion. # Type: QtColor # c.colors.completion.match.fg = '#ff4444' # Background color of the completion widget for odd rows. # Type: QssColor # c.colors.completion.odd.bg = '#444444' # Color of the scrollbar in the completion view. # Type: QssColor # c.colors.completion.scrollbar.bg = '#333333' # Color of the scrollbar handle in the completion view. # Type: QssColor # c.colors.completion.scrollbar.fg = 'white' # Background color for the download bar. # Type: QssColor # c.colors.downloads.bar.bg = 'black' # Background color for downloads with errors. # Type: QtColor # c.colors.downloads.error.bg = 'red' # Foreground color for downloads with errors. # Type: QtColor # c.colors.downloads.error.fg = 'white' # Color gradient start for download backgrounds. # Type: QtColor # c.colors.downloads.start.bg = '#0000aa' # Color gradient start for download text. # Type: QtColor # c.colors.downloads.start.fg = 'white' # Color gradient stop for download backgrounds. # Type: QtColor # c.colors.downloads.stop.bg = '#00aa00' # Color gradient end for download text. # Type: QtColor # c.colors.downloads.stop.fg = 'white' # Color gradient interpolation system for download backgrounds. # Type: ColorSystem # Valid values: # - rgb: Interpolate in the RGB color system. # - hsv: Interpolate in the HSV color system. # - hsl: Interpolate in the HSL color system. # - none: Don't show a gradient. # c.colors.downloads.system.bg = 'rgb' # Color gradient interpolation system for download text. # Type: ColorSystem # Valid values: # - rgb: Interpolate in the RGB color system. # - hsv: Interpolate in the HSV color system. # - hsl: Interpolate in the HSL color system. # - none: Don't show a gradient. # c.colors.downloads.system.fg = 'rgb' # Background color for hints. Note that you can use a `rgba(...)` value # for transparency. # Type: QssColor c.colors.hints.bg = color2 # Font color for hints. # Type: QssColor c.colors.hints.fg = foreground # Font color for the matched part of hints. # Type: QtColor c.colors.hints.match.fg = background # Background color of the keyhint widget. # Type: QssColor # c.colors.keyhint.bg = 'rgba(0, 0, 0, 80%)' # Text color for the keyhint widget. # Type: QssColor # c.colors.keyhint.fg = '#FFFFFF' # Highlight color for keys to complete the current keychain. # Type: QssColor # c.colors.keyhint.suffix.fg = '#FFFF00' # Background color of an error message. # Type: QssColor # c.colors.messages.error.bg = 'red' # Border color of an error message. # Type: QssColor # c.colors.messages.error.border = '#bb0000' # Foreground color of an error message. # Type: QssColor # c.colors.messages.error.fg = 'white' # Background color of an info message. # Type: QssColor # c.colors.messages.info.bg = 'black' # Border color of an info message. # Type: QssColor # c.colors.messages.info.border = '#333333' # Foreground color of an info message. # Type: QssColor # c.colors.messages.info.fg = 'white' # Background color of a warning message. # Type: QssColor # c.colors.messages.warning.bg = 'darkorange' # Border color of a warning message. # Type: QssColor # c.colors.messages.warning.border = '#d47300' # Foreground color of a warning message. # Type: QssColor # c.colors.messages.warning.fg = 'white' # Background color for prompts. # Type: QssColor # c.colors.prompts.bg = '#444444' # Border used around UI elements in prompts. # Type: String # c.colors.prompts.border = '1px solid gray' # Foreground color for prompts. # Type: QssColor # c.colors.prompts.fg = 'white' # Background color for the selected item in filename prompts. # Type: QssColor # c.colors.prompts.selected.bg = 'grey' # Background color of the statusbar in caret mode. # Type: QssColor # c.colors.statusbar.caret.bg = 'purple' # Foreground color of the statusbar in caret mode. # Type: QssColor # c.colors.statusbar.caret.fg = 'white' # Background color of the statusbar in caret mode with a selection. # Type: QssColor # c.colors.statusbar.caret.selection.bg = '#a12dff' # Foreground color of the statusbar in caret mode with a selection. # Type: QssColor # c.colors.statusbar.caret.selection.fg = 'white' # Background color of the statusbar in command mode. # Type: QssColor # c.colors.statusbar.command.bg = 'black' # Foreground color of the statusbar in command mode. # Type: QssColor # c.colors.statusbar.command.fg = 'white' # Background color of the statusbar in private browsing + command mode. # Type: QssColor # c.colors.statusbar.command.private.bg = 'grey' # Foreground color of the statusbar in private browsing + command mode. # Type: QssColor # c.colors.statusbar.command.private.fg = 'white' # Background color of the statusbar in insert mode. # Type: QssColor # c.colors.statusbar.insert.bg = 'darkgreen' # Foreground color of the statusbar in insert mode. # Type: QssColor # c.colors.statusbar.insert.fg = 'white' # Background color of the statusbar. # Type: QssColor # c.colors.statusbar.normal.bg = xresources['*background'] # Foreground color of the statusbar. # Type: QssColor # c.colors.statusbar.normal.fg = xresources['*foreground'] # Background color of the statusbar in passthrough mode. # Type: QssColor # c.colors.statusbar.passthrough.bg = 'darkblue' # Foreground color of the statusbar in passthrough mode. # Type: QssColor # c.colors.statusbar.passthrough.fg = 'white' # Background color of the statusbar in private browsing mode. # Type: QssColor # c.colors.statusbar.private.bg = '#666666' # Foreground color of the statusbar in private browsing mode. # Type: QssColor # c.colors.statusbar.private.fg = 'white' # Background color of the progress bar. # Type: QssColor # c.colors.statusbar.progress.bg = 'white' # Foreground color of the URL in the statusbar on error. # Type: QssColor # c.colors.statusbar.url.error.fg = 'orange' # Default foreground color of the URL in the statusbar. # Type: QssColor # c.colors.statusbar.url.fg = xresources['*foreground'] # Foreground color of the URL in the statusbar for hovered links. # Type: QssColor # c.colors.statusbar.url.hover.fg = 'aqua' # Foreground color of the URL in the statusbar on successful load # (http). # Type: QssColor # c.colors.statusbar.url.success.http.fg = xresources['*foreground'] # Foreground color of the URL in the statusbar on successful load # (https). # Type: QssColor # c.colors.statusbar.url.success.https.fg = xresources['*foreground'] # Foreground color of the URL in the statusbar when there's a warning. # Type: QssColor # c.colors.statusbar.url.warn.fg = 'yellow' # Background color of the tab bar. # Type: QssColor c.colors.tabs.bar.bg = background def clamp(val, minimum=0, maximum=255): val = int(val) if val < minimum: return minimum if val > maximum: return maximum return val def color_offset(hexstr, offset): hexstr = hexstr.strip('#') r, g, b = int(hexstr[:2], 16), int(hexstr[2:4], 16), int(hexstr[4:], 16) r = clamp(r + offset) g = clamp(g + offset) b = clamp(b + offset) return "#" + "%02x%02x%02x" % (r, g, b) lighter_background = color_offset(background, 30) # Background color of unselected even tabs. # Type: QtColor c.colors.tabs.even.bg = background # Foreground color of unselected even tabs. # Type: QtColor c.colors.tabs.even.fg = foreground # Color for the tab indicator on errors. # Type: QtColor # c.colors.tabs.indicator.error = '#ff0000' # Color gradient start for the tab indicator. # Type: QtColor # c.colors.tabs.indicator.start = '#0000aa' # Color gradient end for the tab indicator. # Type: QtColor # c.colors.tabs.indicator.stop = '#00aa00' # Color gradient interpolation system for the tab indicator. # Type: ColorSystem # Valid values: # - rgb: Interpolate in the RGB color system. # - hsv: Interpolate in the HSV color system. # - hsl: Interpolate in the HSL color system. # - none: Don't show a gradient. # c.colors.tabs.indicator.system = 'rgb' # Background color of unselected odd tabs. # Type: QtColor c.colors.tabs.odd.bg = background # Foreground color of unselected odd tabs. # Type: QtColor c.colors.tabs.odd.fg = foreground # Background color of pinned unselected even tabs. # Type: QtColor c.colors.tabs.pinned.even.bg = background # Foreground color of pinned unselected even tabs. # Type: QtColor c.colors.tabs.pinned.even.fg = foreground # Background color of pinned unselected odd tabs. # Type: QtColor c.colors.tabs.pinned.odd.bg = background # Foreground color of pinned unselected odd tabs. # Type: QtColor c.colors.tabs.pinned.odd.fg = foreground # Background color of pinned selected even tabs. # Type: QtColor c.colors.tabs.pinned.selected.even.bg = color1 # Foreground color of pinned selected even tabs. # Type: QtColor c.colors.tabs.pinned.selected.even.fg = foreground # Background color of pinned selected odd tabs. # Type: QtColor c.colors.tabs.pinned.selected.odd.bg = color1 # Foreground color of pinned selected odd tabs. # Type: QtColor c.colors.tabs.pinned.selected.odd.fg = foreground # Background color of selected even tabs. # Type: QtColor c.colors.tabs.selected.even.bg = color1 # Foreground color of selected even tabs. # Type: QtColor c.colors.tabs.selected.even.fg = foreground # Background color of selected odd tabs. # Type: QtColor c.colors.tabs.selected.odd.bg = color1 # Foreground color of selected odd tabs. # Type: QtColor c.colors.tabs.selected.odd.fg = foreground # Background color for webpages if unset (or empty to use the theme's # color). # Type: QtColor # c.colors.webpage.bg = 'white' # Number of commands to save in the command history. 0: no history / -1: # unlimited # Type: Int # c.completion.cmd_history_max_items = 100 # Delay (in milliseconds) before updating completions after typing a # character. # Type: Int # c.completion.delay = 0 # Height (in pixels or as percentage of the window) of the completion. # Type: PercOrInt # c.completion.height = '50%' # Minimum amount of characters needed to update completions. # Type: Int # c.completion.min_chars = 1 # Which categories to show (in which order) in the :open completion. # Type: FlagList # Valid values: # - searchengines # - quickmarks # - bookmarks # - history # c.completion.open_categories = ['searchengines', 'quickmarks', 'bookmarks', 'history'] # Move on to the next part when there's only one possible completion # left. # Type: Bool # c.completion.quick = True # Padding (in pixels) of the scrollbar handle in the completion window. # Type: Int # c.completion.scrollbar.padding = 2 # Width (in pixels) of the scrollbar in the completion window. # Type: Int # c.completion.scrollbar.width = 12 # When to show the autocompletion window. # Type: String # Valid values: # - always: Whenever a completion is available. # - auto: Whenever a completion is requested. # - never: Never. # c.completion.show = 'always' # Shrink the completion to be smaller than the configured size if there # are no scrollbars. # Type: Bool # c.completion.shrink = False # Format of timestamps (e.g. for the history completion). See # https://sqlite.org/lang_datefunc.html for allowed substitutions. # Type: String # c.completion.timestamp_format = '%Y-%m-%d' # Execute the best-matching command on a partial match. # Type: Bool # c.completion.use_best_match = False # A list of patterns which should not be shown in the history. This only # affects the completion. Matching URLs are still saved in the history # (and visible on the qute://history page), but hidden in the # completion. Changing this setting will cause the completion history to # be regenerated on the next start, which will take a short while. # Type: List of UrlPattern # c.completion.web_history.exclude = [] # Number of URLs to show in the web history. 0: no history / -1: # unlimited # Type: Int # c.completion.web_history.max_items = -1 # Require a confirmation before quitting the application. # Type: ConfirmQuit # Valid values: # - always: Always show a confirmation. # - multiple-tabs: Show a confirmation if multiple tabs are opened. # - downloads: Show a confirmation if downloads are running # - never: Never show a confirmation. # c.confirm_quit = ['never'] # Automatically start playing `