exit on rx of SocketNotFound err

This commit is contained in:
Alex Janka 2024-08-02 16:05:44 +10:00
parent 3e1c4df585
commit 5f69b9e105
4 changed files with 7 additions and 3 deletions

2
Cargo.lock generated
View file

@ -789,7 +789,7 @@ dependencies = [
[[package]] [[package]]
name = "sway-flash-indicator" name = "sway-flash-indicator"
version = "0.4.1" version = "0.4.2"
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.4.1" version = "0.4.2"
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.4.1 pkgver=0.4.2
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

@ -45,6 +45,10 @@ async fn main() -> Res<()> {
let mut recent_code = None; let mut recent_code = None;
while let Some(event) = events.next().await { while let Some(event) = events.next().await {
if let Err(swayipc_async::Error::SocketNotFound) = event {
break;
}
if let Ok(event) = event { if let Ok(event) = event {
match event { match event {
swayipc_async::Event::Binding(swayipc_async::BindingEvent { binding, .. }) => { swayipc_async::Event::Binding(swayipc_async::BindingEvent { binding, .. }) => {