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-12 21:35:05 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-12 21:35:05 +1000
commitc043a14ca24f70e81b69133350a1174d2e6572fc (patch)
treea938eae5dd8fb468f10d189ec141eeae228e0537 /src/caelestia/subcommands/wallpaper.py
parentscheme: fix not saving atomically (diff)
downloadcaelestia-cli-c043a14ca24f70e81b69133350a1174d2e6572fc.tar.gz
caelestia-cli-c043a14ca24f70e81b69133350a1174d2e6572fc.tar.bz2
caelestia-cli-c043a14ca24f70e81b69133350a1174d2e6572fc.zip
feat: impl wallpaper
Diffstat (limited to 'src/caelestia/subcommands/wallpaper.py')
-rw-r--r--src/caelestia/subcommands/wallpaper.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/caelestia/subcommands/wallpaper.py b/src/caelestia/subcommands/wallpaper.py
index 37f9a2b..1440484 100644
--- a/src/caelestia/subcommands/wallpaper.py
+++ b/src/caelestia/subcommands/wallpaper.py
@@ -1,5 +1,8 @@
+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
@@ -8,4 +11,11 @@ class Command:
self.args = args
def run(self) -> None:
- pass
+ 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())