feh icon indicating copy to clipboard operation
feh copied to clipboard

[curiosty] feh random background and the birthday problem

Open KoviRobi opened this issue 5 years ago • 1 comments

Hi,

This is probably a wontfix (and I understand and agree) but I thought I would just report this 'problem' because I think it's interesting/neat to people with a mathematical mindset: if you use feh to randomize your backgrounds, e.g. with feh --bg-max --randomize dir, and use that command to generate a new background each-time, then you will run into the birthday problem meaning that you will see duplicates soon but take a long time to see all the images.

I have hacked up a fix (wrapper script), see https://github.com/KoviRobi/feh-random-background (the feh-random-background script, the rest is just a wrapper for home-manager where I initially reported this phenomenon).

There could be a fix in feh too, something along the lines of using the ~/.fehbg file to store the state (e.g. a "--consume" flag to eat a file from ~/.fehbg when it's executed), but I think that would add unnecessary complexity for no good reason, especially when there is a perfectly workable fix.

Thanks, Robert

KoviRobi avatar Nov 25 '19 00:11 KoviRobi

Feel free to close, one of the reasons I made this is so that people who come search for "birthday problem" can find this, the other is so that someone could sanity check my logic/point out that this feature is already implemented (if it is)

KoviRobi avatar Nov 25 '19 00:11 KoviRobi