Installed Files

This page contains a detailed description of the files installed by ansible-digital-signage.

chrome-firstrun-workaround.sh

This is a shell script installed to /opt/ansible-digital-signage/chrome-firstrun-workaround.sh. The script is run as the specified signage_user during the initial run of the ansible role. It uses a bunch of xdotool commmands to dismiss Chrome’s firstrun dialog.

detect-primary-display.py

This is a python script which parses the output of xrandr to determine the currently connected display output, then writes that to a file. It takes one argument, which should be the path to said file.

This script is executed by xinitrc.

Tip

This script currently does not support having multiple outputs connected. In such a case, the output listed first alphabetically will be written to the specified file.

Warning

Currently, this script will write an empty file if no connected output is found. This could happen if X11 is started before certain DisplayPort and HDMI monitors are turned on. In such a case, signage-chrome would fail. This will be fixed in a future version. This can be worked around by rebooting the computer after a display is connected.

schedule

The schedule file is written by a jinja2 template to /var/ansible-digital-signage/schedule. The template iterates over signage_schedule and writes lines formatted as:

Mon,Tue,Wed,Thu,Fri,Sat,Sun|08:00|17:00|example.com
days|start-time|end-time|example.com

Note

This will likely be replaced with JSON in a future version.

signage-placeholder

This is a placeholder HTML file which will be loaded by signage-chrome if signage-refresh’s last run found nothing in the schedule. This should only happen on first run, or if signage-chrome is started manually.

signage-refresh.py

signage-refresh.py is a python script which:

  1. Reads the schedule file populated by Ansible using signage_schedule

  2. When it finds a schedule entry which is active on the current day and at the current time, it:
    1. Writes the url parameter of that entry to /var/ansible-digital-signage/current

    2. Uses subprocess.call() to restart signage-chrome using systemctl

  3. If there is no entry which is determined to be currently active, the script:
    1. Writes the path to the signage_placeholder file to /var/ansible-digital-signage/current

    2. Uses subprocess.call() to stop signage-chrome using systemctl

    3. Uses subprocess.call() to run signage-display-off using systemctl

To assist in this, the script also includes an incredibly simplistic strptime function which only works for 24-hour time with no seconds.

xinitrc

ansible-digital-signage writes a .xinitrc file to signage_user’s home directory. This is so that X11 (as started by signage-startx) will run detect-primary-display.py and xeyes rather than just starting xeyes.