From edb31dd0a5f7d3c2daba3c8a327a6aa91d9884a1 Mon Sep 17 00:00:00 2001 From: DanielsLPecke Date: Wed, 16 Nov 2016 13:47:23 +0100 Subject: Change Output message. Remove unnecessary 'xrandr's --- bin/impressive-display | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bin/impressive-display b/bin/impressive-display index 799da03..9bd3641 100755 --- a/bin/impressive-display +++ b/bin/impressive-display @@ -173,10 +173,8 @@ else fi if [ -n "${RESOLUTION}" ]; then - if type -p xrandr xrandr 1>/dev/null; then - currentDisplay=`echo "$(xrandr)" | grep -w 'connected' | sed -r -e 's/connected.*//' | head -n 1` - xrandr -d :0 --output "$(echo $currentDisplay)" --mode $RESOLUTION - trap "cleanup" SIGINT SIGTERM ERR EXIT + if type -p xrandr 1>/dev/null; then + xrandr -d :0 --output "$(echo $currentOutput)" --mode $RESOLUTION fi fi @@ -198,9 +196,9 @@ sleep_hours_start=`echo $SLEEP_HOURS | grep -E '^[0-9]{2}-[0-9]{2}$' | sed -n - sleep_hours_end=`echo $SLEEP_HOURS | grep -E '^[0-9]{2}-[0-9]{2}$' | sed -n -r -e 's/^([0-9]{2})-([0-9]{2})$/\2/p'` function cleanup { - if type -p xrandr xrandr 1>/dev/null; then - $OUTPUT "Info: resetting resolution to $currentResolution" - xrandr -d :0 --output "$(echo $currentDisplay)" --auto + if type -p xrandr 1>/dev/null; then + $OUTPUT "Info: resetting resolution" + xrandr -d :0 --output "$(echo $currentOutput)" --auto fi if [ -r "$impressive_lock" ]; then -- cgit v1.2.3