swaywm / swaylock

Screen locker for Wayland
MIT License
853 stars 202 forks source link

Choose random file if pointed to a directory for image #287

Closed Jeinzi closed 1 year ago

Jeinzi commented 1 year ago

Hey!

With this commit, if --image gets pointed to a directory, swaylock chooses a random file from it. I'd be glad if this could be merged :)

Best regards, Julian

emersion commented 1 year ago

Sorry, but I'd rather not add this feature. This is better done by a script which does the randomization and then invokes swaylock.

Jeinzi commented 1 year ago

While I agree that a script is a good way to do this, I want to emphasize that swaylock currently just ignores the parameter and does something else in case a directory is supplied. This feature does something sensible in this situation, in an intuitive manner I would say, and I imagine choosing one image at random from a collection is a common use case. Anyway, I'll try my luck over at swaylock-effects :)

emersion commented 1 year ago

The expected behavior is to error out. If swaylock doesn't do that, please open a bug report.

Jeinzi commented 1 year ago

Well, it prints an error message and falls back to a white background.