diff --git a/src/spectrum.rs b/src/spectrum.rs index 44dcd11..49e4ee7 100644 --- a/src/spectrum.rs +++ b/src/spectrum.rs @@ -35,6 +35,12 @@ impl Service for Spectrum { fn listen() { let config = art::folder().join("cava.conf"); + /* + * a cava left by an earlier shell: stopping the shell doesn't stop its cava, + * which reads on from a closed pipe and ignores SIGTERM. none of ours runs yet + */ + let _ = Command::new("pkill").arg("-KILL").arg("-f").arg(&config).status(); + let _ = fs::write(&config, cava_config()); let mut running: Option = None;