Remove %foo arguments
[gregoa/zavai.git] / src / app_wm.vala
index a1cfbeb93e360ec548b9e89ed8fb3593652d730e..68cb28c08411f76358bba362e5d60aea1b4ba9d8 100644 (file)
@@ -148,11 +148,19 @@ public class LauncherButton : Gtk.Button
        public void on_clicked()
        {
                zavai.log.info("Run program: " + exec);
-               string[] args = new string[] { exec, null };
+               string[] args = exec.split(" ");
+               string[] args1 = new string[args.length + 1];
+               int cout = 0;
+               for (int cin = 0; cin < args.length; ++cin)
+               {
+                       if (args[cin][0] == '%') continue;
+                       args1[cout++] = args[cin];
+               }
+               args1[cout] = null;
                Pid pid;
                Process.spawn_async(
                        Environment.get_home_dir(),
-                       args,
+                       args1,
                        null,
                        SpawnFlags.SEARCH_PATH,
                        null,