Add script to get random wallpaper on sway startup

This commit is contained in:
2021-10-14 10:49:19 +03:00
parent 3c4bf57a21
commit 07c873563a
2 changed files with 26 additions and 5 deletions

20
bin/get-random-wallpaper.py Executable file
View File

@@ -0,0 +1,20 @@
#! /usr/bin/env python3
import os
import glob
import random
homedir = os.environ['HOME']
wallpapers = glob.glob(f"{homedir}/Pictures/Wallpapers/*")
while True:
wallpaper = random.choice(wallpapers)
if wallpaper.__contains__("README.md"):
continue
else:
break
print(wallpaper)