Menu

#27 Please support the XDG basedir specification

closed
None
5
2025-12-22
2025-12-21
genodeftest
No

Grsync creates a folder in the home dir, ~/.grsync. This – among some other applications – pollutes the contents of the home dir. It would be nicer if Grsync could adhere to the XDG basedir specification. For backwards compatibility, Grsync should search in both the old (~/.grsync) and new locations, but only create files in the new location by default.

Discussion

  • Piero Orsoni

    Piero Orsoni - 2025-12-22
    • status: open --> closed
    • assigned_to: Piero Orsoni
     
  • Piero Orsoni

    Piero Orsoni - 2025-12-22

    Hello,

    It should already be like that:

    grsync_dir = g_strconcat(g_get_user_config_dir(), "/grsync", NULL);
        if (!g_file_test(grsync_dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
            g_free(grsync_dir);
            grsync_dir = g_strconcat(g_get_home_dir(), "/.grsync", NULL);
    
            if (!g_file_test(grsync_dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
                g_free(grsync_dir);
                grsync_dir = g_strconcat(g_get_user_config_dir(), "/grsync", NULL);
            }
        }
    

    i.e. it tries to load from .config/grsync, if it doesn't find it it tries from .grsync, if that fails as well it creates the file in .config/grsync.

    Please test it and, if it doesn't work, please file a bug.

    Many thanks

     

Log in to post a comment.