mirror of
https://github.com/13hannes11/toolbx-tuner.git
synced 2024-09-03 23:21:00 +02:00
change commands to use flatpak-spawn --host
This commit is contained in:
@@ -147,7 +147,9 @@ impl ToolbxContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn stop(&mut self) -> Result<(), ToolbxError> {
|
pub fn stop(&mut self) -> Result<(), ToolbxError> {
|
||||||
let output = Command::new("podman")
|
let output = Command::new("flatpak-spawn")
|
||||||
|
.arg("--host") //Command::new("podman")
|
||||||
|
.arg("podman")
|
||||||
.arg("stop")
|
.arg("stop")
|
||||||
.arg(self.name.clone())
|
.arg(self.name.clone())
|
||||||
.output();
|
.output();
|
||||||
@@ -178,7 +180,9 @@ impl ToolbxContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn start(&mut self) -> Result<(), ToolbxError> {
|
pub fn start(&mut self) -> Result<(), ToolbxError> {
|
||||||
let output = Command::new("podman")
|
let output = Command::new("flatpak-spawn")
|
||||||
|
.arg("--host") //Command::new("podman")
|
||||||
|
.arg("podman")
|
||||||
.arg("start")
|
.arg("start")
|
||||||
.arg(self.name.clone())
|
.arg(self.name.clone())
|
||||||
.output();
|
.output();
|
||||||
@@ -258,12 +262,16 @@ fn test_start_non_existing_containter() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_cmd_toolbx_list_containers() -> String {
|
pub fn run_cmd_toolbx_list_containers() -> String {
|
||||||
let output = Command::new("toolbox")
|
let output = Command::new("flatpak-spawn")
|
||||||
|
.arg("--host")
|
||||||
|
.arg("toolbox")
|
||||||
.arg("list")
|
.arg("list")
|
||||||
.arg("--containers")
|
.arg("--containers")
|
||||||
.output()
|
.output()
|
||||||
.expect("Failed to execute command");
|
.expect("Failed to execute command");
|
||||||
|
|
||||||
|
println!("{:?}", String::from_utf8_lossy(&output.stdout).to_string());
|
||||||
|
|
||||||
String::from_utf8_lossy(&output.stdout).to_string()
|
String::from_utf8_lossy(&output.stdout).to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,9 @@ impl AppUpdate for AppModel {
|
|||||||
AppMsg::OpenToolbxTerminal(index) => {
|
AppMsg::OpenToolbxTerminal(index) => {
|
||||||
if let Some(toolbx_container) = self.toolboxes.get_mut(index.current_index()) {
|
if let Some(toolbx_container) = self.toolboxes.get_mut(index.current_index()) {
|
||||||
// TODO: support many terminals and check which are installed
|
// TODO: support many terminals and check which are installed
|
||||||
let output = Command::new("gnome-terminal")
|
let output = Command::new("flatpak-spawn")
|
||||||
|
.arg("--host")
|
||||||
|
.arg("gnome-terminal") //Command::new("gnome-terminal")
|
||||||
.arg("--")
|
.arg("--")
|
||||||
.arg("toolbox")
|
.arg("toolbox")
|
||||||
.arg("enter")
|
.arg("enter")
|
||||||
|
|||||||
Reference in New Issue
Block a user