martanne / abduco

abduco provides session management i.e. it allows programs to be run independently from its controlling terminal. That is programs can be detached - run in the background - and then later reattached. Together with dvtm it provides a simpler and cleaner alternative to tmux or screen.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Follow Freedesktop's XDG base directory specification

ItsDrike opened this issue · comments

For some reason, abduco is one of the applications that still clutters the home directory with session info in ~/.abduco folder. While there is a way to avoid this, by setting $ABDUCO_SOCKET_DIR (mentioned in #7 and pretty well documented on the top of the man page), this still isn't ideal.

Freedesktop's XDG Base Directory spec has been there for a long time, and there is no reason to disregard a well-established and known standard. The folder containing the session info should automatically be placed in one of the standard paths. I'm not entirely familiar with the kind of data stored in this location, however this is the simple description of the standard:

  • $XDG_DATA_HOME: Data that persists between application restarts and is needed for the app to work properly (things like databases)
  • $XDG_CONFIG_HOME: Configuration data that remains mostly static and is usually only read by the application, not directly modified by it.
  • $XDG_CACHE_HOME: Non-essential data that is expected to be removed by the user regularly.
  • $XDG_RUNTIME_DIR: Runtime file objects, such as sockets or named pipes. This directory will be removed once the user logs off.
  • $XDG_STATE_HOME: Data that should persist between application restarts, but it wouldn't be a huge issue if it got removed.

From my simple observations, you should follow the $XDG_RUNTIME_DIR, if this directory isn't available, the standard would be to fall back to /run/user/$UID

This should be made the default behavior since there is no reason to store these files in home whatsoever, it only clutters the directory and even though there is a way to go around it, there is no reason not to avoid following this standard by default. standard by default.