XDG basedir specification

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

XDG basedir specification

Marc Jeanmougin
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.


--

Mc



------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|

Re: XDG basedir specification

Martin Owens-2
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.
>
>

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|

Re: XDG basedir specification

Bryce Harrington-3
In reply to this post by Marc Jeanmougin
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

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|

Re: XDG basedir specification

Maren Hachmann
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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|

Re: XDG basedir specification

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 ;)

--
Marc

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|

Re: XDG basedir specification

Jabier Arraiza
In reply to this post by Maren Hachmann
Is posible ask the user to restore last file when inkscape reopen?

-----Original Message-----
From: Maren Hachmann <[hidden email]>
To: [hidden email]
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
> [hidden email]
> 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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

signature.asc (849 bytes) Download Attachment
C R
Reply | Threaded
Open this post in threaded view
|

Re: XDG basedir specification

C R
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 <[hidden email]> wrote:
Is posible ask the user to restore last file when inkscape reopen?

-----Original Message-----
From: Maren Hachmann <[hidden email]>
To: [hidden email]
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
> [hidden email]
> 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
[hidden email]
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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|

Re: XDG basedir specification

Marc Jeanmougin
On Thu, Aug 23, 2018 at 8:52 AM Jabier Arraiza <[hidden email]> 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 ;)


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|

Re: XDG basedir specification

Vladimir Savic-3
In reply to this post by C R
Hello,

I'm answering inline.

On Thu, Aug 23, 2018 at 11:33 AM C R <[hidden email]> 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.




------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|

Re: XDG basedir specification

Maren Hachmann
In reply to this post by Marc Jeanmougin
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

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel