qutebrowser: use catppuccin mocha theme

This commit is contained in:
surtur 2023-09-02 21:22:19 +02:00
parent 35de512300
commit 7010e44c54
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

@ -2,7 +2,11 @@
# pyflakes: noqa
from qutebrowser.config.configfiles import ConfigAPI # noqa: F401
from qutebrowser.config.config import ConfigContainer # noqa: F401
import dracula.draw
# import dracula.draw
import os
from urllib.request import urlopen
config: ConfigAPI = config # noqa: F821 pylint: disable=E0602,C0103
c: ConfigContainer = c # noqa: F821 pylint: disable=E0602,C0103
# ref: https://www.qutebrowser.org/doc/help/configuring.html
@ -23,6 +27,18 @@ c: ConfigContainer = c # noqa: F821 pylint: disable=E0602,C0103
# autoconfig.yml
config.load_autoconfig(False)
if not os.path.exists(config.configdir / "theme.py"):
theme = "https://raw.githubusercontent.com/catppuccin/qutebrowser/main/setup.py"
with urlopen(theme) as themehtml:
with open(config.configdir / "theme.py", "a") as file:
file.writelines(themehtml.read().decode("utf-8"))
if os.path.exists(config.configdir / "theme.py"):
import theme
theme.setup(c, 'mocha', True)
# Aliases for commands. The keys of the given dictionary are the
# aliases, while the values are the commands they map to.
# Type: Dict
@ -408,10 +424,10 @@ config.bind('<Ctrl-->', 'zoom-out')
config.bind(',sm', 'set-cmd-text :download --mhtml')
dracula.draw.blood(c, {
'spacing': {
# set to zero to not alter the default tab sizes
'vertical': 0,
'horizontal': 0
}
})
#dracula.draw.blood(c, {
# 'spacing': {
# # set to zero to not alter the default tab sizes
# 'vertical': 0,
# 'horizontal': 0
# }
#})