diff options
-rw-r--r-- | debian/changelog | 3 | ||||
-rwxr-xr-x | impressive-display/bin/impressive-display | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog index 50c3021..1ff3763 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,9 @@ impressive-display (0.2.1) UNRELEASED; urgency=medium * Disable debugging option (set -x). * Use $HOME/.impressive-display as temporary data directory. * Check downloaded PDF for actually being a PDF file. + * Support existing impressive-display via exiting impressive (Q hotkey). + Furthermore, make sure to kill impressive only, if it its PID still + exists. -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Tue, 29 Mar 2016 20:14:17 +0200 diff --git a/impressive-display/bin/impressive-display b/impressive-display/bin/impressive-display index 4ba691d..c14b5f5 100755 --- a/impressive-display/bin/impressive-display +++ b/impressive-display/bin/impressive-display @@ -294,13 +294,17 @@ function reloadable_impressive { impressive ${IMPRESSIVE_OPTIONS} --fake-fullscreen --wrap -a ${SLIDE_DURATION} --nologo "${pdffile}" 1>/dev/null & impressive_pid=$! - echo -n $impressive_pid > "$impressive_lock" + echo -n "$impressive_pid" > "$impressive_lock" - while [ "$(cat $impressive_lock)" != "RELOAD" ] && [ -e "$session_lock" ]; do + while [ -r $impressive_lock ] && [ "$(cat $impressive_lock)" != "RELOAD" ] && [ -e "$session_lock" ]; do sleep 1 + if ! kill -0 "$impressive_pid"; then + rm "$session_lock" + break + fi done - kill $impressive_pid + kill -0 "$impressive_pid" && kill "$impressive_pid" done |