jirutka / swaylock-effects

Swaylock, with fancy effects
MIT License
180 stars 19 forks source link

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

Open Jeinzi opened 1 year ago

Jeinzi commented 1 year ago

Currently, when the --image argument receives a directory, swaylock ignores it and falls back to a white background. With the changes in this commit, swaylock will pick a random file from the directory instead and use that.

Hope this can be merged :) Best regards, Julian

spikespaz commented 9 months ago

I am super glad to see this patch! I can finally get rid of my silly Bash wrapper.

spikespaz commented 9 months ago

One request: It looks like (I have not tried) this will only work for a flat directory of images. I would like to see it recurse into nested (categorized) directories.

Jeinzi commented 9 months ago

Yes, currently this feature does not recurse into subdirectories. file tree walk could be used to change that.