The SignagePlayer executable in my installation was located in /opt/SignagePlayer/bin/SignagePlayer
I replaced the actual executable with a script of mine which gets autostarted instead of the player.
I moved the actual executable of the player into a different file.
The script once started, starts the actual player (which is now called SignagePlayerApp) and then uses a linux program which is called "xdotool" that allows you to perform all kinds of different options on open windows using the shell.
the following retrieves the window id of the player window by its title, which is "Signage Player"
xdotool search --onlyvisible --name "Signage Player"
the id is stored in a variable, if the player was not yet launched (so the window did not exist when the "search" was run) the script waits 1 second and then tries again and again until it finally finds the window
then the following line is executed on the id of the window to give it focus and bring it in front of the gnome panel
xdotool windowactivate $windowId
the entire script can be found here:
#!/bin/bash
#This script belongs into the signage player install directory
#ie /opt/SignagePlayer/bin
#start the player
sudo /opt/SignagePlayer/bin/SignagePlayerApp &
#wait for the window to spawn
while : ; do
windowId=`xdotool search --onlyvisible --name "Signage Player"`
if [ -n "$windowId" ]
then
#once spawned give it focus and exit the script
xdotool windowactivate $windowId
break
else
#if it is not yet spawned wait 1 sec until checking again
sleep 1
fi
done
*) Check if your IP address is static. If not you should use a service like dyndns to find your home IP.
*) Install an alternative firmware on your router like DD-WRT.
*) Install the program wakeonlan and ssh on your router.
*) If your workstation is switched off you can now use ssh to open a shell on your router and run wakeonlan from there to boot the workstation.
*) For secure remote access to your workstation you can install ssh.
*) Choose an unused port on the router and forward it to the ssh-port on your workstation so you can access it from the outside.
*) ssh can also deal with graphical user interfaces but this is quite slow and needs quite a lot of bandwidth.
A better option is to install a VNC-server on the workstation and a VNC-client on the laptop. The connection can be tunneled through ssh so it is encrypted.
imagemagick is a linux command line tool with many options to manipulate image files.
It allows you to resize an image, change between image formats and also work with pdfs (converting pdfs to images and vice versa, split and merge pdfs etc.)
One of the tools that come with imagemagick is called identify, which produces an output like
Image: rose.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Class: DirectClass
Geometry: 70x46+0+0
Resolution: 72x72
Print size: 0.972222x0.638889
Units: PixelsPerInch
Type: TrueColor
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
red:
min: 37 (0.145098)
max: 255 (1)
mean: 145.58 (0.5709)
standard deviation: 67.3195 (0.263998)
....
The "Geometry" line: Geometry: 70x46+0+0 contains the width x height, in this case 70x46 pixels, if you want to get the width "70" and height "46" without messing around with regexp you can use awk to do this in the following way
res=`identify -verbose $f | grep Geometry | awk '{print $2}' | awk -F+ '{print $1}'`
width=`echo $res | awk -Fx '{print $1}'`
height=`echo $res | awk -Fx '{print $2}'`
you first get the geometry line from the identify output using grep, then split it along white spaces getting "70x46+0+0", further you split that up along the + getting "70x46"
you then extract the width doing the exact same thing but splitting along the x and then getting the first element (the width) and the second (the height)