From 2829688fe3a48dfd98dc6c6e8df461f9111da4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=BB?= Date: Mon, 4 Mar 2019 18:49:53 +0000 Subject: [PATCH] Kill sxiv on script exit --- kunst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kunst b/kunst index b88b6d7..e584b88 100755 --- a/kunst +++ b/kunst @@ -148,6 +148,9 @@ update_cover() { } +pre_exit() { + kill -9 $(cat /tmp/kunst.pid) +} main() { @@ -176,6 +179,7 @@ main() { # display the album art using sxiv sxiv -g $SIZE -b $COVER -N "Kunst" & + echo $! >/tmp/kunst.pid fi # waiting for an event from mpd; play/pause/next/previous @@ -185,5 +189,5 @@ main() { done } - +trap pre_exit EXIT main