So I've got an interesting challenge in front of me, running Ubuntu 16.04.
I originally created a .xsession file that ran Exec=google-chrome --kiosk http://some-url.com to boot as a kiosk device.
The above mentioned .xsession file exists in /usr/share/xsessions/, and is set to the default session in the lightdm config file found at /usr/share/lightdm/lightdm.d.conf/50-ubuntu.conf.
That worked just fine.
On to the new challenge:
I want to be able to remotely toggle whether or not the device boots in kiosk mode.
In an attempt to do this I have modified the Exec command to run a bash script that I've written to determine whether or not to boot as a kiosk.
The following script is executed from the .xsession file:
#! /bin/bash
KIOSK_MODE=$(curl http://some-url.com/bootInKioskMode/)
if [ $KIOSK_MODE = "true" ] ; then
google-chrome --kiosk http://some-url.com
else
gnome-session --session=ubuntu &
unity
fi
The idea is that because I can control what http://some-url.com/bootInKioskMode/ returns, I should be able to toggle what mode the device boots into
As it stands now, I have two problems that I need to solve.
My if/else statement is always matching false...so it is not booting into kiosk mode even if the curl response is
true.When it boots and runs the commands after the
elsestatement, it doesn't really match a default boot. The top menu bar is missing, as well as the icons and settings options on the top right of the screen.
Other things worth mentioning:
I do know that it is connected to the internet, and the curl request is firing off ok through testing (having it output and save to a file).
I have it setup to auto-login to a kiosk user that does not have sudo permissions, and have been running tests in these conditions.
Any help with this is appreciated. At this point I've spent hours googling and trying out different things and I've yet to have much luck.
Thanks.