Re: [fltk/fltk] Matt: accumulated Fl_Preferences issues, are there more? (Issue #303)
Albrecht Schlosser
Jan 19, 2022
Reading existing preferences is simple, we just need to take what we get. If there are both files (i.e. the same preferences file in both directories) I don't know. There must be a preference (pun not intended) but I'd suggest not to try to merge different files.
Citing the docs mentioned above: "There is a single base directory relative to which user-specific configuration files should be written. This directory is defined by the environment variable $XDG_CONFIG_HOME."
IIRC there's also a fallback but I don't know.
For writing preferences a quick thought is (with this order):
if a particular preferences file already exists, use it
if an FLTK preferences directory exists (but not 1.), create a new file in this directory
if none exists, use $XDG_CONFIG_HOME (or whatever the correct environment variable is) and create FLTK config files below that dir
if $XDG_CONFIG_HOME is not defined, use the "classic" scheme
... or something like that.
We should never (try to) move FLTK config files from one folder to another. This is something the user must do if they want to move their preferences files from $HOME/.fltk to $XDG_CONFIG_HOME/fltk.
My take on this is: the FLTK config directory is either $HOME/.fltk or $XDG_CONFIG_HOME/fltk, the preferences files below that config dir should be in the same directory structure as before such that users can do:
$ mv $HOME/.fltk $XDG_CONFIG_HOME/fltk
to move all their FLTK preferences files from their home directory to the new config directory. This could be documented and FLTK could work as before.
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/issues/303/1017004124@github.com>
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.