mitype icon indicating copy to clipboard operation
mitype copied to clipboard

Follow the XDG Base Directory Specification

Open hakan-demirli opened this issue 2 months ago • 1 comments

There is XDG Base Directory Specification which dictates which files should go where.

According to that user data should go to $XDG_DATA_HOME on linux.

https://github.com/Mithil467/mitype/blob/cdb2da1f40611f6e44ccba50eccd135b3a503bc3/mitype/history.py#L17

Without adding extra pip dependency:

from sys import platform
if platform == "linux" or platform == "linux2":
    XDG_DATA_HOME = os.environ.get('XDG_DATA_HOME', os.path.expanduser("~/.local/share"))
    user_data_file = XDG_DATA_HOME + "/.mitype_history.csv"
    return os.path.expanduser(user_data_file)
else:
    # as usual for windows

hakan-demirli avatar Apr 30 '24 17:04 hakan-demirli