Skip to content

Commit

Permalink
Fix for flatpak commands
Browse files Browse the repository at this point in the history
  • Loading branch information
DevAlien committed Aug 16, 2020
1 parent 14b8d45 commit 1cc562f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/Models/Item.vala
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@ public class Workspaces.Models.Item : Object {
Object ();
this.id = Uuid.string_random ();
this.name = name;
this.command = "";
}

public void execute_command () {
try {
Process.spawn_command_line_async (command);
} catch (SpawnError e) {
warning ("Error: %s\n", e.message);
if (command.length > 0) {
var to_run_command = command;
if (is_flatpak () == true) {
to_run_command = "flatpak-spawn --host " + to_run_command;
}
try {
Process.spawn_command_line_async (to_run_command);
} catch (SpawnError e) {
warning ("Error: %s\n", e.message);
}
}
}

Expand Down

0 comments on commit 1cc562f

Please sign in to comment.