Eliminate hardcoded "xterm" in 'volumealsa' plugin, use standard terminal support...
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Thu, 23 Oct 2014 01:33:24 +0000 (04:33 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Thu, 23 Oct 2014 01:35:30 +0000 (04:35 +0300)
Also added few FIXME into plugin - it requires a lot of improvements yet.

ChangeLog
plugins/volumealsa/volumealsa.c

index e7efe04..02a1034 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
 * Ensured panel background update after some plugin was resized.
 * FileManager statement from old config should never be scanned again.
 * Fixed positioning of new created panel, the edge was not saved.
+* Eliminated hardcoded "xterm" in 'volumealsa' plugin - LibFM has enough
+    means to call terminal when needed.
 
 0.7.1
 -------------------------------------------------------------------------
index 3e6a537..7183098 100644 (file)
@@ -591,10 +591,14 @@ static GtkWidget *volumealsa_configure(LXPanel *panel, GtkWidget *p)
     VolumeALSAPlugin * vol = lxpanel_plugin_get_data(p);
     char *path = NULL;
     const gchar *command_line = NULL;
+    GAppInfoCreateFlags flags = G_APP_INFO_CREATE_NONE;
 
     /* FIXME: configure settings! */
     /* check if command line was configured */
     config_setting_lookup_string(vol->settings, "MixerCommand", &command_line);
+    /* FIXME: support "needs terminal" for MixerCommand */
+    /* FIXME: selection for master channel! */
+    /* FIXME: configure buttons for each action (toggle volume/mixer/mute)! */
 
     /* if command isn't set in settings then let guess it */
     if (command_line == NULL && (path = g_find_program_in_path("pulseaudio")))
@@ -624,19 +628,15 @@ static GtkWidget *volumealsa_configure(LXPanel *panel, GtkWidget *p)
         }
         else if ((path = g_find_program_in_path("alsamixer")))
         {
-            g_free(path);
-            if ((path = g_find_program_in_path("xterm")))
-            {
-                command_line = "xterm -e alsamixer";
-            }
+            command_line = "alsamixer";
+            flags = G_APP_INFO_CREATE_NEEDS_TERMINAL;
         }
     }
     g_free(path);
 
     if (command_line)
     {
-        fm_launch_command_simple(NULL, NULL, G_APP_INFO_CREATE_NONE,
-                                 command_line, NULL);
+        fm_launch_command_simple(NULL, NULL, flags, command_line, NULL);
     }
     else
     {