21 lines
440 B
Python
Executable file
21 lines
440 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
from datetime import datetime
|
|
from pathlib import Path
|
|
import subprocess
|
|
|
|
HOME = Path.home()
|
|
image_dir = HOME / 'images/wallpapers/BitDay'
|
|
dest = HOME / 'images/wallpaper.png'
|
|
|
|
hour = datetime.now().hour
|
|
image_number = int(hour / 2)
|
|
|
|
target = image_dir / '{}.png'.format(image_number)
|
|
|
|
# ln -s -f
|
|
dest.unlink(missing_ok = True)
|
|
dest.symlink_to(target)
|
|
|
|
# nitrogen --restore
|
|
subprocess.run(['nitrogen', '--restore'])
|