[GNC] Correct environment variables for Linux?

Geert Janssens geert.gnucash at kobaltwit.be
Fri Jan 8 06:22:16 EST 2021


Setting XDG_DATA_HOME and XDG_CONFIG_HOME will affect more than just gnucash. It also 
affect many other parts of the gnome or kde desktop environments.

If gnucash always starts as if it has never run before, it's most likely gnucash can't 
communicate with gsettings. Part of the gnucash settings are stored there. On linux dconf is 
used as backend for gsettings. It may well be dconf doesn't work properly if you change the 
above environment variables in a running linux session (be it gnome or kde or any other 
desktop environment).

I would suggest setting GNC_CONFIG_DIR and GNC_DATA_DIR rather than the XDG_ 
environnment variables.

In your scenario these could be set to:
export XDG_DATA_HOME=$TOP/.local/share/gnucash
export XDG_CONFIG_HOME=$TOP/.config/gnucash

Note that for a full backup you'll have to find a way to export the settings stored via gsettings 
as well. You could script something using "dconf dump" and "dconf load" to export or import 
settings trees from dconf. 

Regards,

Geert

Op vrijdag 1 januari 2021 12:04:12 CET schreef Dan Ståhlberg via gnucash-user:
> My New Years resolution was to finally create a better backup strategy for
> my GnuCash files. In order to achieve this, the GnuCash files and
> directories need to be on another disk and GnuCash environment variables
> need to point to this directory. Following recommendations on the Wiki I
> have made a Linux bash shell startscript for GnuCash. But GnuCash seems to
> start up fresh everytime, with initial opening questions and suggestions
> and no recent files??? I am using Ubuntu 20.04, bash and GnuCash "3.8b+".
> 
> Can anyone help me to see if the environment variables are set correctly?
> 
> Thanks in advance and Happy New Year to all!
> Dan
> 
> startup script file (Bash shell):
> 
> #!/bin/bash
> 
> #
> 
> # Setup GnuCash environment and start GnuCash with Swedish sort order but
> English menus
> 
> # https://wiki.gnucash.org/wiki/Configuration_Locations
> 
> # https://wiki.gnucash.org/wiki/Directories
> 
> #
> 
> # 2021-01-01 Dan Ståhlberg
> 
> TOP=/bigd/workarea/ekonomi/gnucash/2021
> 
> export HOME=$TOP
> 
> export XDG_DATA_HOME=$TOP/.local/share
> 
> export XDG_CONFIG_HOME=$TOP/.config
> 
> LC_COLLATE=sv_SE.UTF-8 gnucash
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information. -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.




More information about the gnucash-user mailing list