[startup-flags]: Add default for higher XDG base dirs compliance. More precise
predicate.
---
src/rde/features/web-browsers.scm | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/rde/features/web-browsers.scm b/src/rde/features/web-browsers.scm
index d2ecf9a9..2d6eb20f 100644
--- a/src/rde/features/web-browsers.scm+++ b/src/rde/features/web-browsers.scm
@@ -36,15 +36,21 @@
#:export (feature-ungoogled-chromium
feature-nyxt))
+;; The issue with Chromium is that like Libreoffice, all user data is+;; managed in a single directory in ~/.config by default. Like Libreoffice,+;; the content of this single directory better matches XDG_STATE_HOME for the+;; most part, but since it still may contains config data, we prefer to put it+;; in XDG_DATA_HOME for user config safety while the issue is upstream.+(define* (feature-ungoogled-chromium
#:key
(ungoogled-chromium ungoogled-chromium/wayland)
(default-browser? #f)
- (startup-flags '()))+ (startup-flags '("--user-data-dir=$XDG_DATA_HOME/chromium"))) "Configure the Chromium browser."
(ensure-pred any-package? ungoogled-chromium)
(ensure-pred boolean? default-browser?)
- (ensure-pred list? startup-flags)+ (ensure-pred list-of-strings? startup-flags) (define f-name 'ungoogled-chromium)
--
2.41.0
On 2023-08-27 22:57, Nicolas Graves wrote:
> [startup-flags]: Add default for higher XDG base dirs compliance. More precise> predicate.> ---> src/rde/features/web-browsers.scm | 10 ++++++++--> 1 file changed, 8 insertions(+), 2 deletions(-)>> diff --git a/src/rde/features/web-browsers.scm b/src/rde/features/web-browsers.scm> index d2ecf9a9..2d6eb20f 100644> --- a/src/rde/features/web-browsers.scm> +++ b/src/rde/features/web-browsers.scm> @@ -36,15 +36,21 @@> #:export (feature-ungoogled-chromium> feature-nyxt))> > +;; The issue with Chromium is that like Libreoffice, all user data is> +;; managed in a single directory in ~/.config by default. Like Libreoffice,> +;; the content of this single directory better matches XDG_STATE_HOME for the> +;; most part, but since it still may contains config data, we prefer to put it> +;; in XDG_DATA_HOME for user config safety while the issue is upstream.
DATA_DIRS should usually contain some static data. It seems
XDG_STATE_HOME fits better here, isn't it?
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html> +> (define* (feature-ungoogled-chromium> #:key> (ungoogled-chromium ungoogled-chromium/wayland)> (default-browser? #f)> - (startup-flags '()))> + (startup-flags '("--user-data-dir=$XDG_DATA_HOME/chromium")))
Probably it's better to add it as a first argument to executable
directly in desktop file, this way it will work even if user define his
own #:startup-flags and it still possible to override it by specifying
it one more time with different value.
> "Configure the Chromium browser."> (ensure-pred any-package? ungoogled-chromium)> (ensure-pred boolean? default-browser?)> - (ensure-pred list? startup-flags)> + (ensure-pred list-of-strings? startup-flags)> > (define f-name 'ungoogled-chromium)
--
Best regards,
Andrew Tropin
On 2023-08-30 14:16, Andrew Tropin wrote:
> On 2023-08-27 22:57, Nicolas Graves wrote:>>> [startup-flags]: Add default for higher XDG base dirs compliance. More precise>> predicate.>> --->> src/rde/features/web-browsers.scm | 10 ++++++++-->> 1 file changed, 8 insertions(+), 2 deletions(-)>>>> diff --git a/src/rde/features/web-browsers.scm b/src/rde/features/web-browsers.scm>> index d2ecf9a9..2d6eb20f 100644>> --- a/src/rde/features/web-browsers.scm>> +++ b/src/rde/features/web-browsers.scm>> @@ -36,15 +36,21 @@>> #:export (feature-ungoogled-chromium>> feature-nyxt))>> >> +;; The issue with Chromium is that like Libreoffice, all user data is>> +;; managed in a single directory in ~/.config by default. Like Libreoffice,>> +;; the content of this single directory better matches XDG_STATE_HOME for the>> +;; most part, but since it still may contains config data, we prefer to put it>> +;; in XDG_DATA_HOME for user config safety while the issue is upstream.>> DATA_DIRS should usually contain some static data. It seems> XDG_STATE_HOME fits better here, isn't it?>> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
It could, I don't have a strong opinion here. What lead me to settle for
DATA_HOME was the fact that basically all big applications which do not
fully comply with the XDG specification yet seem to do that (in mine, I
have nyxt, epiphany, webkitgtk...). Same thing for Libreoffice.
>>> +>> (define* (feature-ungoogled-chromium>> #:key>> (ungoogled-chromium ungoogled-chromium/wayland)>> (default-browser? #f)>> - (startup-flags '()))>> + (startup-flags '("--user-data-dir=$XDG_DATA_HOME/chromium")))>> Probably it's better to add it as a first argument to executable> directly in desktop file, this way it will work even if user define his> own #:startup-flags and it still possible to override it by specifying> it one more time with different value.
Yes, I also have a discussion to raise about CLI in case of startup
flags. Basically, if we would want to start from command-line for some
reason, we might (or not) want the startup flags to apply. The simplest
use-case would be --incognito or --kiosk or --remote-debugging-port
here.
When we would lauch with either of these flags, we would want data to
still go to the right place and not create a new directory. In this
case, isn't it more simple to create a new wrapper executable with the
argument and then use it in the desktop file ?
Same thing for my libreoffice patch. Also sorry if you test it, the
--no-logo part has to be replaced by --nologo. Will do it in a v2 after
this discussion.
>>> "Configure the Chromium browser.">> (ensure-pred any-package? ungoogled-chromium)>> (ensure-pred boolean? default-browser?)>> - (ensure-pred list? startup-flags)>> + (ensure-pred list-of-strings? startup-flags)>> >> (define f-name 'ungoogled-chromium)
--
Best regards,
Nicolas Graves
On 2023-08-30 13:21, Nicolas Graves wrote:
> On 2023-08-30 14:16, Andrew Tropin wrote:>>> On 2023-08-27 22:57, Nicolas Graves wrote:>>>>> [startup-flags]: Add default for higher XDG base dirs compliance. More precise>>> predicate.>>> --->>> src/rde/features/web-browsers.scm | 10 ++++++++-->>> 1 file changed, 8 insertions(+), 2 deletions(-)>>>>>> diff --git a/src/rde/features/web-browsers.scm b/src/rde/features/web-browsers.scm>>> index d2ecf9a9..2d6eb20f 100644>>> --- a/src/rde/features/web-browsers.scm>>> +++ b/src/rde/features/web-browsers.scm>>> @@ -36,15 +36,21 @@>>> #:export (feature-ungoogled-chromium>>> feature-nyxt))>>> >>> +;; The issue with Chromium is that like Libreoffice, all user data is>>> +;; managed in a single directory in ~/.config by default. Like Libreoffice,>>> +;; the content of this single directory better matches XDG_STATE_HOME for the>>> +;; most part, but since it still may contains config data, we prefer to put it>>> +;; in XDG_DATA_HOME for user config safety while the issue is upstream.>>>> DATA_DIRS should usually contain some static data. It seems>> XDG_STATE_HOME fits better here, isn't it?>>>> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html>> It could, I don't have a strong opinion here. What lead me to settle for> DATA_HOME was the fact that basically all big applications which do not> fully comply with the XDG specification yet seem to do that (in mine, I> have nyxt, epiphany, webkitgtk...). Same thing for Libreoffice. >>>>> +>>> (define* (feature-ungoogled-chromium>>> #:key>>> (ungoogled-chromium ungoogled-chromium/wayland)>>> (default-browser? #f)>>> - (startup-flags '()))>>> + (startup-flags '("--user-data-dir=$XDG_DATA_HOME/chromium")))>>>> Probably it's better to add it as a first argument to executable>> directly in desktop file, this way it will work even if user define his>> own #:startup-flags and it still possible to override it by specifying>> it one more time with different value.>> Yes, I also have a discussion to raise about CLI in case of startup> flags. Basically, if we would want to start from command-line for some> reason, we might (or not) want the startup flags to apply. The simplest> use-case would be --incognito or --kiosk or --remote-debugging-port> here.>> When we would lauch with either of these flags, we would want data to> still go to the right place and not create a new directory. In this> case, isn't it more simple to create a new wrapper executable with the> argument and then use it in the desktop file ?
Yes, actually I also thoughts about using a wrapper for it. Maybe we
can split startup flags into wrapper-startup-flags and
desktop-item-startup-flags or something like this. Not now (or maybe
never), but in general it may be useful if they are added with a
service, so other features can extend the service to add more flags.
>> Same thing for my libreoffice patch. Also sorry if you test it, the> --no-logo part has to be replaced by --nologo. Will do it in a v2 after> this discussion. >
I didn't test it yet, I was too tired yesterday, when was reading the
thread. Actually it was unexpected place to find a libreoffice patch :)
Try to use --cover-letter when you want to combine a bunch of related
commits in one patch series.
>>>>> "Configure the Chromium browser.">>> (ensure-pred any-package? ungoogled-chromium)>>> (ensure-pred boolean? default-browser?)>>> - (ensure-pred list? startup-flags)>>> + (ensure-pred list-of-strings? startup-flags)>>> >>> (define f-name 'ungoogled-chromium)
--
Best regards,
Andrew Tropin
[PATCH v2 1/2] feature: ungoogled-chromium: Change default user data dir.