Open ralismark opened 1 year ago
On Fri, 27 Jan 2023 16:52:35 -0800 Temmie Yao @.***> wrote:
Would you consider adding support for looking in $XDG_DATA_DIRS and the paths listed in $XDG_DATA_HOME for fortunes? This would allow fortunes to be put in places other than the directories that are built into the binary, and allow them to use used without specifying the path to them.
Specific usecases include:
allowing users to add their own personal fortunes and use them without needing to specify the path -- e.g. creating
~/.local/share/fortunes/myfortunes
and runningfortune myfortunes
adding fortunes when can't write to the default fortune dirs e.g. on multi-user systems, on systems with read-only filesystems
more info about those vars: https://wiki.archlinux.org/title/XDG_Base_Directory#Specification
specification: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
I'm happy to help implement this, just kinda want your thoughts on it first before I go ahead.
sounds great! Please add a cmake option and automated tests [ https://github.com/shlomif/what-you-should-know-about-automated-testing ].
--
Shlomi Fish https://www.shlomifish.org/ Star Trek: “We, the Living Dead” - https://shlom.in/st-wtld
Dumbledore Two: No, me is his successor: Dumbledore Two. [He takes a 2-like number from behind his back, and eats it.] Dumbledore Two: Num num num… delicious! — https://is.gd/zsmond
Please reply to list if it's a mailing list post - https://shlom.in/reply .
@ralismark : ping.
@shlomif still working on this! been pretty busy with other stuff the past few weeks, plus getting an understanding of the source code. I'm probably going to completely rework the file lookup logic since it's pretty messy and has a few bugs
that would be awesome. Does the closed PR work already ? I could use it 'till it makes it to upstream
Would you consider adding support for looking in $XDG_DATA_DIRS and the paths listed in $XDG_DATA_HOME for fortunes? This would allow fortunes to be put in places other than the directories that are built into the binary, and allow them to use used without specifying the path to them.
Specific usecases include:
allowing users to add their own personal fortunes and use them without needing to specify the path -- e.g. creating
~/.local/share/fortunes/myfortunes
and runningfortune myfortunes
adding fortunes when can't write to the default fortune dirs e.g. on multi-user systems, on systems with read-only filesystems
more info about those vars: https://wiki.archlinux.org/title/XDG_Base_Directory#Specification
specification: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
I'm happy to help implement this, just kinda want your thoughts on it first before I go ahead.