xyproto / wallutils

:city_sunset: Utilities for handling monitors, resolutions, wallpapers and timed wallpapers
BSD 3-Clause "New" or "Revised" License
463 stars 17 forks source link

wallpaper calendar #1

Closed letarg0 closed 5 years ago

letarg0 commented 5 years ago

why not using crontab format https://github.com/xyproto/monitor/blob/561f15bedc3e3586e4b193b9e96aed5ce2ad233c/cmd/xml2stw/SPEC.md

In my opinion random images from 8:00-10:00 will be great Why config must be a file? i cant integrate it with calendar or data base, communicator?

xyproto commented 5 years ago

Hi, thanks for asking.

I considered the crontab format in advance, but it's not a great fit for the following reasons:

It is fully possible to use cron and the crontab format, together with the setwallpaper utility, for setting wallpapers at certain times or dates.

Configuration does not have to be stored in a file, but there is a long tradition and convention for storing configuration as files on Linux or UNIX-like systems.

I think the ability to switch out wallpapers at certain dates is a good idea. I have also been thinking a lot about having support for scripts instead of times, like this:

@/usr/bin/myscript.py: /usr/share/backgrounds/mywallpaper.jpg

This would make it possible to create custom scripts that return exit code 0 or 1, for when the event should kick in. It would also make it easy to integrate with anything that Python supports.

The downside would be that timed wallpaper packs would have to include executable scripts, and there is a safety aspect to this too. If the format is kept simple and does not support scripting, it should be quite safe to download random timed wallpaper packs online and run them as a user. At least the effort needed to exploit it in any way should be significantly higher.

Adding script support would allow easier integration, but possibly make timed wallpapers less secure.

One way to get the best of both worlds could be if only scripts that are not writable by the user could be executed by the timed wallpaper. Then again, it would potentially require a more involved installation procedure.

I guess an --allowscripts flag could be another way to deal with this.

Which feature would you wish for that would solve 90% of what you're asking for, while still keeping the Simple Timed Wallpaper format secure and, if possible, not require users to install them as root?

xyproto commented 5 years ago

In short: I believe you can achieve what you are asking for with a combination of cron, python and the setwallpaper utility that comes with this project.

letarg0 commented 5 years ago

please add random list not only one image in time interval

xyproto commented 5 years ago

You can set a random image by using the setrandom command that is also included with this project.

Combine that with cron, and it sounds to me like you have a solution to what you are looking for?