mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-26 10:25:44 +00:00
Fix flatpak install check for applications
This commit is contained in:
@@ -125,6 +125,24 @@ public interface ExternalApplicationType extends PrefsValue {
|
||||
|
||||
String getFlatpakId() throws Exception;
|
||||
|
||||
@Override
|
||||
default boolean isAvailable() {
|
||||
try (ShellControl pc = LocalShell.getShell().start()) {
|
||||
if (getFlatpakId() != null) {
|
||||
var app = FlatpakCache.getApp(getFlatpakId());
|
||||
if (app.isPresent()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
String name = getExecutable();
|
||||
return pc.view().findProgram(name).isPresent();
|
||||
} catch (Exception e) {
|
||||
ErrorEventFactory.fromThrowable(e).omit().handle();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
default void launch(CommandBuilder args) throws Exception {
|
||||
if (getFlatpakId() == null
|
||||
|
||||
Reference in New Issue
Block a user