mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 14:03:42 +02:00
Find flatpak apps in flatpak mode (#308)
* Call flatpak-spawn when in flatpak mode * Also test flatpak feature on unix * Update readme with flatpak-flatpak support * Update to version 1.7.18
This commit is contained in:
@@ -37,13 +37,7 @@ impl NeedsPorton<FlatpakPlatform> for FlatpakApp {
|
||||
|
||||
impl FlatpakPlatform {
|
||||
fn get_flatpak_apps(&self) -> eyre::Result<Vec<FlatpakApp>> {
|
||||
use std::process::Command;
|
||||
let mut command = Command::new("flatpak");
|
||||
let output = command
|
||||
.arg("list")
|
||||
.arg("--app")
|
||||
.arg("--columns=name,application")
|
||||
.output()?;
|
||||
let output = get_flatpak_applications()?;
|
||||
let output_string = String::from_utf8_lossy(&output.stdout).to_string();
|
||||
let mut result = vec![];
|
||||
for line in output_string.lines() {
|
||||
@@ -61,6 +55,30 @@ impl FlatpakPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_flatpak_applications() -> std::io::Result<std::process::Output> {
|
||||
use std::process::Command;
|
||||
#[cfg(not(feature = "flatpak"))]
|
||||
{
|
||||
let mut command = Command::new("flatpak");
|
||||
command
|
||||
.arg("list")
|
||||
.arg("--app")
|
||||
.arg("--columns=name,application")
|
||||
.output()
|
||||
}
|
||||
#[cfg(feature = "flatpak")]
|
||||
{
|
||||
let mut command = Command::new("flatpak-spawn");
|
||||
command
|
||||
.arg("--host")
|
||||
.arg("flatpak")
|
||||
.arg("list")
|
||||
.arg("--app")
|
||||
.arg("--columns=name,application")
|
||||
.output()
|
||||
}
|
||||
}
|
||||
|
||||
impl FromSettingsString for FlatpakPlatform {
|
||||
fn from_settings_string<S: AsRef<str>>(s: S) -> Self {
|
||||
FlatpakPlatform {
|
||||
|
||||
Reference in New Issue
Block a user