From 8cbadb61604667b407b53ee1258433994fa4765a Mon Sep 17 00:00:00 2001 From: coasteen Date: Thu, 9 Jul 2026 10:42:28 +0330 Subject: init --- local/bin/setwall.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 local/bin/setwall.py (limited to 'local/bin/setwall.py') diff --git a/local/bin/setwall.py b/local/bin/setwall.py new file mode 100755 index 0000000..0126288 --- /dev/null +++ b/local/bin/setwall.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +import os +import secrets +import subprocess + +BASE_DIR = "/home/coast/.local/src/wall" + +wallpapers = [] +for root, dirs, files in os.walk(BASE_DIR): + for file in files: + if file.lower().endswith(('.png', '.jpg', '.jpeg', '.bmp', '.gif')): + wallpapers.append(os.path.join(root, file)) + +if not wallpapers: + print("No wallpapers found!") + exit(1) + +chosen_wallpaper = secrets.choice(wallpapers) +print(chosen_wallpaper) +subprocess.run(["swaybg", "-i", chosen_wallpaper, "-m", "fill"]) -- cgit v1.2.3