+public class CommandButton : Gtk.Button
+{
+ private string command;
+
+ public CommandButton(string name, string command)
+ {
+ label = name;
+ this.command = command;
+ clicked += on_clicked;
+ set_size_request(0, zavai.config.min_button_height);
+ }
+
+ public void on_clicked()
+ {
+ zavai.log.info("Run program: " + command);
+ string[] args = command.split(" ");
+ Pid pid;
+ Process.spawn_async(
+ Environment.get_home_dir(),
+ args,
+ null,
+ SpawnFlags.SEARCH_PATH,
+ null,
+ out pid);
+ }
+}
+
+