summaryrefslogtreecommitdiff
path: root/mate-session/gsm-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'mate-session/gsm-util.c')
-rw-r--r--mate-session/gsm-util.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/mate-session/gsm-util.c b/mate-session/gsm-util.c
index a769d8c..a760fc3 100644
--- a/mate-session/gsm-util.c
+++ b/mate-session/gsm-util.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
* gsm-util.c
* Copyright (C) 2008 Lucas Rocha.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -38,6 +39,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)
@@ -207,7 +235,6 @@ gsm_util_get_saved_session_dir (void)
return _saved_session_dir;
}
-
char **
gsm_util_get_autostart_dirs ()
{