summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanielsLPecke <daniel.letsplay007@gmail.com>2016-11-11 14:55:41 +0100
committerDanielsLPecke <daniel.letsplay007@gmail.com>2016-11-11 14:55:41 +0100
commitacd1ecc8fe2f3a46f5a298252ddd03a33e37cd2d (patch)
tree27e3c6993c92472394d8fd84c4345c799e680dd6
parent09243a40034394cab05a587b666ea7276605506b (diff)
downloadimpressive-display-acd1ecc8fe2f3a46f5a298252ddd03a33e37cd2d.tar.gz
impressive-display-acd1ecc8fe2f3a46f5a298252ddd03a33e37cd2d.tar.bz2
impressive-display-acd1ecc8fe2f3a46f5a298252ddd03a33e37cd2d.zip
Rebase this. basic functon works
-rwxr-xr-xbin/impressive-display40
-rw-r--r--data/testpage1.pdfbin0 -> 12597 bytes
-rw-r--r--data/testpage2.pdfbin0 -> 11663 bytes
-rw-r--r--data/testpage3.pdfbin0 -> 13330 bytes
4 files changed, 26 insertions, 14 deletions
diff --git a/bin/impressive-display b/bin/impressive-display
index 033920a..e215ec8 100755
--- a/bin/impressive-display
+++ b/bin/impressive-display
@@ -36,7 +36,7 @@
VERSION="0.3.0"
# Can be configured at "/etc/default/impressive-display"
-DEFAULT_PDF_URI="http://www.cbu.edu.zm/downloads/pdf-sample.pdf"
+DEFAULT_PDF_URI="file:///home/daniel/Development/impressive-display.upstream/impressive-display/data/testpage1.pdf"
DEFAULT_RESOLUTION="1920x1080"
# Loggin credentials for websites..
DEFAULT_PDF_URL_CREDS=""
@@ -138,22 +138,34 @@ if [ -n "$FAKE_HOSTNAME" ]; then
THIS_HOSTNAME="$FAKE_HOSTNAME"
fi
-if echo ${DISPLAYS[$THIS_HOSTNAME]} | grep "pdf_uri="; then
- PDF_URI=`echo ${DISPLAYS[$THIS_HOSTNAME]} | sed -r -e 's/.*pdf_uri=([^|]*).*/\1/'`
-else
- PDF_URI="$DEFAULT_PDF_URI"
-fi
+echo "$THIS_HOSTNAME"
+echo "${!DISPLAYS[@]}"
+for display in "${!DISPLAYS[@]}"; do echo "$display - ${DISPLAYS[$display]}"; done
-if echo ${DISPLAYS[$THIS_HOSTNAME]} | grep "res="; then
- RESOLUTION=`echo ${DISPLAYS[$THIS_HOSTNAME]} | sed -r -e 's/.*res=([^|]*).*/\1/'`
-else
- RESOLUTION="$DEFAULT_RESOLUTION"
-fi
+if echo ${!DISPLAYS[@]} | grep -q "$THIS_HOSTNAME"; then
+ $OUTPUT "INFO: $THIS_HOSTNAME has extra properties. loading it.."
+
+ if echo ${DISPLAYS[$THIS_HOSTNAME]} | grep "pdf_uri="; then
+ PDF_URI=`echo ${DISPLAYS[$THIS_HOSTNAME]} | sed -r -e 's/.*pdf_uri=([^|]*).*/\1/'`
+ else
+ PDF_URI="$DEFAULT_PDF_URI"
+ fi
+
+ if echo ${DISPLAYS[$THIS_HOSTNAME]} | grep "res="; then
+ RESOLUTION=`echo ${DISPLAYS[$THIS_HOSTNAME]} | sed -r -e 's/.*res=([^|]*).*/\1/'`
+ else
+ RESOLUTION="$DEFAULT_RESOLUTION"
+ fi
-if echo ${DISPLAYS[$THIS_HOSTNAME]} | grep "creds="; then
- PDF_URL_CREDS=`echo ${DISPLAYS[$THIS_HOSTNAME]} | sed -r -e 's/.*creds=([^|]*).*/\1/'`
+ if echo ${DISPLAYS[$THIS_HOSTNAME]} | grep "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_URL_CREDS="$DEFAULT_PDF_URL_CREDS"
+ PDF_URI="$DEFAULT_PDF_URI"
+ PDF_URL_CREDS="$DEFAULT_PDF_URL_CREDS"
+ RESOLUTION="$DEFAULT_RESOLUTION"
fi
if [ -n "${RESOLUTION}" ]; then
diff --git a/data/testpage1.pdf b/data/testpage1.pdf
new file mode 100644
index 0000000..151874c
--- /dev/null
+++ b/data/testpage1.pdf
Binary files differ
diff --git a/data/testpage2.pdf b/data/testpage2.pdf
new file mode 100644
index 0000000..659c24f
--- /dev/null
+++ b/data/testpage2.pdf
Binary files differ
diff --git a/data/testpage3.pdf b/data/testpage3.pdf
new file mode 100644
index 0000000..b8550cb
--- /dev/null
+++ b/data/testpage3.pdf
Binary files differ