From 22f9ab3a52c3427cda93f8ea291d2c49723c102d Mon Sep 17 00:00:00 2001 From: DanielsLPecke Date: Wed, 16 Nov 2016 13:44:43 +0100 Subject: Change 'currentDisplay' to 'currentOutput'. Move the trap and 'currentOutput'-setter to the top --- bin/impressive-display | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/impressive-display b/bin/impressive-display index 62284c8..799da03 100755 --- a/bin/impressive-display +++ b/bin/impressive-display @@ -78,6 +78,13 @@ IMPRESSIVE_OPTIONS="--transition None" # write some debugging output to stdout when downloading a remote PDF DEBUG_DOWNLOADS="" + +trap "cleanup" SIGINT SIGTERM ERR EXIT + +if type -p xrandr 1>/dev/null; then + currentOutput=`echo "$(xrandr)" | grep -w 'connected' | sed -r -e 's/connected.*//' | head -n 1` +fi + # if files exists: source it to this file (The script will overide variables) if [ -r $HOME/.impressive-display-secrets ] && [ ! -d $HOME/.impressive-display-secrets ]; then . $HOME/.impressive-display-secrets -- cgit v1.2.3