summaryrefslogtreecommitdiff
path: root/mate-session/gsm-util.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-01-18 21:39:36 +0100
committerraveit65 <[email protected]>2021-03-27 11:05:14 +0100
commit81b6185eb3d47cba4d8f1232556e176b9f810015 (patch)
treed91d65496cf888556f0b6be262f2f3089d2149d7 /mate-session/gsm-util.c
parentad3ea9108d86d1ba0a5da68fd3af5a0719c32fa9 (diff)
downloadmate-session-manager-81b6185eb3d47cba4d8f1232556e176b9f810015.tar.bz2
mate-session-manager-81b6185eb3d47cba4d8f1232556e176b9f810015.tar.xz
Support xscreensaver when mate-screensaver is not available
Diffstat (limited to 'mate-session/gsm-util.c')
-rw-r--r--mate-session/gsm-util.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/mate-session/gsm-util.c b/mate-session/gsm-util.c
index a769d8c..76bf9cd 100644
--- a/mate-session/gsm-util.c
+++ b/mate-session/gsm-util.c
@@ -38,6 +38,33 @@
static gchar *_saved_session_dir = NULL;
+gchar **
+gsm_get_screen_locker_command (void)
+{
+ const char *screen_locker_command[] = {
+ "mate-screensaver-command --lock",
+ "xscreensaver-command -lock",
+ NULL
+ };
+ gchar **screen_locker_argv = NULL;
+ gsize i;
+
+ for (i = 0; screen_locker_command[i] != NULL && screen_locker_argv == NULL; i++) {
+ gchar **argv;
+ char *path;
+
+ argv = g_strsplit (screen_locker_command [i], " ", -1);
+ path = g_find_program_in_path (argv[0]);
+ if (path)
+ screen_locker_argv = g_strdupv (argv);
+
+ g_free (path);
+ g_strfreev (argv);
+ }
+
+ return screen_locker_argv;
+}
+
char *
gsm_util_find_desktop_file_for_app_name (const char *name,
char **autostart_dirs)