[Xfce4-commits] [panel-plugins/xfce4-verve-plugin] 01/01: Implement and enable option to run executable commands through the shell ($SHELL -i -c) - enabled by default

noreply at xfce.org noreply at xfce.org
Wed Mar 18 02:33:51 CET 2015


This is an automated email from the git hooks/post-receive script.

isaacschemm pushed a commit to branch master
in repository panel-plugins/xfce4-verve-plugin.

commit d9cd1a7d757643792d6d18a99ad7b3f6809b73b8
Author: Isaac Schemm <isaacschemm at gmail.com>
Date:   Tue Mar 17 20:32:52 2015 -0500

    Implement and enable option to run executable commands through the shell ($SHELL -i -c) - enabled by default
---
 panel-plugin/verve-plugin.c |    2 +-
 panel-plugin/verve.c        |   23 +++++++++++++++++++----
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/panel-plugin/verve-plugin.c b/panel-plugin/verve-plugin.c
index ac97706..c6447bf 100644
--- a/panel-plugin/verve-plugin.c
+++ b/panel-plugin/verve-plugin.c
@@ -1263,7 +1263,7 @@ verve_plugin_properties (XfcePanelPlugin *plugin,
   alignment = gtk_alignment_new (1, 1, 1, 1);
   gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 24, 0);
   gtk_box_pack_start (GTK_BOX (command_types_vbox), alignment, FALSE, TRUE, 0);
-  //gtk_widget_show (alignment); - not implemented yet
+  gtk_widget_show (alignment);
   
   command_type_use_shell = gtk_check_button_new_with_label(_("Run command with $SHELL -i -c\n(enables alias and variable expansion)"));
   gtk_container_add (GTK_CONTAINER (alignment), command_type_use_shell);
diff --git a/panel-plugin/verve.c b/panel-plugin/verve.c
index 38cff7d..7bc60a8 100644
--- a/panel-plugin/verve.c
+++ b/panel-plugin/verve.c
@@ -194,11 +194,26 @@ verve_execute (const gchar *input,
   }
   else
   {
-    /* Run command using the xfterm4 wrapper if the terminal flag was set */
-    if (G_UNLIKELY (terminal))
-      command = g_strconcat ("exo-open --launch TerminalEmulator '", input, "'", NULL);
+    if (launch_params.use_shell)
+    {
+      /* Find current shell */
+      char *shell = getenv("SHELL");
+      if (shell == NULL) shell = "/bin/sh";
+
+      /* Run command using the xfterm4 wrapper if the terminal flag was set */
+      if (G_UNLIKELY (terminal))
+        command = g_strconcat ("exo-open --launch TerminalEmulator '", shell, " -i -c ", input, "'", NULL);
+      else
+        command = g_strconcat (shell, " -i -c ", input, NULL);
+    }
     else
-      command = g_strdup (input);
+    {
+      /* Run command using the xfterm4 wrapper if the terminal flag was set */
+      if (G_UNLIKELY (terminal))
+        command = g_strconcat ("exo-open --launch TerminalEmulator '", input, "'", NULL);
+      else
+        command = g_strdup (input);
+    }
   }
     
   /* Try to execute the exo-open command */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list