Exit gracefully on SIGTERM

* Exit gracefully on `SIGTERM`

Save current state and close ncspot on `SIGTERM`

Fixes #948

* Disable signal handling on non-UNIX platforms
This commit is contained in:
Henrik Friedrichsen
2022-10-03 00:07:40 +02:00
committed by GitHub
parent 222b41c9cf
commit b1f1c20484
3 changed files with 21 additions and 0 deletions

View File

@@ -46,9 +46,13 @@ toml = "0.5"
unicode-width = "0.1.9"
url = "2.2"
cursive_buffered_backend = "0.6.1"
[target.'cfg(target_os = "linux")'.dependencies]
wl-clipboard-rs = {version = "0.7", optional = true}
[target.'cfg(unix)'.dependencies]
signal-hook = "0.3.0"
[dependencies.rspotify]
default-features = false
features = ["client-ureq", "ureq-rustls-tls"]