#2 Added systemd

master
Keith Irwin 2021-07-07 00:42:17 -06:00
parent ef3316a81c
commit d328e775a7
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
2 changed files with 35 additions and 2 deletions

View File

@ -47,9 +47,36 @@ reddit-wallpaper /backdrop/screen0/monitorHDMI-A-0/workspace0/last-image awww
*Coming soon*
## Automation
## Systemd
**Coming soon**
Copy the service file to your systemd configuration directory:
```sh
sudo cp /usr/local/src/reddit-wallpaper/reddit-wallpaper@.service /etc/systemd/system
sudo systemctl daemon-reload
```
Now you can run the service with `sudo systemctl start reddit-wallpaper@awww`. You can also configure systemd timers. For example, you can use this timer to set the wallpaper to the top post on r/spaceporn every night at 8pm:
```
[Unit]
Description=Change desktop wallpaper to r/spaceporn's top evenings at 8pm
[Timer]
OnCalendar=20:00
Unit=reddit-wallpaper@spaceporn.service
[Install]
WantedBy=multi-user.target
```
Save that to `/etc/systemd/system/space-wallpaper.timer` and then run:
```
sudo systemctl daemon-reload
sudo systemctl start space-wallpaper.timer
sudo systemctl enable space-wallpaper.timer
```
## License

View File

@ -0,0 +1,6 @@
[Unit]
Description=Set desktop wallpaper to %i reddit images
[Service]
Type=oneshot
ExecStart=/usr/local/bin/reddit-wallpaper /backdrop/screen0/monitorHDMI-A-0/workspace0/last-image %i