shlomif / fortune-mod

Implementation of the Unix fortune command for displaying a random quotation, for Linux and other systems.
http://www.shlomifish.org/open-source/projects/fortune-mod/
Other
428 stars 60 forks source link

$XDG_DATA_DIRS and $XDG_DATA_HOME support #74

Open ralismark opened 1 year ago

ralismark commented 1 year ago

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:

I'm happy to help implement this, just kinda want your thoughts on it first before I go ahead.

shlomif commented 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:

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 .

shlomif commented 1 year ago

@ralismark : ping.

ralismark commented 1 year ago

@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

teto commented 1 year ago

that would be awesome. Does the closed PR work already ? I could use it 'till it makes it to upstream