mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-05 23:09:27 -05:00
22 lines
629 B
Python
22 lines
629 B
Python
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")
|