diff options
-rwxr-xr-x | bin/impressive-display | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/impressive-display b/bin/impressive-display index 7db3d11..74921bd 100755 --- a/bin/impressive-display +++ b/bin/impressive-display @@ -166,8 +166,10 @@ else fi if [ -n "${RESOLUTION}" ]; then - if which xrandr 1>/dev/null; then - xrandr -d :0 --output default --mode ${RESOLUTION} + 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 fi fi @@ -430,8 +432,6 @@ function reloadable_impressive { function create_lock { - trap "cleanup" SIGINT SIGTERM ERR - touch "$session_lock" } |