[rhythmbox] add --check-running arg to rhythmbox-client
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] add --check-running arg to rhythmbox-client
- Date: Sat, 2 Oct 2010 08:43:56 +0000 (UTC)
commit 2e109b246ec694774ec38ff0e013823690d12264
Author: Jonathan Matthew <jonathan d14n org>
Date: Sat Oct 2 18:42:56 2010 +1000
add --check-running arg to rhythmbox-client
exits with 0 if it's running, 2 if it's not, 1 if things are broken.
remote/dbus/rb-client.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/remote/dbus/rb-client.c b/remote/dbus/rb-client.c
index 57ec7e6..d6ec452 100644
--- a/remote/dbus/rb-client.c
+++ b/remote/dbus/rb-client.c
@@ -44,6 +44,7 @@ static gboolean debug = FALSE;
static gboolean no_start = FALSE;
static gboolean quit = FALSE;
+static gboolean check_running = FALSE;
static gboolean no_present = FALSE;
static gboolean hide = FALSE;
@@ -85,6 +86,7 @@ static GOptionEntry args[] = {
{ "no-start", 0, 0, G_OPTION_ARG_NONE, &no_start, N_("Don't start a new instance of Rhythmbox"), NULL },
{ "quit", 0, 0, G_OPTION_ARG_NONE, &quit, N_("Quit Rhythmbox"), NULL },
+ { "check-running", 0, 0, G_OPTION_ARG_NONE, &check_running, N_("Check if Rhythmbox is already running"), NULL },
{ "no-present", 0, 0, G_OPTION_ARG_NONE, &no_present, N_("Don't present an existing Rhythmbox window"), NULL },
{ "hide", 0, 0, G_OPTION_ARG_NONE, &hide, N_("Hide the Rhythmbox window"), NULL },
@@ -603,6 +605,17 @@ main (int argc, char **argv)
}
g_clear_error (&error);
+ /* are we just checking if it's running? */
+ if (check_running) {
+ if (shell_proxy) {
+ rb_debug ("running instance found");
+ exit (0);
+ } else {
+ rb_debug ("no running instance found");
+ exit (2);
+ }
+ }
+
/* 1. activate or quit */
if (quit) {
if (shell_proxy) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]