This patch lets GLib's GDesktopAppInfo API watch and notice changes to the Guix user and system profiles. That way, the list of available applications shown by the desktop environment is immediately updated when the user runs "guix install", "guix remove", or "guix system reconfigure" (see ). It does so by monitoring /var/guix/profiles (for changes to the system profile) and /var/guix/profiles/per-user/USER (for changes to the user profile) and crawling their share/applications sub-directory when changes happen. diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index f1e2fdd..095c110 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -148,6 +148,7 @@ typedef struct gchar *alternatively_watching; gboolean is_config; gboolean is_setup; + gchar *guix_profile_watch_dir; GFileMonitor *monitor; GHashTable
aboutsummaryrefslogtreecommitdiff
path: root/gnu/machine/digital-ocean.scm
modifications to their + * /share sub-directory. */ + const gchar *user; + DesktopFileDir *system_profile_dir, *user_profile_dir; + + system_profile_dir = + desktop_file_dir_new ("/var/guix/profiles/system/profile/share"); + system_profile_dir->guix_profile_watch_dir = g_strdup ("/var/guix/profiles"); + g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (system_profile_dir)); + + user = g_get_user_name (); + if (user != NULL) + { + gchar *profile_dir, *user_data_dir; + + profile_dir = g_build_filename ("/var/guix/profiles/per-user", user, NULL); + user_data_dir = g_build_filename (profile_dir, "guix-profile", "share", NULL); + user_profile_dir = desktop_file_dir_new (user_data_dir); + user_profile_dir->guix_profile_watch_dir = profile_dir; + g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (user_profile_dir)); + g_free (user_data_dir); + } + } + /* The list of directories will never change after this, unless * g_get_user_config_dir() changes due to %G_TEST_OPTION_ISOLATE_DIRS. */ desktop_file_dirs_config_dir = user_config_dir;
AgeCommit message (Expand)Author