Skip to content

Commit

Permalink
dark mode setting
Browse files Browse the repository at this point in the history
  • Loading branch information
NextFire committed Jan 29, 2024
1 parent b919cdd commit 78d242e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sachi/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from textual.app import App

from sachi.config import BaseConfig, read_config
from sachi.screens.episodes import EpisodesScreen
from sachi.screens.rename import RenameScreen

Expand All @@ -23,6 +24,10 @@ def __init__(self, file_or_dir: Path = Path.cwd(), **kwargs):
self.file_or_dir = file_or_dir

def on_mount(self):
config = read_config()
config_model = BaseConfig(**config.unwrap())
self.dark = config_model.general.dark

rename_screen = RenameScreen(self.file_or_dir)
self.install_screen(rename_screen, name="rename")
self.push_screen(rename_screen)
5 changes: 5 additions & 0 deletions sachi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ def write_config(doc: tomlkit.TOMLDocument):


class BaseConfig(BaseModel):
general: "GeneralConfig"
series: "SeriesConfig"
movie: "MovieConfig"


class GeneralConfig(BaseModel):
dark: bool = True


class SeriesConfig(BaseModel):
template: str

Expand Down
3 changes: 3 additions & 0 deletions sachi/resources/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[general]
dark = true

[series]
template = "TV Shows/{{n}}/Season {{'%02d' % s}}/{{n}} - {{s00e00}} - {{t}}"

Expand Down

0 comments on commit 78d242e

Please sign in to comment.