diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-03-24 21:00:28 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-03-24 21:00:28 +0100 |
commit | 389b06e208cdb4fe5f16ef44fe6e95f11af21522 (patch) | |
tree | af4eb6cec7ae163c75a8481963e18382f6531ec9 | |
download | impressive-display-389b06e208cdb4fe5f16ef44fe6e95f11af21522.tar.gz impressive-display-389b06e208cdb4fe5f16ef44fe6e95f11af21522.tar.bz2 impressive-display-389b06e208cdb4fe5f16ef44fe6e95f11af21522.zip |
initial draft
-rw-r--r-- | VERSION | 1 | ||||
-rw-r--r-- | debian/changelog | 5 | ||||
-rw-r--r-- | debian/compat | 1 | ||||
-rw-r--r-- | debian/control | 48 | ||||
-rw-r--r-- | debian/copyright | 35 | ||||
-rw-r--r-- | debian/impressive-display.default | 39 | ||||
-rw-r--r-- | debian/impressive-display.dirs | 2 | ||||
-rw-r--r-- | debian/impressive-display.examples | 1 | ||||
-rw-r--r-- | debian/impressive-display.install | 2 | ||||
-rw-r--r-- | debian/impressive-display.manpages | 1 | ||||
-rwxr-xr-x | debian/impressive-display.postinst | 42 | ||||
-rwxr-xr-x | debian/impressive-display.prerm | 44 | ||||
-rwxr-xr-x | debian/rules | 3 | ||||
-rw-r--r-- | debian/source/format | 1 | ||||
-rw-r--r-- | demo.pdf | bin | 0 -> 1681197 bytes | |||
-rwxr-xr-x | impressive-display/bin/impressive-display | 245 | ||||
-rw-r--r-- | impressive-display/man/impressive-display.1 | 28 | ||||
-rw-r--r-- | impressive-display/share/xsessions/impressive-display.desktop | 8 |
18 files changed, 506 insertions, 0 deletions
@@ -0,0 +1 @@ +0.2.0 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..2981711 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +impressive-display (0.2.0) UNRELEASED; urgency=medium + + * Initial release. + + -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Thu, 24 Mar 2016 18:51:08 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..cced056 --- /dev/null +++ b/debian/control @@ -0,0 +1,48 @@ +Source: impressive-display +Section: admin +Priority: extra +Maintainer: Debian Edu Packaging Team <debian-edu-pkg-team@lists.alioth.debian.org> +Uploaders: + Mike Gabriel <sunweaver@debian.org> +Build-Depends: + debhelper (>= 9), + cdbs, +Standards-Version: 3.9.7 +Homepage: http://wiki.it-zukunft-schule.de +Vcs-Git: https://code.it-zukunft-schule.de/cgit/impressive-display.git +Vcs-Browser: https://code.it-zukunft-schule.de/cgit/impressive-display/ + +Package: impressive-display +Architecture: all +Depends: + ${misc:Depends}, + ${perl:Depends}, + psmisc, + impressive, + matchbox-window-manager, + xinit, + locales, + nodm, + pulseaudio-utils, +Recommends: + pulseaudio, + unclutter, + x11-xserver-utils, +Suggests: + vim, + mc, + acpid, + memtest86, + memtest86+, + openssh-server, + plymouth, + plymouth-themes-all, +Description: Impressive based PDF display + Provide an X11 session manager script that launches a minimal window + manager and than launches the impressive PDF viewer in fullscreen. + . + In combination with the nodm display manager you can provide an + easy-to-setup display screen based on regulary updated PDF files. + . + The viewed PDF file can be obtained from a given URL in regular + intervals. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..f8dd703 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,35 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Impressive PDF Display +Upstream-Contact: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +Source: https://code.it-zukunft-schule.de/cgit/impressive-display/ + +Files: impressive-display/* + VERSION +Copyright: 2016, Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +License: GPL-2+ + +Files: debian/* +Copyright: 2016, Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +License: GPL-2+ + +License: GPL-2+ + This program is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later + version. + . + This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more + details. + . + You should have received a copy of the GNU General Public + License along with this package; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301 USA + . + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file + `/usr/share/common-licenses/GPL-2'. diff --git a/debian/impressive-display.default b/debian/impressive-display.default new file mode 100644 index 0000000..5114565 --- /dev/null +++ b/debian/impressive-display.default @@ -0,0 +1,39 @@ +# Impressive PDF Display: Wrap around impressive PDF viewer and turn your +# system into a PDF display screen. + +# There can be master terminals and slave terminals. +# All terminal not listed here are slave terminals... +MASTER_DISPLAYS="$(hostname -f)" + +# Login credentials for PDF download URLs +# Credentials can be put here, but we recommend putting them +# into $HOME/.impressive-display-secrets. +#PDF_URL_MASTERS_CREDS="<username>:<password>" +#PDF_URL_SLAVES_CREDS="<username>:<password>" + +# these PDF displays can have different download URLs +#PDF_URL_MASTERS="https://web.server.com/path/to/pdffile.pdf" +#PDF_URL_SLAVES="https://web.server.com/path/to/otherpdf.pdf" + +# HTTP proxy URL, if needed +#HTTP_PROXY_URL="http://webcache:3128" + +# or different static PDF documents (downloadable PDFs get preferred by +# the impressive-display script...) +PDF_FILE_MASTERS="/usr/share/doc/impressive-display/examples/demo.pdf.gz" +PDF_FILE_SLAVES="/usr/share/doc/impressive-display/examples/demo.pdf.gz" + +# launch pulseaudio daemon if not already running +WITH_PULSEAUDIO="yes" + +# hide idle mouse pointer +HIDE_IDLE_POINTER="yes" + +# enforce fixed resolution for displays +# MASTER_RESOLUTION="1920x1080" +# SLAVE_RESOLUTION="1920x1080" +MASTER_RESOLUTION= +SLAVE_RESOLUTION= + +# screensaver settings, see "man 1 xset" for possible options +SCREENSAVER_SETTINGS="" diff --git a/debian/impressive-display.dirs b/debian/impressive-display.dirs new file mode 100644 index 0000000..235b398 --- /dev/null +++ b/debian/impressive-display.dirs @@ -0,0 +1,2 @@ +usr/bin/ +etc/impressive-display diff --git a/debian/impressive-display.examples b/debian/impressive-display.examples new file mode 100644 index 0000000..ad56d04 --- /dev/null +++ b/debian/impressive-display.examples @@ -0,0 +1 @@ +demo.pdf
\ No newline at end of file diff --git a/debian/impressive-display.install b/debian/impressive-display.install new file mode 100644 index 0000000..b6d1389 --- /dev/null +++ b/debian/impressive-display.install @@ -0,0 +1,2 @@ +impressive-display/bin/impressive-display usr/bin/ +impressive-display/share/* usr/share/ diff --git a/debian/impressive-display.manpages b/debian/impressive-display.manpages new file mode 100644 index 0000000..d7f37b0 --- /dev/null +++ b/debian/impressive-display.manpages @@ -0,0 +1 @@ +impressive-display/man/impressive-display.1
\ No newline at end of file diff --git a/debian/impressive-display.postinst b/debian/impressive-display.postinst new file mode 100755 index 0000000..18ec1d9 --- /dev/null +++ b/debian/impressive-display.postinst @@ -0,0 +1,42 @@ +#!/bin/sh +# postinst script for impressive-display +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <postinst> `abort-remove' +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + update-alternatives --install /usr/bin/x-session-manager \ + x-session-manager /usr/bin/impressive-display 20 \ + --slave /usr/share/man/man1/x-session-manager.1.gz \ + x-session-manager.1.gz /usr/share/man/man1/impressive-display.1.gz + + ;; + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/impressive-display.prerm b/debian/impressive-display.prerm new file mode 100755 index 0000000..c1cb9f6 --- /dev/null +++ b/debian/impressive-display.prerm @@ -0,0 +1,44 @@ +#! /bin/sh + +# prerm script for impressive-display +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <prerm> `remove' +# * <old-prerm> `upgrade' <new-version> +# * <new-prerm> `failed-upgrade' <old-version> +# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> +# * <deconfigured's-prerm> `deconfigure' `in-favour' +# <package-being-installed> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +if [ "$1" = "remove" -o "$1" = "deconfigure" ]; then + + update-alternatives --remove x-session-manager /usr/bin/impressive-display + +fi + + +case "$1" in + remove) + : + ;; + deconfigure|upgrade|failed-upgrade) + : + ;; + *) echo "$0: didn't understand being called with \`$1'" 1>&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..e6192f6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,3 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..9f8e9b6 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +1.0
\ No newline at end of file diff --git a/demo.pdf b/demo.pdf Binary files differnew file mode 100644 index 0000000..bbd0d06 --- /dev/null +++ b/demo.pdf diff --git a/impressive-display/bin/impressive-display b/impressive-display/bin/impressive-display new file mode 100755 index 0000000..196dd0b --- /dev/null +++ b/impressive-display/bin/impressive-display @@ -0,0 +1,245 @@ +#!/bin/bash + +set -x + +# Copyright (C) 2012-2016 by Debian Edu project, http://wiki.debian.org/DebianEdu +# Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +# Impressive PDF Display is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Impressive PDF Display is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +# dependencies: +# wmctrl +# matchbox-window-manager +# pulseaudio-utils +# +# recommendations: +# unclutter +# pulseaudio +# x11-xserver-utils +# texlive-extra-utils (for pdfnup) +# poppler-utils (for pdfinfo) + +PDF_URL="http://localhost" + +WITH_PULSEAUDIO="yes" +HIDE_IDLE_POINTER="yes" + +# There can be master terminals and slave display. +# All terminal not listed here are slave displays... +MASTER_DISPLAYS="$(hostname -f)" + +# these terminals can have different startup URLs +PDF_URL_MASTERS="" +PDF_URL_SLAVES="" +PDF_URL_MASTERS_CREDS="" +PDF_URL_SLAVES_CREDS="" + + +PDF_FILE_MASTERS="" +PDF_FILE_SLAVES="" + +# enforce fixed resolution for displays +# MASTER_RESOLUTION="1920x1080" +# SLAVE_RESOLUTION="1920x1080" +MASTER_RESOLUTION= +SLAVE_RESOLUTION= + +# launch pulseaudio daemon if not already running +WITH_PULSEAUDIO="yes" + +# hide idle mouse pointer +HIDE_IDLE_POINTER="yes" + +# default screensaver settings +SCREENSAVER_SETTINGS="" + +# don't use an HTTP proxy by default +HTTP_PROXY_URL="" + +# interval of PDF continuous downloads +DOWNLOAD_INTERVAL="600" + +if [ -r $HOME/.impressive-display-secrets ]; then + . $HOME/.impressive-display-secrets +fi + +if [ -r /etc/default/impressive-display ]; then + . /etc/default/impressive-display +fi + +if [ -r $HOME/.impressive-display ]; then + . $HOME/.impressive-display +fi + +# provide pulseaudio support in the browser session, if not +# already available... +#if ! pacmd stat 1>/dev/null 2>/dev/null; then +if ! pacmd stat; then + if [ "x$WITH_PULSEAUDIO" = "xyes" ]; then + if which pulseaudio 1>/dev/null; then + pulseaudio -D -n \ + -L 'module-udev-detect' \ + --exit-idle-time=65535 + fi + fi +fi + +# launch matchbox manager +if ! wmctrl -m 1>/dev/null 2>/dev/null; then + if which matchbox-window-manager 1>/dev/null; then + matchbox-window-manager & + fi +fi + +# use unclutter to hide idle mouse pointers +if [ "x$HIDE_IDLE_POINTER" = "xyes" ]; then + if which unclutter 1>/dev/null; then + unclutter & + fi +fi + +PDF_URL="$PDF_URL_SLAVES" +PDF_URL_CREDS="$PDF_URL_SLAVES_CREDS" +PDF_FILE="$PDF_FILE_SLAVES" +RESOLUTION="$SLAVE_RESOLUTION" + +for master_terminal in $MASTER_TERMINALS; do + if [ "x$(hostname -f)" = "x$master_terminal" ]; then + PDF_URL="$PDF_URL_MASTERS" + PDF_URL_CREDS="$PDF_URL_MASTERS_CREDS" + PDF_FILE="$PDF_FILE_MASTERS" + RESOLUTION="$MASTER_RESOLUTION" + break + fi +done + +if [ -n "${RESOLUTION}" ]; then + if which xrandr 1>/dev/null; then + xrandr -d :0 --output default --mode ${RESOLUTION} + fi +fi + +# Set screensaver settings +if which xset 1>/dev/null; then + xset s ${SCREENSAVER_SETTINGS} +fi + +# set some proxy related env variables, if requested... +if [ -n "$HTTP_PROXY_URL" ]; then + export http_proxy="$HTTP_PROXY_URL" + export https_proxy="$HTTP_PROXY_URL" + export ftp_proxy="$HTTP_PROXY_URL" +fi + +WORKDIR="$HOME/.impressive-display-data" +LOOPFILE="$WORKDIR/PDFFILE_DOWNLOAD_LOOP_ACTIVE" +mkdir -p "$WORKDIR" + +function stop_pdfdownload_loop { + rm -f ~/PDFDOWNLOAD_LOOP +} + +function pdf_is_portrait { + + check_pdffile=$1 + if [ -n "$check_pdffile" ]; then + + declare -i num_of_landscape_pages=0 + + pdfinfo \ + -f 1 \ + -l 1000 \ + ${check_pdffile} \ + | grep "Page.* size:" \ + | while read Page _pageno size _width x _height rest; do + if [ "$(echo "${_width} / 1"|bc)" -gt "$(echo "${_height} / 1"|bc)" ]; then + let num_of_landscape_pages=num_of_landscape_pages+1 # Page is landscape... + fi + done + return $num_of_landscape_pages + else + # something went wrong with the provided file name... + return -1 + fi +} + + +function download_pdffile { + if [ -n "$PDF_URL_CREDS" ]; then + creds="-u $PDF_URL_CREDS" + fi + curl $creds "$PDF_URL" 1> impressive-pdffile.pdf 2>/dev/null + + if which pdfnup 1>/dev/null && pdf_is_portrait impressive-pdffile.pdf; then + pdfnup impressive-pdffile.pdf 1>/dev/null 2>/dev/null + mv impressive-pdffile-nup.pdf impressive-pdffile-display.pdf + fi +} + +# do an initial PDF retrieval.. +if [ -n "$PDF_URL" ]; then + + cd $WORKDIR + download_pdffile + + trap "stop_pdfdownload_loop" SIGINT SIGTERM ERR + + if [ "x$DOWNLOAD_INTERVAL" != "x0" ]; then + touch $LOOPFILE + ( + while true; do + if [ ! -e $LOOPFILE ]; then + break + else + sleep $DOWNLOAD_INTERVAL + fi + download_pdffile + done + ) & + + fi + + pdffile=$WORKDIR/impressive-pdffile-display.pdf + +elif [ -n "$PDF_FILE" ]; then + + # FIXME: provide options for displaying a single / local PDF file + cp $PDF_FILE $WORKDIR/$(basename $PDF_FILE) + + # is the PDF file gzipped? + if echo $(basename $PDF_FILE) | grep -E ".*\.gz"; then + PDF_FILE=${PDF_FILE/.gz/} + gunzip $WORKDIR/$(basename $PDF_FILE).gz + fi + mv $WORKDIR/$(basename $PDF_FILE) "$WORKDIR/impressive-pdffile-display.pdf" + + pdffile="$WORKDIR/impressive-pdffile-display.pdf" + +fi + +if [ -n "$pdffile" ]; then + + fade_options="--transition None" + + # on GL systems add: --supersample -k + if which impressive 1>/dev/null; then + impressive ${fade_options} --fake-fullscreen --wrap --poll 30 -a 5 --nologo "${pdffile}" 1>/dev/null + fi + stop_pdfdownload_loop + +fi + +exit 0 diff --git a/impressive-display/man/impressive-display.1 b/impressive-display/man/impressive-display.1 new file mode 100644 index 0000000..529a08f --- /dev/null +++ b/impressive-display/man/impressive-display.1 @@ -0,0 +1,28 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH impressive-display 1 "24 Mar 2016" "Version 0.0.2.x" "Impressive PDF Display" +.SH NAME +impressive-display \- Fullscreen PDF Display Session Manager +.SH SYNOPSIS +'nh +.fi +.ad l +\fBimpressive-display\fR + +.SH DESCRIPTION +\fBimpressive-display\fR is a wrapper around impressive. It can turn a system into a PDF based display terminal. +.PP +.SH OPTIONS +\fBimpressive-display\fR passes all given options to impressive. If no options are given, options +are taken from /etc/default/impressive-display. +.PP +.SH SEE ALSO +/etc/default/impressive-display +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the Debian Edu +project (http://wiki.debian.org/DebianEdu). diff --git a/impressive-display/share/xsessions/impressive-display.desktop b/impressive-display/share/xsessions/impressive-display.desktop new file mode 100644 index 0000000..f036faa --- /dev/null +++ b/impressive-display/share/xsessions/impressive-display.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Impressive PDF Display +Comment=Fullscreen PDF presentation +Exec=impressive-display +TryExec=impressive-display +Icon=impressive +Type=Application +Keywords=PDF;fullscreen;display; |