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]]
name = "sway-flash-indicator"
version = "0.3.0"
version = "0.3.1"
dependencies = [
"directories",
"futures-util",

View file

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

View file

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

View file

@ -39,6 +39,7 @@ async fn main() -> Res<()> {
.subscribe([
swayipc_async::EventType::Binding,
swayipc_async::EventType::Window,
swayipc_async::EventType::Shutdown,
])
.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
.run_command(format!("swap container with con_id {}", other.id))
.await?;
// tokio::time::sleep(std::time::Duration::from_millis(50)).await;
}
connection