diff -Nru light-locker-1.2.0/ChangeLog light-locker-1.2.1/ChangeLog --- light-locker-1.2.0/ChangeLog 2014-02-14 14:26:22.000000000 -0500 +++ light-locker-1.2.1/ChangeLog 2014-03-16 06:23:31.000000000 -0400 @@ -1,3 +1,34 @@ +commit 6cf61953b49ed3f5527fa5094c112961a1630d0f +Author: Peter de Ridder +Date: Sun Mar 16 11:10:28 2014 +0100 + + Preparing to release 1.2.1 + +commit 3464ffe0c9b5a222ee62faa325cb4ca5e17969f6 +Author: Peter de Ridder +Date: Sun Mar 16 11:06:08 2014 +0100 + + Pulled translations from Transifex + +commit 7de901af81edddfcfb88ddb9d07945d0563049f3 +Merge: da124cf 7b3229b +Author: Peter de Ridder +Date: Sat Mar 15 00:30:07 2014 +0100 + + Merge branch 'master' of git://github.com/bluesabre/light-locker + +commit 7b3229b3529dd710f5ad4315fe937fc11343ca95 +Author: Sean Davis +Date: Thu Mar 13 23:14:23 2014 -0400 + + Check if running as just light-locker or if running from PATH + +commit dd604a22ae7b5ae8b5034ba6c1f7b59d988eb5cf +Author: Sean Davis +Date: Thu Mar 13 22:13:26 2014 -0400 + + Check for running light-locker instance, exit with failure if not found + commit da124cfcc09b4b673e99ff7309537aa6df522e7f Author: Peter de Ridder Date: Fri Feb 14 20:11:20 2014 +0100 diff -Nru light-locker-1.2.0/configure light-locker-1.2.1/configure --- light-locker-1.2.0/configure 2014-02-14 14:25:46.000000000 -0500 +++ light-locker-1.2.1/configure 2014-03-16 06:22:54.000000000 -0400 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for light-locker 1.2.0. +# Generated by GNU Autoconf 2.69 for light-locker 1.2.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='light-locker' PACKAGE_TARNAME='light-locker' -PACKAGE_VERSION='1.2.0' -PACKAGE_STRING='light-locker 1.2.0' +PACKAGE_VERSION='1.2.1' +PACKAGE_STRING='light-locker 1.2.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1419,7 +1419,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures light-locker 1.2.0 to adapt to many kinds of systems. +\`configure' configures light-locker 1.2.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1493,7 +1493,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of light-locker 1.2.0:";; + short | recursive ) echo "Configuration of light-locker 1.2.1:";; esac cat <<\_ACEOF @@ -1638,7 +1638,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -light-locker configure 1.2.0 +light-locker configure 1.2.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2003,7 +2003,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by light-locker $as_me 1.2.0, which was +It was created by light-locker $as_me 1.2.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2869,7 +2869,7 @@ # Define the identity of the package. PACKAGE='light-locker' - VERSION='1.2.0' + VERSION='1.2.1' cat >>confdefs.h <<_ACEOF @@ -17641,7 +17641,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by light-locker $as_me 1.2.0, which was +This file was extended by light-locker $as_me 1.2.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17707,7 +17707,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -light-locker config.status 1.2.0 +light-locker config.status 1.2.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru light-locker-1.2.0/configure.ac light-locker-1.2.1/configure.ac --- light-locker-1.2.0/configure.ac 2014-02-14 14:25:23.000000000 -0500 +++ light-locker-1.2.1/configure.ac 2014-03-16 06:22:31.000000000 -0400 @@ -7,7 +7,7 @@ AC_PREREQ(2.60) AC_INIT([light-locker], - [1.2.0]) + [1.2.1]) AC_CONFIG_SRCDIR(src/light-locker.c) diff -Nru light-locker-1.2.0/debian/changelog light-locker-1.2.1/debian/changelog --- light-locker-1.2.0/debian/changelog 2014-02-17 04:54:40.000000000 -0500 +++ light-locker-1.2.1/debian/changelog 2014-03-16 08:41:42.000000000 -0400 @@ -1,3 +1,9 @@ +light-locker (1.2.1-0ubuntu1) UNRELEASED; urgency=medium + + * New upstream release (lp: #1293100). + + -- Sean Davis Sun, 16 Mar 2014 08:35:08 -0400 + light-locker (1.2.0-0ubuntu1) trusty; urgency=low * New upstream release (lp: #1280876). diff -Nru light-locker-1.2.0/NEWS light-locker-1.2.1/NEWS --- light-locker-1.2.0/NEWS 2014-02-14 14:25:09.000000000 -0500 +++ light-locker-1.2.1/NEWS 2014-03-16 06:22:13.000000000 -0400 @@ -1,4 +1,12 @@ ============== +Version 1.2.1 +============== + +- light-locker-command checks if light-locker is running (linux only) +- Translations update + + +============== Version 1.2.0 ============== diff -Nru light-locker-1.2.0/po/ca.po light-locker-1.2.1/po/ca.po --- light-locker-1.2.0/po/ca.po 2014-02-14 14:25:09.000000000 -0500 +++ light-locker-1.2.1/po/ca.po 2014-03-16 06:22:13.000000000 -0400 @@ -4,13 +4,14 @@ # # Translators: # Adolfo Jayme Barrientos , 2013 +# Adolfo Jayme Barrientos , 2014 # Copyright (C) 2013 The light-locker Authors, 2013 msgid "" msgstr "" "Project-Id-Version: light-locker\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-10-31 20:58+0100\n" -"PO-Revision-Date: 2013-11-20 10:39+0000\n" +"PO-Revision-Date: 2014-02-21 08:55+0000\n" "Last-Translator: Adolfo Jayme Barrientos \n" "Language-Team: Catalan (http://www.transifex.com/projects/p/light-locker/language/ca/)\n" "MIME-Version: 1.0\n" @@ -34,7 +35,7 @@ #: ../src/light-locker.c:59 msgid "Lock the screen S seconds after the screensaver started" -msgstr "Bloca la pantalla S segons després de l’inici del stalvi de pantalla" +msgstr "Bloca la pantalla S segons després de l’inici de l’estalvi de pantalla" #: ../src/light-locker.desktop.in.in.h:1 msgid "Screen Locker" diff -Nru light-locker-1.2.0/po/es.po light-locker-1.2.1/po/es.po --- light-locker-1.2.0/po/es.po 2014-02-14 14:25:09.000000000 -0500 +++ light-locker-1.2.1/po/es.po 2014-03-16 06:22:13.000000000 -0400 @@ -4,13 +4,14 @@ # # Translators: # Adolfo Jayme Barrientos , 2013 +# Adolfo Jayme Barrientos , 2014 # Copyright (C) 2013 The light-locker Authors, 2013 msgid "" msgstr "" "Project-Id-Version: light-locker\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-10-31 20:58+0100\n" -"PO-Revision-Date: 2013-11-20 10:39+0000\n" +"PO-Revision-Date: 2014-02-21 08:54+0000\n" "Last-Translator: Adolfo Jayme Barrientos \n" "Language-Team: Spanish (http://www.transifex.com/projects/p/light-locker/language/es/)\n" "MIME-Version: 1.0\n" @@ -51,7 +52,7 @@ #: ../src/gs-content.c:118 msgid "" "You'll be redirected to the unlock dialog automatically in a few seconds" -msgstr "Se le redigirirá al diálogo de desbloqueo automáticamente en unos segundos" +msgstr "Se le redirigirá al diálogo de desbloqueo automáticamente en unos segundos" #: ../src/preview.c:72 msgid "Preview screen width" diff -Nru light-locker-1.2.0/po/nl.po light-locker-1.2.1/po/nl.po --- light-locker-1.2.0/po/nl.po 2014-02-14 14:25:09.000000000 -0500 +++ light-locker-1.2.1/po/nl.po 2014-03-16 06:22:13.000000000 -0400 @@ -3,13 +3,14 @@ # This file is distributed under the same license as the PACKAGE package. # # Translators: +# Pjotr123 , 2014 msgid "" msgstr "" "Project-Id-Version: light-locker\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-10-31 20:58+0100\n" -"PO-Revision-Date: 2013-11-20 10:39+0000\n" -"Last-Translator: ochosi \n" +"PO-Revision-Date: 2014-03-02 10:25+0000\n" +"Last-Translator: Pjotr123 \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/light-locker/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,7 +20,7 @@ #: ../src/light-locker-command.c:40 msgid "Tells the running display manager to lock the screen immediately" -msgstr "Geeft de actieve display manager opdracht om het scherm onmiddellijk te vergrendelen" +msgstr "Geeft de actieve schermbeheerder opdracht om het scherm onmiddellijk te vergrendelen" #: ../src/light-locker-command.c:42 ../src/light-locker.c:56 #: ../src/preview.c:70 @@ -28,7 +29,7 @@ #: ../src/light-locker.c:57 ../src/preview.c:71 msgid "Enable debugging code" -msgstr "Debugging-code gebruiken" +msgstr "Foutopsporingscode inschakelen" #: ../src/light-locker.c:59 msgid "Lock the screen S seconds after the screensaver started" @@ -40,7 +41,7 @@ #: ../src/light-locker.desktop.in.in.h:2 msgid "Launch screen locker program" -msgstr "Schermvergrendeling opstarten" +msgstr "Schermvergrendelingsprogramma starten" #: ../src/gs-content.c:96 msgid "This session is locked" @@ -49,12 +50,12 @@ #: ../src/gs-content.c:118 msgid "" "You'll be redirected to the unlock dialog automatically in a few seconds" -msgstr "Automatische door sturing naar het ontgrendel scherm, over enkele seconden" +msgstr "Over enkele seconden wordt u automatisch doorgestuurd naar het dialoogvenster voor ontgrendeling" #: ../src/preview.c:72 msgid "Preview screen width" -msgstr "Voorbeeld scherm breedte" +msgstr "Voorbeeldweergave schermbreedte" #: ../src/preview.c:73 msgid "Preview screen height" -msgstr "Voorbeeld scherm hoogte" +msgstr "Voorbeeldweergave schermhoogte" diff -Nru light-locker-1.2.0/po/pl.po light-locker-1.2.1/po/pl.po --- light-locker-1.2.0/po/pl.po 2014-02-14 14:25:09.000000000 -0500 +++ light-locker-1.2.1/po/pl.po 2014-03-16 06:22:13.000000000 -0400 @@ -5,13 +5,14 @@ # Translators: # Andrzej Polatyński , 2006 # Hajdzik , 2013 +# Piotr Strębski , 2014 msgid "" msgstr "" "Project-Id-Version: light-locker\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-10-31 20:58+0100\n" -"PO-Revision-Date: 2013-11-20 10:39+0000\n" -"Last-Translator: Hajdzik \n" +"PO-Revision-Date: 2014-03-03 11:11+0000\n" +"Last-Translator: Piotr Strębski \n" "Language-Team: Polish (http://www.transifex.com/projects/p/light-locker/language/pl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,7 +22,7 @@ #: ../src/light-locker-command.c:40 msgid "Tells the running display manager to lock the screen immediately" -msgstr "" +msgstr "Powoduje natychmiastowe zablokowanie ekranu w uruchomionym menedżerze ekranu" #: ../src/light-locker-command.c:42 ../src/light-locker.c:56 #: ../src/preview.c:70 @@ -34,7 +35,7 @@ #: ../src/light-locker.c:59 msgid "Lock the screen S seconds after the screensaver started" -msgstr "" +msgstr "Zablokuj ekran S sekund po uruchomieniu wygaszacza ekranu" #: ../src/light-locker.desktop.in.in.h:1 msgid "Screen Locker" @@ -42,21 +43,21 @@ #: ../src/light-locker.desktop.in.in.h:2 msgid "Launch screen locker program" -msgstr "Uruchom program \"Blokada ekranu\"" +msgstr "Uruchom program blokady ekranu" #: ../src/gs-content.c:96 msgid "This session is locked" -msgstr "" +msgstr "Ta sesja jest zablokowana" #: ../src/gs-content.c:118 msgid "" "You'll be redirected to the unlock dialog automatically in a few seconds" -msgstr "" +msgstr "W przeciągu kilku sekund zostaniesz automatycznie przekierowany do okna odblokowania" #: ../src/preview.c:72 msgid "Preview screen width" -msgstr "" +msgstr "Szerokość podglądu ekranu" #: ../src/preview.c:73 msgid "Preview screen height" -msgstr "" +msgstr "Wysokość podglądu ekranu" diff -Nru light-locker-1.2.0/po/pt_BR.po light-locker-1.2.1/po/pt_BR.po --- light-locker-1.2.0/po/pt_BR.po 2014-02-14 14:25:09.000000000 -0500 +++ light-locker-1.2.1/po/pt_BR.po 2014-03-16 06:22:13.000000000 -0400 @@ -15,8 +15,8 @@ "Project-Id-Version: light-locker\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-10-31 20:58+0100\n" -"PO-Revision-Date: 2013-11-20 10:39+0000\n" -"Last-Translator: cavalier \n" +"PO-Revision-Date: 2014-03-14 13:47+0000\n" +"Last-Translator: kenzo.matuzawa \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/light-locker/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -26,7 +26,7 @@ #: ../src/light-locker-command.c:40 msgid "Tells the running display manager to lock the screen immediately" -msgstr "" +msgstr "Diz ao gerenciador de tela para bloquear a tela imediatamente" #: ../src/light-locker-command.c:42 ../src/light-locker.c:56 #: ../src/preview.c:70 @@ -39,29 +39,29 @@ #: ../src/light-locker.c:59 msgid "Lock the screen S seconds after the screensaver started" -msgstr "" +msgstr "Bloqueia a tela S segundos depois que o protetor de tela iniciar" #: ../src/light-locker.desktop.in.in.h:1 msgid "Screen Locker" -msgstr "" +msgstr "Bloqueio de Tela" #: ../src/light-locker.desktop.in.in.h:2 msgid "Launch screen locker program" -msgstr "" +msgstr "Iniciar o programa de bloqueio de tela" #: ../src/gs-content.c:96 msgid "This session is locked" -msgstr "" +msgstr "Esta sessão está bloqueada" #: ../src/gs-content.c:118 msgid "" "You'll be redirected to the unlock dialog automatically in a few seconds" -msgstr "" +msgstr "Você será redirecionado ao diálogto de desbloqueio automaticamente em poucos segundos" #: ../src/preview.c:72 msgid "Preview screen width" -msgstr "" +msgstr "Largura da tela de pré-visualização" #: ../src/preview.c:73 msgid "Preview screen height" -msgstr "" +msgstr "Altura da tela de pré-visualização" diff -Nru light-locker-1.2.0/src/light-locker-command.c light-locker-1.2.1/src/light-locker-command.c --- light-locker-1.2.0/src/light-locker-command.c 2013-08-27 13:39:52.000000000 -0400 +++ light-locker-1.2.1/src/light-locker-command.c 2014-03-16 06:22:13.000000000 -0400 @@ -116,6 +116,99 @@ return FALSE; } +static gboolean +screensaver_is_running (void) +{ +#if __linux__ + /* Return TRUE if there is a running instance of light-locker */ + gboolean exists = FALSE; + + GDir* proc = NULL; + GError* error = NULL; + gchar* subdir = "a"; + gchar* dir_path = NULL; + gchar* file_path = NULL; + gchar* contents = NULL; + gchar** paths = NULL; + gchar* path = NULL; + gsize length; + guint i = 0; + + /* Check the /proc directory for pids */ + proc = g_dir_open("/proc", 0, &error); + if (error) + { + g_critical("%s", error->message); + g_error_free(error); + return FALSE; + } + + /* Iterate through each file, the PIDs are directories */ + while (subdir != NULL) + { + subdir = g_strdup(g_dir_read_name(proc)); + dir_path = g_build_filename("/proc", subdir, (gchar*)NULL); + + /* If its a directory, check it out. */ + if (g_file_test(dir_path, G_FILE_TEST_IS_DIR)) + { + /* Check for the cmdline file, which has the command. */ + file_path = g_build_filename(dir_path, "cmdline", (gchar*)NULL); + if (g_file_test(file_path, G_FILE_TEST_EXISTS)) { + if (g_file_get_contents(g_strdup(file_path), &contents, &length, &error)) + { + /* Check if light-locker is running */ + if (g_str_has_suffix(contents, "light-locker")) + { + /* Check for just "light-locker" */ + if (g_strcmp0(contents, "light-locker") == 0) + { + exists = TRUE; + } + if (!exists) + { + /* Check if executable in path */ + paths = g_strsplit(g_getenv("PATH"), ":", 0); + for (i = 0; i < g_strv_length(paths); i++) { + path = g_strdup(g_build_filename(paths[i], "light-locker", NULL)); + if (g_strcmp0(contents, path) == 0) + { + exists = TRUE; + g_free(path); + break; + } + g_free(path); + } + g_strfreev(paths); + } + } + } + g_free(contents); + if (error) + { + g_error_free(error); + error = NULL; + } + } + g_free(file_path); + } + g_free(dir_path); + + /* If found, stop the loop */ + if (exists) + { + g_free(subdir); + subdir = NULL; + } + } + g_dir_close(proc); + + return exists; +#else + return TRUE; +#endif +} + int main (int argc, char **argv) @@ -168,6 +261,11 @@ return EXIT_FAILURE; } + if (!screensaver_is_running()) { + g_message ("light-locker is not running"); + return EXIT_FAILURE; + } + g_idle_add ((GSourceFunc) do_command, connection); loop = g_main_loop_new (NULL, FALSE);