Menu

gnuplot-main Merge Request #12: Support XDG base directory for gnuplotrc (merged)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Henri Menke wants to merge 1 commit from /u/hmenke/gnuplot/ to master, 2020-02-02

Many applications support the XDG base directory specification [1] on unix-like operating systems, such as Linux, BSD, and macOS. Currently, gnuplot only supports reading the user configuration file from ~/.gnuplot which does not conform to this specification.

The pull request adds support for the XDG base directories in such a way that it can be easily extended to other parts of the program, such as ~/.gnuplot_history, which would be my next step, but first I'd like to hear feedback from the maintainers whether that is something you want to support or not.

[1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Commit Date  
[ea849c] (xdg) by Henri Menke Henri Menke

Support XDG base directory for gnuplotrc

2020-01-09 09:38:16 Tree

Discussion

  • Henri Menke

    Henri Menke - 2020-01-09

    As you can see from the diff, support for Windows could in principle be added, but I think the XDG base directories are a bit more meaningless in that case. It might still be worthwhile though.

     
  • Ethan Merritt

    Ethan Merritt - 2020-01-10

    Does anyone actually use this spec? I am a long-time linux user and I have never seen any consistency, even from version-to-version of the same distro. E.g. the desktop I am sitting at is running the lastest and greatest Mageia 7.1; it does put files files in ~/.config and ~/.local/share but there are no corresponding environment variable $XDG_DATA_HOME or $XDG_CONFIG_HOME.

    It is my impression that this XDG "standard" is just a bright idea that never gained much traction. I could be wrong and perhaps it is adhered to by some other distributions, but even if that is so I am pretty sure that putting a file in the users home directory is more universally applicable.

     

    Last edit: Ethan Merritt 2020-01-11
  • Ethan Merritt

    Ethan Merritt - 2020-01-11

    To clarify: I'm not necessarily against adding this, I am just a bit dubious how many of our users it will actually help. I don't recall ever seeing a question or help request about personal configuration of gnuplot. Maybe it's so well documented that nobody has any questions or maybe nobody cares about personal configuration in the first place. The configuration questions I do remember seeing involve problems finding the right LaTeX or PostScript support files. Those are not covered by XDG, right?

     
  • Henri Menke

    Henri Menke - 2020-01-26

    Sorry for the late reply. SourceForge decided to not send me notifications anymore, even though I have turned them on in the settings. :-/

    There is actually a large number of applications that follow the XDG standard. The Arch Linux wiki has an exhaustive list (https://wiki.archlinux.org/index.php/XDG_Base_Directory).

    I'm not proposing to remove the file in the home directory. This patch is merely an addition to the already present configuration options.

    The environment variable $XDG_DATA_HOME and $XDG_CONFIG_HOME are only set if you want to override the default paths. As you can see from my patch it will fall back to defaults otherwise.

    I guess the reason why people don't ask about configuration is that most people don't even know that gnuplot has a startup file. On top of that gnuplot comes with strong defaults, so there is little reason to customize it at all. However, if you are like me and you want to add paths to custom color palettes and want to change default terminal options, then it comes in handy.

     
  • Ethan Merritt

    Ethan Merritt - 2020-02-02
    • Status: open --> merged
     

Log in to post a comment.