[+] Recommended color alignments
This commit is contained in:
parent
59f5fd5651
commit
d11796ef02
9 changed files with 132 additions and 48 deletions
23
hyfetch/models.py
Normal file
23
hyfetch/models.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .color_util import AnsiMode
|
||||
from .constants import CONFIG_PATH
|
||||
from .neofetch_util import ColorAlignment
|
||||
from .serializer import json_stringify
|
||||
|
||||
|
||||
@dataclass
|
||||
class Config:
|
||||
preset: str
|
||||
mode: AnsiMode
|
||||
light_dark: Literal['light', 'dark'] = 'dark'
|
||||
lightness: float | None = None
|
||||
color_align: ColorAlignment = ColorAlignment('horizontal')
|
||||
|
||||
def save(self):
|
||||
CONFIG_PATH.parent.mkdir(exist_ok=True, parents=True)
|
||||
CONFIG_PATH.write_text(json_stringify(self), 'utf-8')
|
||||
Loading…
Add table
Add a link
Reference in a new issue