Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow XDG specification on Linux #51

Open
lucaspar opened this issue Jul 15, 2023 · 1 comment
Open

Follow XDG specification on Linux #51

lucaspar opened this issue Jul 15, 2023 · 1 comment

Comments

@lucaspar
Copy link

lucaspar commented Jul 15, 2023

To unclutter the home directory and help with backups, TerminalGPT should follow the XDG Specification on Linux machines.

BASE_PATH = f"~/.{APP_NAME}".replace("~", path.expanduser("~"))
CONVERSATIONS_PATH = f"{BASE_PATH}/conversations"

Configuration files should probably be in ${XDG_CONFIG_HOME}/terminalgpt/ when XDG_CONFIG_HOME is set.

Conversations should probably be in ${XDG_STATE_HOME}/terminalgpt/conversations/ when XDG_STATE_HOME is set:

The $XDG_STATE_HOME contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in $XDG_DATA_HOME. It may contain:

actions history (logs, history, recently used files, …)

current state of the application that can be reused on a restart (view, layout, open files, undo history, …)

I believe it is an easy change. If there is already a ~/.terminalgpt/, Terminal GPT can fallback to that in order to preserve existing user data.

@adamyodinsky
Copy link
Owner

@lucaspar Sounds good, would you like to contribute and open a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants