XDG basedir specification

Hi all,
Freedesktop has a few specifications and standards for interoperability of stuff ( https://www.freedesktop.org/wiki/Specifications/ ) , and I wanted to ask in particular about the base dir specification :
"How desktops should locate files, such as config files or application data files." ( https://specifications.freedesktop.org/basedir-spec/latest/ but in particular https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html )
It basically set rules as to where users should lookup stuff.
Currently on unix we put everything userspace in .config/inkscape (|$XDG_CONFIG_HOME|), even when some of it would more adequately be described as data (assets) and, according to the spec, be put in a share/ directory such as .local/share (|$XDG_DATA_HOME|) which is already the case for systemwide assets (assets are in /usr/(local/)share/, not in /etc/xdg/).
So, the first question is the following : Do we want
(1) to follow the XDG dir spec and keep themes/, ui/, keys/, icons/ and preferences (which can be described as user-specific things to customize the program behavior or appearance) in |$XDG_CONFIG_HOME| but put assets (symbols, templates, palettes, extensions) in |$XDG_DATA_HOME| ?
or
(2) keep everything in .config because it might be less confusing or simpler to explain
NB: On windows, it's the same place (%appdata%) but we can think about moving stuff to %localappdata%, wherever it is.
Also (maybe a more minor point, but what prompted me to lookup the spec in the first place) the "logical" place to put autosaves (not to be mixed up with crash saves) would be (in my opinion) |$XDG_CACHE_HOME| ("Where user-specific non-essential data should be written") but on windows that defaults to the absurd ~\Local Settings\Temporary Internet Files\ so I was thinking of using |$XDG_DATA_HOME |but if everything stays in .config (option 2) I'll put that there.

Hi Mc,
I've been involved with the XDG stuff before, so I'll weigh in.
Only preferences should be in .config/inkscape/, everything else should be in .local/share/ (although I personally hate the naming convention) this is especially true for us since our /usr/share/inkscape contains many of the things that we look in .config/inkscape for.
The 1.0 release would be a good place to change this.
We could also use .cache/inkscape for some future things (like downloading extension packages from inkscape.org etc)
Best Regards, Martin Owens
On Wed, 2018-08-22 at 16:11 +0200, Marc Jeanmougin wrote:
Hi all,
Freedesktop has a few specifications and standards for interoperability of stuff ( https://www.freedesktop.org/wiki/Specifications/ ) , and I wanted to ask in particular about the base dir specification :
"How desktops should locate files, such as config files or application data files." ( https://specifications.freedesktop.org/basedir-spec/latest/ but in particular https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.ht ml )
It basically set rules as to where users should lookup stuff.
Currently on unix we put everything userspace in .config/inkscape (|$XDG_CONFIG_HOME|), even when some of it would more adequately be described as data (assets) and, according to the spec, be put in a share/ directory such as .local/share (|$XDG_DATA_HOME|) which is already the case for systemwide assets (assets are in /usr/(local/)share/, not in /etc/xdg/).
So, the first question is the following : Do we want
(1) to follow the XDG dir spec and keep themes/, ui/, keys/, icons/ and preferences (which can be described as user-specific things to customize the program behavior or appearance) in |$XDG_CONFIG_HOME| but put assets (symbols, templates, palettes, extensions) in |$XDG_DATA_HOME| ?
or
(2) keep everything in .config because it might be less confusing or simpler to explain
NB: On windows, it's the same place (%appdata%) but we can think about moving stuff to %localappdata%, wherever it is.
Also (maybe a more minor point, but what prompted me to lookup the spec in the first place) the "logical" place to put autosaves (not to be mixed up with crash saves) would be (in my opinion) |$XDG_CACHE_HOME| ("Where user-specific non-essential data should be written") but on windows that defaults to the absurd ~\Local Settings\Temporary Internet Files\ so I was thinking of using |$XDG_DATA_HOME |but if everything stays in .config (option 2) I'll put that there.

On Wed, Aug 22, 2018 at 04:11:42PM +0200, Marc Jeanmougin wrote:
Hi all,
Freedesktop has a few specifications and standards for interoperability of stuff ( https://www.freedesktop.org/wiki/Specifications/ ) , and I wanted to ask in particular about the base dir specification :
"How desktops should locate files, such as config files or application data files." ( https://specifications.freedesktop.org/basedir-spec/latest/ but in particular https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html )
It basically set rules as to where users should lookup stuff.
Currently on unix we put everything userspace in .config/inkscape (|$XDG_CONFIG_HOME|), even when some of it would more adequately be described as data (assets) and, according to the spec, be put in a share/ directory such as .local/share (|$XDG_DATA_HOME|) which is already the case for systemwide assets (assets are in /usr/(local/)share/, not in /etc/xdg/).
So, the first question is the following : Do we want
(1) to follow the XDG dir spec and keep themes/, ui/, keys/, icons/ and preferences (which can be described as user-specific things to customize the program behavior or appearance) in |$XDG_CONFIG_HOME| but put assets (symbols, templates, palettes, extensions) in |$XDG_DATA_HOME| ?
or
(2) keep everything in .config because it might be less confusing or simpler to explain
It's a good point we keep more in .config than is appropriate per the spec, and I'd like to see thought go into how we can move things around better. I suspect a lot of what's in .config should really go into .local/share. However, there's clearly a lot of interpretation from project to project about what goes where, so I don't think this is a super urgent problem; indeed it may be worth keeping the change until after 1.0 is out in order to avoid unnecessary bugs or weirdness (such as the one you point out below) and potentially invalidating existing documentation.
NB: On windows, it's the same place (%appdata%) but we can think about moving stuff to %localappdata%, wherever it is.
Also (maybe a more minor point, but what prompted me to lookup the spec in the first place) the "logical" place to put autosaves (not to be mixed up with crash saves) would be (in my opinion) |$XDG_CACHE_HOME| ("Where user-specific non-essential data should be written") but on windows that defaults to the absurd ~\Local Settings\Temporary Internet Files\ so I was thinking of using |$XDG_DATA_HOME |but if everything stays in .config (option 2) I'll put that there.
I would also guess .cache would be where autosaves are supposed to go; does the XDG spec not give more specific guidance on that type of file? Where does gimp or other apps like us put their autosaves?
Thanks for working on this, improving how autosaves are handled sounds like something users will expect for 1.0, so it's really good you're giving it attention.
Bryce

Am 22.08.2018 um 21:18 schrieb Bryce Harrington:
On Wed, Aug 22, 2018 at 04:11:42PM +0200, Marc Jeanmougin wrote:
Hi all,
...
I would also guess .cache would be where autosaves are supposed to go; does the XDG spec not give more specific guidance on that type of file? Where does gimp or other apps like us put their autosaves?
- Sorry to chime in, as I've got no knowledge of the standards. I'd just like to ask to please, keep the autosave location configurable. I, for example, don't have lots of disk space left on my system partition, so I like to put them into /tmp (Inkscape crashes frequently, but my computer almost never dies completely). That way, they are auto-deleted when I don't need them anymore...
Another thing I'd like to suggest would be to enable them by default. Most users who lost work in a crash who contacted us on the forums were very unhappy that they didn't know about that option, and that some were really angry that it wasn't enabled already.
Thanks!
Maren
Thanks for working on this, improving how autosaves are handled sounds like something users will expect for 1.0, so it's really good you're giving it attention.
Bryce
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Hi Maren;
- Sorry to chime in, as I've got no knowledge of the standards. I'd just
like to ask to please, keep the autosave location configurable.
Of course, that was just for the default path.
Another thing I'd like to suggest would be to enable them by default.
Done yesterday ;)

Am 23.08.2018 um 02:23 schrieb Marc Jeanmougin:
Hi Maren;
- Sorry to chime in, as I've got no knowledge of the standards. I'd just
like to ask to please, keep the autosave location configurable.
Of course, that was just for the default path.
Another thing I'd like to suggest would be to enable them by default.
Done yesterday ;)
Thank you, Marc!
Added to release notes :D
Maren

Is posible ask the user to restore last file when inkscape reopen?
-----Original Message----- From: Maren Hachmann <maren@...3165...> To: inkscape-devel@lists.sourceforge.net Subject: Re: [Inkscape-devel] XDG basedir specification Date: Wed, 22 Aug 2018 23:49:51 +0200
Am 22.08.2018 um 21:18 schrieb Bryce Harrington:
On Wed, Aug 22, 2018 at 04:11:42PM +0200, Marc Jeanmougin wrote:
Hi all,
...
I would also guess .cache would be where autosaves are supposed to go; does the XDG spec not give more specific guidance on that type of file? Where does gimp or other apps like us put their autosaves?
- Sorry to chime in, as I've got no knowledge of the standards. I'd just like to ask to please, keep the autosave location configurable. I, for example, don't have lots of disk space left on my system partition, so I like to put them into /tmp (Inkscape crashes frequently, but my computer almost never dies completely). That way, they are auto-deleted when I don't need them anymore...
Another thing I'd like to suggest would be to enable them by default. Most users who lost work in a crash who contacted us on the forums were very unhappy that they didn't know about that option, and that some were really angry that it wasn't enabled already.
Thanks!
Maren
Thanks for working on this, improving how autosaves are handled sounds like something users will expect for 1.0, so it's really good you're giving it attention.
Bryce
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
--------------------------------------------------------------------- --------- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Inkscape sometimes freeze-locks the system during opperations, so a restart is sometimes necessary. This destroys the temp caches on reboot, so it's not a very safe place to save imho.
If Inkscape crashes, or is "killed" for any reason, Inkscape should indeed offer to restore the previous session when it's started up again.
When an svg file is saved, Inkscape should erase the corresponding temp files associated with that file, and thus do its own garbage-cleanup. If Inkscape is closed regularly without saving, these files should also be erased, as nothing has gone wrong, and that's what auto-save is for.
My 2p.
On Thu, Aug 23, 2018 at 8:52 AM Jabier Arraiza <jabier.arraiza@...2893...> wrote:
Is posible ask the user to restore last file when inkscape reopen?
-----Original Message----- From: Maren Hachmann <maren@...3165...> To: inkscape-devel@lists.sourceforge.net Subject: Re: [Inkscape-devel] XDG basedir specification Date: Wed, 22 Aug 2018 23:49:51 +0200
Am 22.08.2018 um 21:18 schrieb Bryce Harrington:
On Wed, Aug 22, 2018 at 04:11:42PM +0200, Marc Jeanmougin wrote:
Hi all,
...
I would also guess .cache would be where autosaves are supposed to go; does the XDG spec not give more specific guidance on that type of file? Where does gimp or other apps like us put their autosaves?
- Sorry to chime in, as I've got no knowledge of the standards. I'd
just like to ask to please, keep the autosave location configurable. I, for example, don't have lots of disk space left on my system partition, so I like to put them into /tmp (Inkscape crashes frequently, but my computer almost never dies completely). That way, they are auto-deleted when I don't need them anymore...
Another thing I'd like to suggest would be to enable them by default. Most users who lost work in a crash who contacted us on the forums were very unhappy that they didn't know about that option, and that some were really angry that it wasn't enabled already.
Thanks!
Maren
Thanks for working on this, improving how autosaves are handled sounds like something users will expect for 1.0, so it's really good you're giving it attention.
Bryce
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel

On Thu, Aug 23, 2018 at 8:52 AM Jabier Arraiza <jabier.arraiza@...2893... mailto:jabier.arraiza@...2893...> wrote:
Is posible ask the user to restore last file when inkscape reopen?
On 08/23/2018 11:32 AM, C R wrote:
If Inkscape crashes, or is "killed" for any reason, Inkscape should
indeed offer to restore the previous session when it's started up again.
These looks like more applicable to *crash* saves, not autosaves (the save process, and the ideal places for crash saves are different ; We can also talk about it, but preferably in another thread or in a bugreport/wishlist ?)
On 08/23/2018 11:32 AM, C R wrote:
Inkscape sometimes freeze-locks the system during opperations, so a restart is sometimes necessary. This destroys the temp caches on reboot, so it's not a very safe place to save imho.
tmpfs is the reason I changed the default path to userland ;)

Hello,
I'm answering inline.
On Thu, Aug 23, 2018 at 11:33 AM C R <cajhne@...400...> wrote:
Inkscape sometimes freeze-locks the system during opperations, so a restart is sometimes necessary. This destroys the temp caches on reboot, so it's not a very safe place to save imho.
I agree.
If Inkscape crashes, or is "killed" for any reason, Inkscape should indeed offer to restore the previous session when it's started up again.
I second this too. Would be a very nice thing to have.
When an svg file is saved, Inkscape should erase the corresponding temp files associated with that file, and thus do its own garbage-cleanup. If Inkscape is closed regularly without saving, these files should also be erased, as nothing has gone wrong, and that's what auto-save is for.
Now, here are some things unclear to me. Inkscape doesn't have "temp" files, as far as I know. The only case I can characterize s file sd temp is when you make a bitmap copy of selected object(s). Inkscape then embeds them to the working document, but PNG is being held on hard disk for some reason. I think this copies are good candidates for /tmp directory (or some other dir, which cleaning is handled by system).
Auto-save as is right now is not such a bad implementation. The only thing I am missing is one GUI button to choose auto-save location graphically. Similarly to what we currently have in Export bitmap dialog for for choosing export location.
Did I misinterpret something CR?
RGDS, Vlada
My 2p.
participants (7)
-
unknown@example.com
-
Bryce Harrington
-
C R
-
Jabier Arraiza
-
Marc Jeanmougin
-
Maren Hachmann
-
Vladimir Savic