mariusknaust / spotlight

Windows 10 Spotlight background images for Gnome
https://aur.archlinux.org/packages/spotlight/
55 stars 18 forks source link

Added possibility to store the images in custom paths #8

Closed dpellegr closed 4 years ago

dpellegr commented 4 years ago

Hi and thank you for the very cool script.

I have been enjoying it for a while, but sometimes I regretted that a particularly beautiful image was discarded. I modified the script a bit and added a configuration file allowing to specify a custom working path and the possibility to store the images in it. The default behavior of discarding the images is unchanged.

Also in the PKGBUILD you can drop the perl dependency now!

mariusknaust commented 4 years ago

Hi and thank you for the contribution!

As this pull request contains multiple commits I will have a look at it soon and merge it and/or give you feedback.

dpellegr commented 4 years ago

Thank you for your interest. There are several commits as I have been testing and refining it over a few days, but please, do not go through all of them. Checking the global diff is more than enough:

https://github.com//mariusknaust/spotlight/compare/master...dpellegr:master

mariusknaust commented 4 years ago

I’ve made a few changes and merged it:

Please check if this still fulfills your needs and let me know if changes are needed.

Thanks again for the contribution!

dpellegr commented 4 years ago

Excellent! Your edits are nice and I approve all of them, but I disagree with you on a design concept. Here we go!

What do you think?

mariusknaust commented 4 years ago

Okay, I get what you are saying. And you are right, it’s a design decision, it was designed from the beginning with the systemd timer as a main use case (spotlight.sh shouldn’t have been documented in the first place). Hence, the desktop-file triggering the one shot service, to have consistent behavior with the timer when overwriting the service. As it is currently made specific for gnome [SUPER]spot[ENTER] should do the job, when disliking a background.

But I agree and thanks for pointing this out, it’s a great pity to exclude the Gentoo and Alpine folks. The local config file might be an option, but still seems to be a bit excessive for such a small service with so little configurations. A custom script in the local bin folder calling the global script with the needed parameters might do the job?

dpellegr commented 4 years ago

There is no such a thing as "too little configuration". Several files in /etc/ are just single liner or even a single word like /etc/hostname! There is no problem with that, a conf file is just the way of setting persistent options, no matter if one or a thousand.

And no: the conf file should not go together with the executable. It might be that you see this project as a tiny little service to be petted in the home directory, but I assure you that to the rest of the world it is just another one of the zillions of services running in the background and therefore it should follow the conventions:

Then we let our great package managers do their work keeping track of all the files. This is what I learned in my decade-long experience with Arch as my main OS, in short: Keep It Simple! :)

dpellegr commented 4 years ago

I've just got another idea! If I dislike the background and I change it immediately, I probably do not want to store it. Therefore an option to save the past background only if they have been displayed for longer than a certain amount of time would be nice. It should be easy by looking at the file creation time.

I'll wait a bit to proceed to see if we can sort out this systemd vs conf file thing...