mps-youtube / yewtube

yewtube, forked from mps-youtube , is a Terminal based YouTube player and downloader. No Youtube API key required.
GNU General Public License v3.0
8.07k stars 645 forks source link

Don't store state data in $XDG_CONFIG_HOME #905

Open rpdelaney opened 5 years ago

rpdelaney commented 5 years ago

Issue / Suggestion

I find that state data is stored in $XDG_CONFIG_HOME/mpsyt/, including (but not limited to) in these files:

Users who do not expect state data to be stored here may accidentally back it up and synchronize it across systems improperly. Configuration data are fine, but prefer storing state data somewhere in $XDG_DATA_HOME to conform to the freedesktop.org / XDG standard.

Reference: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

$XDG_CONFIG_HOME defines the base directory relative to which user specific                                                                                                                                          
configuration files should be stored. If $XDG_CONFIG_HOME is either not set or                                                                                                                                       
empty, a default equal to $HOME/.config should be used.
$XDG_DATA_HOME defines the base directory relative to which user specific data                                                                                                                                       
files should be stored. If $XDG_DATA_HOME is either not set or empty, a default                                                                                                                                      
equal to $HOME/.local/share should be used.

Your Environment

$ mpsyt --version
mpsyt version      : 0.2.8
   notes           : released 17 February 2018
pafy version       : 0.5.4 (youtube-dl backend)
youtube-dl version : 2018.09.08
Python version     : 3.7.0 (default, Oct  2 2018, 09:20:07) 
[Clang 10.0.0 (clang-1000.11.45.2)]
Processor          : i386
Machine type       : x86_64
Architecture       : 64bit, 
Platform           : Darwin-17.7.0-x86_64-i386-64bit
sys.stdout.enc     : UTF-8
default enc        : utf-8
Config dir         : /Users/ryan.delaney/.config/mps-youtube
env:TERM           : screen-256color
env:SHELL          : /bin/bash
env:LANG           : en_US.UTF-8
$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 10.13.6 (17G3025)
      Kernel Version: Darwin 17.7.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: M-6496
      User Name: Ryan Delaney (ryan.delaney)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 2 days 4:29
roadkell commented 1 year ago

The spec has been updated since, now there is $XDG_STATE_HOME for that:

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, …)