Toggle dark mode in Qutebrowser

Qutebrowser has a built-in dark mode option that turns websites dark even if they don’t support dark mode themselves. It’s enabled by setting a configuration option in ~/.config/qutebrowser/config.py:

c.colors.webpage.darkmode.enabled = True

Although dark mode works surprisingly well, it results in unreadable text on some web pages. To quickly disable it, cycle the colors.webpage.darkmode.enabled option using the :config-cycle command1:

:config-cycle colors.webpage.darkmode.enabled

To enable and disable dark mode even faster, create a command alias. For example, to create an alias to call the :config-cycle command by just typing :darkmode:

c.aliases['darkmode'] = "config-cycle colors.webpage.darkmode.enabled"

  1. Qutebrowser has command autocomplete, so type :config-cycle, then press SPC to reveal all configuration options. Then, type part of the option, like darkmode.e to find the option.

    ↩︎