Skip to content

Commit

Permalink
utils: add palette.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jx11r committed Jul 8, 2023
1 parent 6641983 commit 9525ee9
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 98 deletions.
44 changes: 22 additions & 22 deletions core/bar/decorated.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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),
]
10 changes: 5 additions & 5 deletions core/layouts.py
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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=[
Expand Down
2 changes: 0 additions & 2 deletions utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from utils import dir
from utils.colors import color
from utils.settings import config

__all__ = [
"color",
"config",
"dir",
]
20 changes: 0 additions & 20 deletions utils/colors.py

This file was deleted.

12 changes: 0 additions & 12 deletions utils/colorscheme/catppuccin.json

This file was deleted.

12 changes: 0 additions & 12 deletions utils/colorscheme/gruvbox_material.json

This file was deleted.

12 changes: 0 additions & 12 deletions utils/colorscheme/material_ocean.json

This file was deleted.

12 changes: 0 additions & 12 deletions utils/colorscheme/template.json

This file was deleted.

36 changes: 36 additions & 0 deletions utils/palette.py
Original file line number Diff line number Diff line change
@@ -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()
1 change: 0 additions & 1 deletion utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
settings = {
"bar": "decorated",
"browser": "",
"colorscheme": "catppuccin",
"terminal": {
"main": "",
"floating": "",
Expand Down

0 comments on commit 9525ee9

Please sign in to comment.