diff options
-rwxr-xr-x | bin/impressive-display | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/bin/impressive-display b/bin/impressive-display index 9bd3641..e6b95a4 100755 --- a/bin/impressive-display +++ b/bin/impressive-display @@ -35,11 +35,15 @@ VERSION="0.2.990" + +# default credentials. +DEFAULT_PDF_URL_CREDS="" +# all credentials +declare -A CREDS + # Can be configured at "/etc/default/impressive-display" DEFAULT_PDF_URI="/usr/share/doc/impressive-display/examples/testpage1.pdf" DEFAULT_RESOLUTION="1920x1080" -# Loggin credentials for websites.. -DEFAULT_PDF_URL_CREDS="" # all displays that need to be changed declare -A DISPLAYS @@ -160,18 +164,19 @@ if `echo ${!DISPLAYS[@]} | grep -q "$THIS_HOSTNAME"`; then else RESOLUTION="$DEFAULT_RESOLUTION" fi - - if echo ${DISPLAYS[$THIS_HOSTNAME]} | grep -q "creds="; then - PDF_URL_CREDS=`echo ${DISPLAYS[$THIS_HOSTNAME]} | sed -r -e 's/.*creds=([^|]*).*/\1/'` - else - PDF_URL_CREDS="$DEFAULT_PDF_URL_CREDS" - fi else PDF_URI="$DEFAULT_PDF_URI" - PDF_URL_CREDS="$DEFAULT_PDF_URL_CREDS" RESOLUTION="$DEFAULT_RESOLUTION" fi +set -x +if echo ${!CREDS[@]} | grep -q "$THIS_HOSTNAME"; then + PDF_URL_CREDS=`echo ${CREDS[$THIS_HOSTNAME]} | sed -r -e 's/.*creds=([^|]*).*/\1/'` +else + PDF_URL_CREDS="$DEFAULT_PDF_URL_CREDS" +fi +set +x + if [ -n "${RESOLUTION}" ]; then if type -p xrandr 1>/dev/null; then xrandr -d :0 --output "$(echo $currentOutput)" --mode $RESOLUTION |