summaryrefslogtreecommitdiff
path: root/src/caelestia/subcommands/scheme.py
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-14 22:50:55 +1000
committerGitHub <noreply@github.com>2025-06-14 22:50:55 +1000
commitee7291b7f64a359d17eb1d050086ef5357d79055 (patch)
treef1c200d8c8ba81030cbb2113a2be122db6508c8f /src/caelestia/subcommands/scheme.py
parentMerge pull request #5 from dalpax/patch-1 (diff)
parentMerge branch 'main' into python-rework (diff)
downloadcaelestia-cli-ee7291b7f64a359d17eb1d050086ef5357d79055.tar.gz
caelestia-cli-ee7291b7f64a359d17eb1d050086ef5357d79055.tar.bz2
caelestia-cli-ee7291b7f64a359d17eb1d050086ef5357d79055.zip
Merge pull request #6 from caelestia-dots/python-rework
feat: rewrite in python
Diffstat (limited to 'src/caelestia/subcommands/scheme.py')
-rw-r--r--src/caelestia/subcommands/scheme.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/caelestia/subcommands/scheme.py b/src/caelestia/subcommands/scheme.py
new file mode 100644
index 0000000..c95df96
--- /dev/null
+++ b/src/caelestia/subcommands/scheme.py
@@ -0,0 +1,30 @@
+from argparse import Namespace
+
+from caelestia.utils.scheme import get_scheme
+from caelestia.utils.theme import apply_colours
+
+
+class Command:
+ args: Namespace
+
+ def __init__(self, args: Namespace) -> None:
+ self.args = args
+
+ def run(self) -> None:
+ scheme = get_scheme()
+
+ if self.args.random:
+ scheme.set_random()
+ apply_colours(scheme.colours, scheme.mode)
+ elif self.args.name or self.args.flavour or self.args.mode or self.args.variant:
+ if self.args.name:
+ scheme.name = self.args.name
+ if self.args.flavour:
+ scheme.flavour = self.args.flavour
+ if self.args.mode:
+ scheme.mode = self.args.mode
+ if self.args.variant:
+ scheme.variant = self.args.variant
+ apply_colours(scheme.colours, scheme.mode)
+ else:
+ print(scheme)