diff options
author | DanielsLPecke <daniel.letsplay007@gmail.com> | 2016-11-16 13:44:43 +0100 |
---|---|---|
committer | DanielsLPecke <daniel.letsplay007@gmail.com> | 2016-11-16 13:44:43 +0100 |
commit | 22f9ab3a52c3427cda93f8ea291d2c49723c102d (patch) | |
tree | caf1e8555f9cc398ad4f8235e2ea00a5a1f41d0c | |
parent | f20e48c671934323a354bbde9377155e1955cf1d (diff) | |
download | impressive-display-22f9ab3a52c3427cda93f8ea291d2c49723c102d.tar.gz impressive-display-22f9ab3a52c3427cda93f8ea291d2c49723c102d.tar.bz2 impressive-display-22f9ab3a52c3427cda93f8ea291d2c49723c102d.zip |
Change 'currentDisplay' to 'currentOutput'. Move the trap and 'currentOutput'-setter to the top
-rwxr-xr-x | bin/impressive-display | 7 |
1 files changed, 7 insertions, 0 deletions
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 |