diff --git a/core/bar/decorated.py b/core/bar/decorated.py index 65795a6..4600aa8 100644 --- a/core/bar/decorated.py +++ b/core/bar/decorated.py @@ -3,11 +3,11 @@ from core.bar.utils import base, icon_font, powerline, rectangle from extras import Clock, GroupBox, TextBox, Volume, modify, widget -from utils import color +from utils.palette import palette bar = { - "background": color["bg"], - "border_color": color["bg"], + "background": palette.base, + "border_color": palette.base, "border_width": 4, "margin": [10, 10, 0, 10], "opacity": 1, @@ -46,16 +46,16 @@ def groups(bg) -> GroupBox: background=bg, borderwidth=1, colors=[ - color["cyan"], - color["magenta"], - color["yellow"], - color["red"], - color["blue"], - color["green"], + palette.teal, + palette.pink, + palette.yellow, + palette.red, + palette.blue, + palette.green, ], - highlight_color=color["bg"], + highlight_color=palette.base, highlight_method="line", - inactive=color["black"], + inactive=palette.surface2, invert=True, padding=7, rainbow=True, @@ -203,19 +203,19 @@ def clock(bg, fg) -> list: widgets = [ widget.Spacer(length=2), - logo(color["blue"], color["bg"]), - sep(color["black"], offset=-8), + logo(palette.blue, palette.base), + sep(palette.surface2, offset=-8), groups(None), - sep(color["black"], offset=4, padding=4), - *volume(color["magenta"], color["bg"]), - *updates(color["red"], color["bg"]), + sep(palette.surface2, offset=4, padding=4), + *volume(palette.pink, palette.base), + *updates(palette.red, palette.base), widget.Spacer(), - window_name(None, color["fg"]), + window_name(None, palette.text), widget.Spacer(), - *cpu(color["green"], color["bg"]), - *ram(color["yellow"], color["bg"]), - *disk(color["cyan"], color["bg"]), - sep(color["black"]), - *clock(color["magenta"], color["bg"]), + *cpu(palette.green, palette.base), + *ram(palette.yellow, palette.base), + *disk(palette.teal, palette.base), + sep(palette.surface2), + *clock(palette.pink, palette.base), widget.Spacer(length=2), ] diff --git a/core/layouts.py b/core/layouts.py index a2fe4fc..292017f 100644 --- a/core/layouts.py +++ b/core/layouts.py @@ -1,11 +1,11 @@ from libqtile import layout -from utils import color from utils.match import title, wm_class +from utils.palette import palette config = { - "border_focus": color["magenta"], - "border_normal": color["bg"], + "border_focus": palette.pink, + "border_normal": palette.base, "border_width": 0, "margin": 10, "single_border_width": 0, @@ -23,8 +23,8 @@ ] floating_layout = layout.Floating( - border_focus=color["white"], - border_normal=color["bg"], + border_focus=palette.subtext1, + border_normal=palette.base, border_width=0, fullscreen_border_width=0, float_rules=[ diff --git a/utils/__init__.py b/utils/__init__.py index 0645415..b9a8882 100644 --- a/utils/__init__.py +++ b/utils/__init__.py @@ -1,9 +1,7 @@ from utils import dir -from utils.colors import color from utils.settings import config __all__ = [ - "color", "config", "dir", ] diff --git a/utils/colors.py b/utils/colors.py deleted file mode 100644 index 81ebc5c..0000000 --- a/utils/colors.py +++ /dev/null @@ -1,20 +0,0 @@ -import json - -from utils import dir -from utils.settings import config - -colorschemes = [ - "catppuccin", - "gruvbox_material", - "material_ocean", -] - -if config["colorscheme"] in colorschemes: - colorscheme = f"{config['colorscheme']}.json" -else: - colorscheme = "catppuccin.json" - -path = f"{dir.get()}/utils/colorscheme/{colorscheme}" - -with open(path, "r") as file: - color = json.load(file) diff --git a/utils/colorscheme/catppuccin.json b/utils/colorscheme/catppuccin.json deleted file mode 100644 index 0459b74..0000000 --- a/utils/colorscheme/catppuccin.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "bg": "#1e1e2e", - "fg": "#cdd6f4", - "black": "#585b70", - "red": "#f38ba8", - "green": "#a6e3a1", - "yellow": "#f9e2af", - "blue": "#89b4fa", - "magenta": "#f5c2e7", - "cyan": "#94e2d5", - "white": "#bac2de" -} diff --git a/utils/colorscheme/gruvbox_material.json b/utils/colorscheme/gruvbox_material.json deleted file mode 100644 index e9e93f1..0000000 --- a/utils/colorscheme/gruvbox_material.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "bg": "#292828", - "fg": "#d4be98", - "black": "#3c3836", - "red": "#ea6962", - "green": "#a9b665", - "yellow": "#d8a657", - "blue": "#7daea3", - "magenta": "#d3869b", - "cyan": "#89b482", - "white": "#d4be98" -} diff --git a/utils/colorscheme/material_ocean.json b/utils/colorscheme/material_ocean.json deleted file mode 100644 index 30c5e88..0000000 --- a/utils/colorscheme/material_ocean.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "bg": "#0f101a", - "fg": "#c5c9de", - "black": "#282a40", - "red": "#f07178", - "green": "#cdea9f", - "yellow": "#ffd37e", - "blue": "#93bbff", - "magenta": "#d3a7ee", - "cyan": "#98e4ff", - "white": "#bfd5de" -} diff --git a/utils/colorscheme/template.json b/utils/colorscheme/template.json deleted file mode 100644 index f5b9bce..0000000 --- a/utils/colorscheme/template.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "bg": "#", - "fg": "#", - "black": "#", - "red": "#", - "green": "#", - "yellow": "#", - "blue": "#", - "magenta": "#", - "cyan": "#", - "white": "#" -} diff --git a/utils/palette.py b/utils/palette.py new file mode 100644 index 0000000..b3a7387 --- /dev/null +++ b/utils/palette.py @@ -0,0 +1,36 @@ +from dataclasses import dataclass + + +# https://github.com/catppuccin/catppuccin#-palette +# fmt: off +@dataclass(frozen=True) +class Catppuccin: + rosewater = "#f5e0dc" + flamingo = "#f2cdcd" + pink = "#f5c2e7" + mauve = "#cba6f7" + red = "#f38ba8" + maroon = "#eba0ac" + peach = "#fab387" + yellow = "#f9e2af" + green = "#a6e3a1" + teal = "#94e2d5" + sky = "#89dceb" + sapphire = "#74c7ec" + blue = "#89b4fa" + lavender = "#b4befe" + text = "#cdd6f4" + subtext1 = "#bac2de" + subtext0 = "#a6adc8" + overlay2 = "#9399b2" + overlay1 = "#7f849c" + overlay0 = "#6c7086" + surface2 = "#585b70" + surface1 = "#45475a" + surface0 = "#313244" + base = "#1e1e2e" + mantle = "#181825" + crust = "#11111b" + + +palette = Catppuccin() diff --git a/utils/settings.py b/utils/settings.py index 81c02a4..9b8bd1a 100644 --- a/utils/settings.py +++ b/utils/settings.py @@ -7,7 +7,6 @@ settings = { "bar": "decorated", "browser": "", - "colorscheme": "catppuccin", "terminal": { "main": "", "floating": "",