feat(cli, flatpak): implemented kill action for pwsp-cli.

use it instead of pkill in the flatpak wrapper
This commit is contained in:
2026-02-23 13:40:41 +03:00
parent eb89733715
commit 58e5f039be
6 changed files with 22 additions and 1 deletions
+3
View File
@@ -35,6 +35,8 @@ enum Commands {
enum Actions {
/// Ping the daemon
Ping,
/// Kill the daemon
Kill,
/// Pause audio playback
Pause {
#[clap(short, long)]
@@ -131,6 +133,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
let request = match cli.command {
Commands::Action { action } => match action {
Actions::Ping => Request::ping(),
Actions::Kill => Request::kill(),
Actions::Pause { id } => Request::pause(id),
Actions::Resume { id } => Request::resume(id),
Actions::TogglePause { id } => Request::toggle_pause(id),
+4
View File
@@ -111,6 +111,10 @@ async fn commands_loop(listener: UnixListener) -> Result<(), Box<dyn Error>> {
return;
}
// ---------- Send response (end) ----------
if response.status && response.message.eq("killed") {
std::process::exit(0);
}
});
}
}