summaryrefslogtreecommitdiff
path: root/src/caelestia/subcommands/wallpaper.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/wallpaper.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/wallpaper.py')
-rw-r--r--src/caelestia/subcommands/wallpaper.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/caelestia/subcommands/wallpaper.py b/src/caelestia/subcommands/wallpaper.py
new file mode 100644
index 0000000..940dcb5
--- /dev/null
+++ b/src/caelestia/subcommands/wallpaper.py
@@ -0,0 +1,21 @@
+import json
+from argparse import Namespace
+
+from caelestia.utils.wallpaper import get_colours_for_wall, get_wallpaper, set_random, set_wallpaper
+
+
+class Command:
+ args: Namespace
+
+ def __init__(self, args: Namespace) -> None:
+ self.args = args
+
+ def run(self) -> None:
+ if self.args.print:
+ print(json.dumps(get_colours_for_wall(self.args.print, self.args.no_smart)))
+ elif self.args.file:
+ set_wallpaper(self.args.file, self.args.no_smart)
+ elif self.args.random:
+ set_random(self.args)
+ else:
+ print(get_wallpaper() or "No wallpaper set")