TerminalGPT icon indicating copy to clipboard operation
TerminalGPT copied to clipboard

Follow XDG specification on Linux

Open lucaspar opened this issue 2 years ago • 1 comments

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

https://github.com/adamyodinsky/TerminalGPT/blob/3c0eb5af948bcfb957d1034856807971b24c80fc/terminalgpt/config.py#L30-L31

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.

lucaspar avatar Jul 15 '23 21:07 lucaspar

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

adamyodinsky avatar Aug 14 '23 09:08 adamyodinsky