Add script to get random wallpaper on sway startup
This commit is contained in:
20
bin/get-random-wallpaper.py
Executable file
20
bin/get-random-wallpaper.py
Executable 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)
|
||||
|
||||
Reference in New Issue
Block a user