exit on sway shutdown

This commit is contained in:
Alex Janka 2024-07-30 16:00:51 +10:00
parent 761405e7ce
commit 488f2fb99d
4 changed files with 8 additions and 3 deletions

2
Cargo.lock generated
View file

@ -653,7 +653,7 @@ dependencies = [
[[package]] [[package]]
name = "sway-flash-indicator" name = "sway-flash-indicator"
version = "0.3.0" version = "0.3.1"
dependencies = [ dependencies = [
"directories", "directories",
"futures-util", "futures-util",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "sway-flash-indicator" name = "sway-flash-indicator"
version = "0.3.0" version = "0.3.1"
edition = "2021" edition = "2021"
[dependencies] [dependencies]

View file

@ -1,7 +1,7 @@
# Maintainer: Alex Janka <alex@alexjanka.com> # Maintainer: Alex Janka <alex@alexjanka.com>
pkgname=sway-flash-indicator pkgname=sway-flash-indicator
pkgver=0.3.0 pkgver=0.3.1
pkgrel=1 pkgrel=1
pkgdesc="flashes sway indicator border rather than always showing it" pkgdesc="flashes sway indicator border rather than always showing it"
arch=('x86_64' 'aarch64') arch=('x86_64' 'aarch64')

View file

@ -39,6 +39,7 @@ async fn main() -> Res<()> {
.subscribe([ .subscribe([
swayipc_async::EventType::Binding, swayipc_async::EventType::Binding,
swayipc_async::EventType::Window, swayipc_async::EventType::Window,
swayipc_async::EventType::Shutdown,
]) ])
.await?; .await?;
@ -111,6 +112,9 @@ async fn main() -> Res<()> {
} }
} }
} }
swayipc_async::Event::Shutdown(_) => {
return Ok(());
}
_ => {} _ => {}
} }
} }
@ -163,6 +167,7 @@ async fn code_trigger<T: AsRef<str> + std::cmp::PartialEq<str>>(
connection connection
.run_command(format!("swap container with con_id {}", other.id)) .run_command(format!("swap container with con_id {}", other.id))
.await?; .await?;
// tokio::time::sleep(std::time::Duration::from_millis(50)).await;
} }
connection connection