cantino / mcfly

Fly through your shell history. Great Scott!
MIT License
6.77k stars 176 forks source link

Confusion about XDG Base Directory specification and what is $XDG_DATA_DIR? #269

Open HimDek opened 2 years ago

HimDek commented 2 years ago

Database Location in the README says $XDG_DATA_DIR/mcfly/history.db which defaults to ~/.local/share/mcfly/history.db would be used as the location for McFly's SQLite database if ~/.mcfly/ doesnot exist.

However, there is no such environment variable named $XDG_DATA_DIR specified neither in the XDG Base Directory Specification nor in the Arch Wiki on the same topic. The one that is the specification is $XDG_DATA_DIRS whose default value is /usr/local/share/:/usr/share/, which clearly is not the one applicable here.

In my system, following the XDG Base Directory Specification, I have $XDG_DATA_HOME set to $HOME/.local/share/, but $XDG_DATA_DIR is not set. However, after I moved the SQLite database file of McFly to ~/.local/share/mcfly/history.db, it seems to be working as expected.

NOTE: When I installed McFly, I probably did not have $XDG_DATA_HOME set but now I do.

So, which environment variable does McFly exactly use for determining its database location?

cantino commented 1 year ago

@Awernx do you have any insight into this?

o6uoq commented 2 months ago

@HimDek are you using macOS?

HimDek commented 2 months ago

@HimDek are you using macOS?

No. I am using Arch Linux.