Adjustments to support workstation mode
This commit is contained in:
3
distfiles/etc/apt/preferences.d/nosnap.pref
Normal file
3
distfiles/etc/apt/preferences.d/nosnap.pref
Normal file
@@ -0,0 +1,3 @@
|
||||
Package: snapd
|
||||
Pin: release a=*
|
||||
Pin-Priority: -10
|
||||
1
distfiles/etc/needrestart/conf.d/no-prompt.conf
Normal file
1
distfiles/etc/needrestart/conf.d/no-prompt.conf
Normal file
@@ -0,0 +1 @@
|
||||
$nrconf{restart} = 'a';
|
||||
42
distfiles/etc/openkiosk/openkiosk.conf
Normal file
42
distfiles/etc/openkiosk/openkiosk.conf
Normal file
@@ -0,0 +1,42 @@
|
||||
# openkiosk.conf
|
||||
#
|
||||
# Configuration file for OpenKiosk
|
||||
|
||||
# Debug flag. Set to 1 to cause openkiosk to output helpful
|
||||
# information to ~/openkiosk.log.
|
||||
# Set to 0 for production use, or the log could fill up your filesystem!
|
||||
DEBUG="0"
|
||||
|
||||
# URL to load for the kiosk browser.
|
||||
# This can be a website, specified like:
|
||||
# http://somesite.com/somepage
|
||||
# or a local file, specified like:
|
||||
# file:/home/kioskuser/somefile.pdf
|
||||
# If the URL ends with ".pdf", it will be opened using xpdf, otherwise
|
||||
# it will be assumed to be of some format that can be displayed by a
|
||||
# web browser.
|
||||
# You can also use the word "test" which will cause OpenKiosk to
|
||||
# start an xterm, which is useful for development and testing.
|
||||
TGT_URL="test"
|
||||
|
||||
# Interval in seconds to poll the URL for changes.
|
||||
# This should be enabled where the kiosk is used as a display for a file
|
||||
# fetched from a URL. Do not use for an interactive kiosk.
|
||||
# Set to 0 to disable polling or for an interactive kiosk.
|
||||
POLL_INTERVAL="0"
|
||||
|
||||
# Display blanking is controlled by DPMS. For a display-only kiosk,
|
||||
# set INHIBIT_BLANK to "1" to prevent screen blanking, ignoring the
|
||||
# DSP parameters. If INHIBIT_BLANK is set to "0", the DSP parameters
|
||||
# control the number of seconds for standby, suspend, and off modes.
|
||||
# If you find that your display is going to sleep and not waking up, try
|
||||
# setting the OFF and/or SUSP parameters to 0 which will disable them.
|
||||
INHIBIT_BLANK="0"
|
||||
DSP_STBY_SEC="600"
|
||||
DSP_SUSP_SEC="1200"
|
||||
DSP_OFF_SEC="1800"
|
||||
|
||||
# Display rotation. Can be used to control the orientation of the display.
|
||||
# Values are one of "normal", "left", "right", or "inverted".
|
||||
ROTATION="normal"
|
||||
|
||||
65
distfiles/etc/openkiosk/openkiosk_welcome.html
Normal file
65
distfiles/etc/openkiosk/openkiosk_welcome.html
Normal file
@@ -0,0 +1,65 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv=\"x-ua-compatible\" content=\"IE=edge\">
|
||||
<title>OpenKiosk</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 align="center">
|
||||
OpenKiosk
|
||||
</h3><br>
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td align="center">Current version is <b>1.1.0</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<p>
|
||||
<b>Welcome</b><br>
|
||||
Welcome to OpenKiosk. You are seeing this page because you have accepted the default URL during installation.
|
||||
Obviously this is not very useful. To make it more useful, you'll need to edit the /etc/openkiosk/openkiosk.conf
|
||||
file (if this is a standalone kiosk) or ~/.config/openkiosk/openkiosk.conf (if this is a workstation kiosk)
|
||||
and adjust things for your needs.
|
||||
</p>
|
||||
<p>
|
||||
<b>Configuration</b><br>
|
||||
To edit this file, you'll either need to ssh into the kiosk machine or use
|
||||
webmin. If you elected to install webmin during OpenKiosk installation, you can
|
||||
<a href="https://localhost:10000"> click here </a> to access it, then use the
|
||||
File Manager tool to navigate to /etc/openkiosk and edit the openkiosk.conf file.
|
||||
The file contains descriptions of the available options.
|
||||
<br>
|
||||
For testing purposes, you can set the TGT_URL parameter in the openkiosk.conf file
|
||||
to "test". This will give you an xterm window on the desktop.
|
||||
<br>
|
||||
Any changes made to the configuration file will be automatically detected and the
|
||||
the kiosk will reload using the new configuration.
|
||||
</p>
|
||||
<p>
|
||||
<b>Useful Key Combinations</b><br>
|
||||
If this is a standalone kiosk, many of the normal key combinations have been disabled to prevent misuse of the kiosk.
|
||||
However, there are two that you should know about.
|
||||
<br>
|
||||
Pressing <alt>-<F4> will kill and restart the display app, reloading the target URL.
|
||||
<br>
|
||||
Pressing <ctrl>-<alt>-<shift>-<del> will shut down the kiosk.
|
||||
<br>
|
||||
Pressing <ctrl>-<alt>-<shift>-<ins> will reboot the kiosk.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>License</b><br>
|
||||
OpenKiosk is licensed under the terms of the <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>.
|
||||
Click on the link
|
||||
or see the LICENSE file in the distribution to read it.
|
||||
<br><br>
|
||||
OpenKiosk is Copyright (C) 2026 by Rod Wright.
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
744
distfiles/home/kioskuser/.config/openbox/rc.xml
Normal file
744
distfiles/home/kioskuser/.config/openbox/rc.xml
Normal file
@@ -0,0 +1,744 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<openbox_config xmlns="http://openbox.org/3.4/rc"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<resistance>
|
||||
<strength>10</strength>
|
||||
<screen_edge_strength>20</screen_edge_strength>
|
||||
</resistance>
|
||||
|
||||
<focus>
|
||||
<focusNew>yes</focusNew>
|
||||
<!-- always try to focus new windows when they appear. other rules do
|
||||
apply -->
|
||||
<followMouse>no</followMouse>
|
||||
<!-- move focus to a window when you move the mouse into it -->
|
||||
<focusLast>yes</focusLast>
|
||||
<!-- focus the last used window when changing desktops, instead of the one
|
||||
under the mouse pointer. when followMouse is enabled -->
|
||||
<underMouse>no</underMouse>
|
||||
<!-- move focus under the mouse, even when the mouse is not moving -->
|
||||
<focusDelay>200</focusDelay>
|
||||
<!-- when followMouse is enabled, the mouse must be inside the window for
|
||||
this many milliseconds (1000 = 1 sec) before moving focus to it -->
|
||||
<raiseOnFocus>no</raiseOnFocus>
|
||||
<!-- when followMouse is enabled, and a window is given focus by moving the
|
||||
mouse into it, also raise the window -->
|
||||
</focus>
|
||||
|
||||
<placement>
|
||||
<policy>Smart</policy>
|
||||
<!-- 'Smart' or 'UnderMouse' -->
|
||||
<center>yes</center>
|
||||
<!-- whether to place windows in the center of the free area found or
|
||||
the top left corner -->
|
||||
<monitor>Primary</monitor>
|
||||
<!-- with Smart placement on a multi-monitor system, try to place new windows
|
||||
on: 'Any' - any monitor, 'Mouse' - where the mouse is, 'Active' - where
|
||||
the active window is, 'Primary' - only on the primary monitor -->
|
||||
<primaryMonitor>1</primaryMonitor>
|
||||
<!-- The monitor where Openbox should place popup dialogs such as the
|
||||
focus cycling popup, or the desktop switch popup. It can be an index
|
||||
from 1, specifying a particular monitor. Or it can be one of the
|
||||
following: 'Mouse' - where the mouse is, or
|
||||
'Active' - where the active window is -->
|
||||
</placement>
|
||||
|
||||
<theme>
|
||||
<name>Clearlooks</name>
|
||||
<titleLayout>NLIMC</titleLayout>
|
||||
<!--
|
||||
available characters are NDSLIMC, each can occur at most once.
|
||||
N: window icon
|
||||
L: window label (AKA title).
|
||||
I: iconify
|
||||
M: maximize
|
||||
C: close
|
||||
S: shade (roll up/down)
|
||||
D: omnipresent (on all desktops).
|
||||
-->
|
||||
<keepBorder>yes</keepBorder>
|
||||
<animateIconify>yes</animateIconify>
|
||||
<font place="ActiveWindow">
|
||||
<name>sans</name>
|
||||
<size>8</size>
|
||||
<!-- font size in points -->
|
||||
<weight>bold</weight>
|
||||
<!-- 'bold' or 'normal' -->
|
||||
<slant>normal</slant>
|
||||
<!-- 'italic' or 'normal' -->
|
||||
</font>
|
||||
<font place="InactiveWindow">
|
||||
<name>sans</name>
|
||||
<size>8</size>
|
||||
<!-- font size in points -->
|
||||
<weight>bold</weight>
|
||||
<!-- 'bold' or 'normal' -->
|
||||
<slant>normal</slant>
|
||||
<!-- 'italic' or 'normal' -->
|
||||
</font>
|
||||
<font place="MenuHeader">
|
||||
<name>sans</name>
|
||||
<size>9</size>
|
||||
<!-- font size in points -->
|
||||
<weight>normal</weight>
|
||||
<!-- 'bold' or 'normal' -->
|
||||
<slant>normal</slant>
|
||||
<!-- 'italic' or 'normal' -->
|
||||
</font>
|
||||
<font place="MenuItem">
|
||||
<name>sans</name>
|
||||
<size>9</size>
|
||||
<!-- font size in points -->
|
||||
<weight>normal</weight>
|
||||
<!-- 'bold' or 'normal' -->
|
||||
<slant>normal</slant>
|
||||
<!-- 'italic' or 'normal' -->
|
||||
</font>
|
||||
<font place="ActiveOnScreenDisplay">
|
||||
<name>sans</name>
|
||||
<size>9</size>
|
||||
<!-- font size in points -->
|
||||
<weight>bold</weight>
|
||||
<!-- 'bold' or 'normal' -->
|
||||
<slant>normal</slant>
|
||||
<!-- 'italic' or 'normal' -->
|
||||
</font>
|
||||
<font place="InactiveOnScreenDisplay">
|
||||
<name>sans</name>
|
||||
<size>9</size>
|
||||
<!-- font size in points -->
|
||||
<weight>bold</weight>
|
||||
<!-- 'bold' or 'normal' -->
|
||||
<slant>normal</slant>
|
||||
<!-- 'italic' or 'normal' -->
|
||||
</font>
|
||||
</theme>
|
||||
|
||||
<desktops>
|
||||
<!-- this stuff is only used at startup, pagers allow you to change them
|
||||
during a session
|
||||
|
||||
these are default values to use when other ones are not already set
|
||||
by other applications, or saved in your session
|
||||
|
||||
use obconf if you want to change these without having to log out
|
||||
and back in -->
|
||||
<number>1</number>
|
||||
<firstdesk>1</firstdesk>
|
||||
<names>
|
||||
<!-- set names up here if you want to, like this:
|
||||
<name>desktop 1</name>
|
||||
<name>desktop 2</name>
|
||||
-->
|
||||
</names>
|
||||
<popupTime>875</popupTime>
|
||||
<!-- The number of milliseconds to show the popup for when switching
|
||||
desktops. Set this to 0 to disable the popup. -->
|
||||
</desktops>
|
||||
|
||||
<resize>
|
||||
<drawContents>yes</drawContents>
|
||||
<popupShow>Nonpixel</popupShow>
|
||||
<!-- 'Always', 'Never', or 'Nonpixel' (xterms and such) -->
|
||||
<popupPosition>Center</popupPosition>
|
||||
<!-- 'Center', 'Top', or 'Fixed' -->
|
||||
<popupFixedPosition>
|
||||
<!-- these are used if popupPosition is set to 'Fixed' -->
|
||||
|
||||
<x>10</x>
|
||||
<!-- positive number for distance from left edge, negative number for
|
||||
distance from right edge, or 'Center' -->
|
||||
<y>10</y>
|
||||
<!-- positive number for distance from top edge, negative number for
|
||||
distance from bottom edge, or 'Center' -->
|
||||
</popupFixedPosition>
|
||||
</resize>
|
||||
|
||||
<!-- You can reserve a portion of your screen where windows will not cover when
|
||||
they are maximized, or when they are initially placed.
|
||||
Many programs reserve space automatically, but you can use this in other
|
||||
cases. -->
|
||||
<margins>
|
||||
<top>0</top>
|
||||
<bottom>0</bottom>
|
||||
<left>0</left>
|
||||
<right>0</right>
|
||||
</margins>
|
||||
|
||||
<dock>
|
||||
<position>TopLeft</position>
|
||||
<!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating -->
|
||||
<floatingX>0</floatingX>
|
||||
<floatingY>0</floatingY>
|
||||
<noStrut>no</noStrut>
|
||||
<stacking>Above</stacking>
|
||||
<!-- 'Above', 'Normal', or 'Below' -->
|
||||
<direction>Vertical</direction>
|
||||
<!-- 'Vertical' or 'Horizontal' -->
|
||||
<autoHide>no</autoHide>
|
||||
<hideDelay>300</hideDelay>
|
||||
<!-- in milliseconds (1000 = 1 second) -->
|
||||
<showDelay>300</showDelay>
|
||||
<!-- in milliseconds (1000 = 1 second) -->
|
||||
<moveButton>Middle</moveButton>
|
||||
<!-- 'Left', 'Middle', 'Right' -->
|
||||
</dock>
|
||||
|
||||
<keyboard>
|
||||
<!-- allow alt-F4 to kill browser -->
|
||||
<keybind key="A-F4">
|
||||
<action name="Execute">
|
||||
<command>pkill chromium</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable opening new window -->
|
||||
<keybind key="C-n">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable opening new private window -->
|
||||
<keybind key="C-S-p">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<keybind key="C-S-n">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable opening new tab -->
|
||||
<keybind key="C-t">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable opening home page -->
|
||||
<keybind key="A-Home">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable back -->
|
||||
<keybind key="A-Left">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<keybind key="C-bracketleft">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable forward -->
|
||||
<keybind key="A-Right">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<keybind key="C-bracketright">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable saving bookmarks -->
|
||||
<keybind key="C-d">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<keybind key="C-S-d">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable bookmarks sidebar -->
|
||||
<keybind key="C-b">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable bookmarks toolbar -->
|
||||
<keybind key="C-S-b">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable bookmarks library window -->
|
||||
<keybind key="C-S-o">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable opening history sidebar -->
|
||||
<keybind key="C-h">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable opening history library window -->
|
||||
<keybind key="C-S-h">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable opening downloads page -->
|
||||
<keybind key="C-S-y">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<keybind key="C-j">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable opening task manager -->
|
||||
<keybind key="S-Escape">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable saving current page -->
|
||||
<keybind key="C-s">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable opening local file -->
|
||||
<keybind key="C-o">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable display source -->
|
||||
<keybind key="C-u">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- browser disable opening help center -->
|
||||
<keybind key="F1">
|
||||
<action name="Execute">
|
||||
<command>true</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- Enable poweroff with ctrl-alt-shift-del -->
|
||||
<keybind key="C-A-S-Delete">
|
||||
<action name="Execute">
|
||||
<command>shutdown -P now</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<!-- Enable reboot with ctrl-alt-shift-del -->
|
||||
<keybind key="C-A-S-Insert">
|
||||
<action name="Execute">
|
||||
<command>shutdown -r now</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<chainQuitKey>C-g</chainQuitKey>
|
||||
</keyboard>
|
||||
|
||||
<mouse>
|
||||
<dragThreshold>1</dragThreshold>
|
||||
<!-- number of pixels the mouse must move before a drag begins -->
|
||||
<doubleClickTime>500</doubleClickTime>
|
||||
<!-- in milliseconds (1000 = 1 second) -->
|
||||
<screenEdgeWarpTime>400</screenEdgeWarpTime>
|
||||
<!-- Time before changing desktops when the pointer touches the edge of the
|
||||
screen while moving a window, in milliseconds (1000 = 1 second).
|
||||
Set this to 0 to disable warping -->
|
||||
<screenEdgeWarpMouse>false</screenEdgeWarpMouse>
|
||||
<!-- Set this to TRUE to move the mouse pointer across the desktop when
|
||||
switching due to hitting the edge of the screen -->
|
||||
|
||||
<context name="Frame">
|
||||
<mousebind button="A-Left" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
</mousebind>
|
||||
<mousebind button="A-Left" action="Click">
|
||||
<action name="Unshade"/>
|
||||
</mousebind>
|
||||
<mousebind button="A-Left" action="Drag">
|
||||
<action name="Move"/>
|
||||
</mousebind>
|
||||
|
||||
<mousebind button="A-Right" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="Unshade"/>
|
||||
</mousebind>
|
||||
<mousebind button="A-Right" action="Drag">
|
||||
<action name="Resize"/>
|
||||
</mousebind>
|
||||
|
||||
<mousebind button="A-Middle" action="Press">
|
||||
<action name="Lower"/>
|
||||
<action name="FocusToBottom"/>
|
||||
<action name="Unfocus"/>
|
||||
</mousebind>
|
||||
|
||||
<mousebind button="A-Up" action="Click">
|
||||
<action name="GoToDesktop"><to>previous</to></action>
|
||||
</mousebind>
|
||||
<mousebind button="A-Down" action="Click">
|
||||
<action name="GoToDesktop"><to>next</to></action>
|
||||
</mousebind>
|
||||
<mousebind button="C-A-Up" action="Click">
|
||||
<action name="GoToDesktop"><to>previous</to></action>
|
||||
</mousebind>
|
||||
<mousebind button="C-A-Down" action="Click">
|
||||
<action name="GoToDesktop"><to>next</to></action>
|
||||
</mousebind>
|
||||
<mousebind button="A-S-Up" action="Click">
|
||||
<action name="SendToDesktop"><to>previous</to></action>
|
||||
</mousebind>
|
||||
<mousebind button="A-S-Down" action="Click">
|
||||
<action name="SendToDesktop"><to>next</to></action>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Titlebar">
|
||||
<mousebind button="Left" action="Drag">
|
||||
<action name="Move"/>
|
||||
</mousebind>
|
||||
<mousebind button="Left" action="DoubleClick">
|
||||
<action name="ToggleMaximize"/>
|
||||
</mousebind>
|
||||
|
||||
<mousebind button="Up" action="Click">
|
||||
<action name="if">
|
||||
<shaded>no</shaded>
|
||||
<then>
|
||||
<action name="Shade"/>
|
||||
<action name="FocusToBottom"/>
|
||||
<action name="Unfocus"/>
|
||||
<action name="Lower"/>
|
||||
</then>
|
||||
</action>
|
||||
</mousebind>
|
||||
<mousebind button="Down" action="Click">
|
||||
<action name="if">
|
||||
<shaded>yes</shaded>
|
||||
<then>
|
||||
<action name="Unshade"/>
|
||||
<action name="Raise"/>
|
||||
</then>
|
||||
</action>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Titlebar Top Right Bottom Left TLCorner TRCorner BRCorner BLCorner">
|
||||
<mousebind button="Left" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="Unshade"/>
|
||||
</mousebind>
|
||||
|
||||
<mousebind button="Middle" action="Press">
|
||||
<action name="Lower"/>
|
||||
<action name="FocusToBottom"/>
|
||||
<action name="Unfocus"/>
|
||||
</mousebind>
|
||||
|
||||
<mousebind button="Right" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="ShowMenu"><menu>client-menu</menu></action>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Top">
|
||||
<mousebind button="Left" action="Drag">
|
||||
<action name="Resize"><edge>top</edge></action>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Left">
|
||||
<mousebind button="Left" action="Drag">
|
||||
<action name="Resize"><edge>left</edge></action>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Right">
|
||||
<mousebind button="Left" action="Drag">
|
||||
<action name="Resize"><edge>right</edge></action>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Bottom">
|
||||
<mousebind button="Left" action="Drag">
|
||||
<action name="Resize"><edge>bottom</edge></action>
|
||||
</mousebind>
|
||||
|
||||
<mousebind button="Right" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="ShowMenu"><menu>client-menu</menu></action>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="TRCorner BRCorner TLCorner BLCorner">
|
||||
<mousebind button="Left" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="Unshade"/>
|
||||
</mousebind>
|
||||
<mousebind button="Left" action="Drag">
|
||||
<action name="Resize"/>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Client">
|
||||
<mousebind button="Left" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
</mousebind>
|
||||
<mousebind button="Middle" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
</mousebind>
|
||||
<mousebind button="Right" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Icon">
|
||||
<mousebind button="Left" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="Unshade"/>
|
||||
<action name="ShowMenu"><menu>client-menu</menu></action>
|
||||
</mousebind>
|
||||
<mousebind button="Right" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="ShowMenu"><menu>client-menu</menu></action>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="AllDesktops">
|
||||
<mousebind button="Left" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="Unshade"/>
|
||||
</mousebind>
|
||||
<mousebind button="Left" action="Click">
|
||||
<action name="ToggleOmnipresent"/>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Shade">
|
||||
<mousebind button="Left" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
</mousebind>
|
||||
<mousebind button="Left" action="Click">
|
||||
<action name="ToggleShade"/>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Iconify">
|
||||
<mousebind button="Left" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
</mousebind>
|
||||
<mousebind button="Left" action="Click">
|
||||
<action name="Iconify"/>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Maximize">
|
||||
<mousebind button="Left" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="Unshade"/>
|
||||
</mousebind>
|
||||
<mousebind button="Middle" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="Unshade"/>
|
||||
</mousebind>
|
||||
<mousebind button="Right" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="Unshade"/>
|
||||
</mousebind>
|
||||
<mousebind button="Left" action="Click">
|
||||
<action name="ToggleMaximize"/>
|
||||
</mousebind>
|
||||
<mousebind button="Middle" action="Click">
|
||||
<action name="ToggleMaximize"><direction>vertical</direction></action>
|
||||
</mousebind>
|
||||
<mousebind button="Right" action="Click">
|
||||
<action name="ToggleMaximize"><direction>horizontal</direction></action>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Close">
|
||||
<mousebind button="Left" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
<action name="Unshade"/>
|
||||
</mousebind>
|
||||
<mousebind button="Left" action="Click">
|
||||
<action name="Close"/>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Desktop">
|
||||
<mousebind button="Up" action="Click">
|
||||
<action name="GoToDesktop"><to>previous</to></action>
|
||||
</mousebind>
|
||||
<mousebind button="Down" action="Click">
|
||||
<action name="GoToDesktop"><to>next</to></action>
|
||||
</mousebind>
|
||||
|
||||
<mousebind button="A-Up" action="Click">
|
||||
<action name="GoToDesktop"><to>previous</to></action>
|
||||
</mousebind>
|
||||
<mousebind button="A-Down" action="Click">
|
||||
<action name="GoToDesktop"><to>next</to></action>
|
||||
</mousebind>
|
||||
<mousebind button="C-A-Up" action="Click">
|
||||
<action name="GoToDesktop"><to>previous</to></action>
|
||||
</mousebind>
|
||||
<mousebind button="C-A-Down" action="Click">
|
||||
<action name="GoToDesktop"><to>next</to></action>
|
||||
</mousebind>
|
||||
|
||||
<mousebind button="Left" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
</mousebind>
|
||||
<mousebind button="Right" action="Press">
|
||||
<action name="Focus"/>
|
||||
<action name="Raise"/>
|
||||
</mousebind>
|
||||
</context>
|
||||
|
||||
<context name="Root">
|
||||
<!-- Menus -->
|
||||
</context>
|
||||
|
||||
<context name="MoveResize">
|
||||
<mousebind button="Up" action="Click">
|
||||
<action name="GoToDesktop"><to>previous</to></action>
|
||||
</mousebind>
|
||||
<mousebind button="Down" action="Click">
|
||||
<action name="GoToDesktop"><to>next</to></action>
|
||||
</mousebind>
|
||||
<mousebind button="A-Up" action="Click">
|
||||
<action name="GoToDesktop"><to>previous</to></action>
|
||||
</mousebind>
|
||||
<mousebind button="A-Down" action="Click">
|
||||
<action name="GoToDesktop"><to>next</to></action>
|
||||
</mousebind>
|
||||
</context>
|
||||
</mouse>
|
||||
|
||||
<menu>
|
||||
</menu>
|
||||
|
||||
<applications>
|
||||
<!--
|
||||
# this is an example with comments through out. use these to make your
|
||||
# own rules, but without the comments of course.
|
||||
# you may use one or more of the name/class/role/title/type rules to specify
|
||||
# windows to match
|
||||
|
||||
<application name="the window's _OB_APP_NAME property (see obxprop)"
|
||||
class="the window's _OB_APP_CLASS property (see obxprop)"
|
||||
groupname="the window's _OB_APP_GROUP_NAME property (see obxprop)"
|
||||
groupclass="the window's _OB_APP_GROUP_CLASS property (see obxprop)"
|
||||
role="the window's _OB_APP_ROLE property (see obxprop)"
|
||||
title="the window's _OB_APP_TITLE property (see obxprop)"
|
||||
type="the window's _OB_APP_TYPE property (see obxprob)..
|
||||
(if unspecified, then it is 'dialog' for child windows)">
|
||||
# you may set only one of name/class/role/title/type, or you may use more
|
||||
# than one together to restrict your matches.
|
||||
|
||||
# the name, class, role, and title use simple wildcard matching such as those
|
||||
# used by a shell. you can use * to match any characters and ? to match
|
||||
# any single character.
|
||||
|
||||
# the type is one of: normal, dialog, splash, utility, menu, toolbar, dock,
|
||||
# or desktop
|
||||
|
||||
# when multiple rules match a window, they will all be applied, in the
|
||||
# order that they appear in this list
|
||||
|
||||
|
||||
# each rule element can be left out or set to 'default' to specify to not
|
||||
# change that attribute of the window
|
||||
|
||||
<decor>yes</decor>
|
||||
# enable or disable window decorations
|
||||
|
||||
<shade>no</shade>
|
||||
# make the window shaded when it appears, or not
|
||||
|
||||
<position force="no">
|
||||
# the position is only used if both an x and y coordinate are provided
|
||||
# (and not set to 'default')
|
||||
# when force is "yes", then the window will be placed here even if it
|
||||
# says you want it placed elsewhere. this is to override buggy
|
||||
# applications who refuse to behave
|
||||
<x>center</x>
|
||||
# a number like 50, or 'center' to center on screen. use a negative number
|
||||
# to start from the right (or bottom for <y>), ie -50 is 50 pixels from
|
||||
# the right edge (or bottom). use 'default' to specify using value
|
||||
# provided by the application, or chosen by openbox, instead.
|
||||
<y>200</y>
|
||||
<monitor>1</monitor>
|
||||
# specifies the monitor in a xinerama setup.
|
||||
# 1 is the first head, or 'mouse' for wherever the mouse is
|
||||
</position>
|
||||
|
||||
<size>
|
||||
# the size to make the window.
|
||||
<width>20</width>
|
||||
# a number like 20, or 'default' to use the size given by the application.
|
||||
# you can use fractions such as 1/2 or percentages such as 75% in which
|
||||
# case the value is relative to the size of the monitor that the window
|
||||
# appears on.
|
||||
<height>30%</height>
|
||||
</size>
|
||||
|
||||
<focus>yes</focus>
|
||||
# if the window should try be given focus when it appears. if this is set
|
||||
# to yes it doesn't guarantee the window will be given focus. some
|
||||
# restrictions may apply, but Openbox will try to
|
||||
|
||||
<desktop>1</desktop>
|
||||
# 1 is the first desktop, 'all' for all desktops
|
||||
|
||||
<layer>normal</layer>
|
||||
# 'above', 'normal', or 'below'
|
||||
|
||||
<iconic>no</iconic>
|
||||
# make the window iconified when it appears, or not
|
||||
|
||||
<skip_pager>no</skip_pager>
|
||||
# asks to not be shown in pagers
|
||||
|
||||
<skip_taskbar>no</skip_taskbar>
|
||||
# asks to not be shown in taskbars. window cycling actions will also
|
||||
# skip past such windows
|
||||
|
||||
<fullscreen>yes</fullscreen>
|
||||
# make the window in fullscreen mode when it appears
|
||||
|
||||
<maximized>true</maximized>
|
||||
# 'Horizontal', 'Vertical' or boolean (yes/no)
|
||||
</application>
|
||||
|
||||
# end of the example
|
||||
-->
|
||||
</applications>
|
||||
|
||||
</openbox_config>
|
||||
23
distfiles/home/kioskuser/.profile
Normal file
23
distfiles/home/kioskuser/.profile
Normal file
@@ -0,0 +1,23 @@
|
||||
# ~/.profile: executed by the command interpreter for login shells.
|
||||
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
|
||||
# exists.
|
||||
# see /usr/share/doc/bash/examples/startup-files for examples.
|
||||
# the files are located in the bash-doc package.
|
||||
|
||||
# the default umask is set in /etc/profile; for setting the umask
|
||||
# for ssh logins, install and configure the libpam-umask package.
|
||||
#umask 022
|
||||
|
||||
# if running bash
|
||||
if [ -n "$BASH_VERSION" ]; then
|
||||
# include .bashrc if it exists
|
||||
if [ -f "$HOME/.bashrc" ]; then
|
||||
. "$HOME/.bashrc"
|
||||
fi
|
||||
fi
|
||||
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if [ -d "$HOME/bin" ] ; then
|
||||
PATH="$HOME/bin:$PATH"
|
||||
fi
|
||||
/usr/bin/startx /etc/X11/Xsession /usr/local/bin/openkiosk -- :0
|
||||
53
distfiles/lib/systemd/system/getty@tty1.service
Normal file
53
distfiles/lib/systemd/system/getty@tty1.service
Normal file
@@ -0,0 +1,53 @@
|
||||
# This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
[Unit]
|
||||
Description=Getty on %I
|
||||
Documentation=man:agetty(8) man:systemd-getty-generator(8)
|
||||
Documentation=http://0pointer.de/blog/projects/serial-console.html
|
||||
After=systemd-user-sessions.service plymouth-quit-wait.service
|
||||
After=rc-local.service
|
||||
|
||||
# If additional gettys are spawned during boot then we should make
|
||||
# sure that this is synchronized before getty.target, even though
|
||||
# getty.target didn't actually pull it in.
|
||||
Before=getty.target
|
||||
IgnoreOnIsolate=yes
|
||||
|
||||
# IgnoreOnIsolate causes issues with sulogin, if someone isolates
|
||||
# rescue.target or starts rescue.service from multi-user.target or
|
||||
# graphical.target.
|
||||
Conflicts=rescue.service
|
||||
Before=rescue.service
|
||||
|
||||
# On systems without virtual consoles, don't start any getty. Note
|
||||
# that serial gettys are covered by serial-getty@.service, not this
|
||||
# unit.
|
||||
ConditionPathExists=/dev/tty0
|
||||
|
||||
[Service]
|
||||
# the VT is cleared by TTYVTDisallocate
|
||||
ExecStart=-/sbin/agetty -a kioskuser --noclear %I $TERM
|
||||
Type=idle
|
||||
Restart=always
|
||||
RestartSec=0
|
||||
UtmpIdentifier=%I
|
||||
TTYPath=/dev/%I
|
||||
TTYReset=yes
|
||||
TTYVHangup=yes
|
||||
TTYVTDisallocate=yes
|
||||
KillMode=process
|
||||
IgnoreSIGPIPE=no
|
||||
SendSIGHUP=yes
|
||||
|
||||
# Unset locale for the console getty since the console has problems
|
||||
# displaying some internationalized messages.
|
||||
Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
|
||||
|
||||
[Install]
|
||||
WantedBy=getty.target
|
||||
DefaultInstance=tty1
|
||||
21
distfiles/usr/local/bin/cloneuser
Executable file
21
distfiles/usr/local/bin/cloneuser
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# cloneuser
|
||||
|
||||
SRC=$1
|
||||
DEST=$2
|
||||
|
||||
SRC_GROUPS=`id -Gn ${SRC}`
|
||||
SRC_SHELL=$(awk -F : -v name=${SRC} '(name == $1) { print $7 }' /etc/passwd)
|
||||
RAND_PW=`date +%s | sha256sum | base64 | head -c 32 ; echo`
|
||||
|
||||
echo "Creating user $DEST"
|
||||
useradd --shell ${SRC_SHELL} --password ${RAND_PW} --create-home ${DEST}
|
||||
for grp in ${SRC_GROUPS};do
|
||||
if [ "$grp" != "$SRC" ]; then
|
||||
echo "Adding user $DEST to group $grp."
|
||||
usermod -a -G $grp ${DEST}
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
7
distfiles/usr/local/bin/kiosk_cleanup
Executable file
7
distfiles/usr/local/bin/kiosk_cleanup
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
# kiosk_cleanup
|
||||
|
||||
rm -rf $HOME/.{config,cache}/chromium/
|
||||
rm -rf /dev/shm/target.pdf
|
||||
pkill xmessage
|
||||
|
||||
27
distfiles/usr/local/bin/kiosk_viewhtml
Executable file
27
distfiles/usr/local/bin/kiosk_viewhtml
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# kiosk_viewhtml
|
||||
|
||||
if [ "$1" = "" ]
|
||||
then
|
||||
"usage: kiosk_viewhtml <url> <config file path>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
url="$1"
|
||||
conf_file="$2"
|
||||
|
||||
source $conf_file
|
||||
if [[ "$EUID" == "0" || $(who|cut -d" " -f1) == "kioskuser" ]]
|
||||
then
|
||||
# Use standalone args
|
||||
chromargs="--test-type --ignore-certificate-errors --kiosk --no-first-run --check-for-update-interval=1 --simulate-upgrade --incognito"
|
||||
else
|
||||
# Use workstation args
|
||||
chromargs="--test-type --ignore-certificate-errors --start-fullscreen --no-first-run --check-for-update-interval=1 --simulate-upgrade --incognito"
|
||||
fi
|
||||
if ! chromium $chromargs $url
|
||||
then
|
||||
kiosk_cleanup.sh
|
||||
xmessage -buttons "Ok:1" -center "Failed to retrieve web page."
|
||||
exit 1
|
||||
fi
|
||||
29
distfiles/usr/local/bin/kiosk_viewpdf
Executable file
29
distfiles/usr/local/bin/kiosk_viewpdf
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# kiosk_viewpdf
|
||||
|
||||
if [ "$1" = "" ]
|
||||
then
|
||||
"usage: kiosk_viewpdf <url> <config file path>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
url="$1"
|
||||
conf_file="$2"
|
||||
|
||||
source $conf_file
|
||||
|
||||
if echo "$url" | grep -q '^file:'
|
||||
then
|
||||
filepath=$(echo "$server_url"|cut -d"/" -f2-)
|
||||
xpdf -fullscreen -cont -z width $filepath
|
||||
else
|
||||
if ! wget -q -O /dev/shm/target.pdf $url
|
||||
then
|
||||
kiosk_cleanup.sh
|
||||
xmessage -buttons "Ok:1" -center "Failed to retrieve pdf file."
|
||||
exit 1
|
||||
else
|
||||
xpdf -fullscreen -cont -z width /dev/shm/target.pdf
|
||||
fi
|
||||
fi
|
||||
|
||||
221
distfiles/usr/local/bin/openkiosk
Executable file
221
distfiles/usr/local/bin/openkiosk
Executable file
@@ -0,0 +1,221 @@
|
||||
#!/bin/bash
|
||||
# openkiosk
|
||||
|
||||
if [[ "$EUID" == "0" || $(who|cut -d" " -f1) == "kioskuser" ]]
|
||||
then
|
||||
conf_file="/etc/openkiosk/openkiosk.conf"
|
||||
run_type="standalone"
|
||||
else
|
||||
if [[ ! -e "$HOME/.config/openkiosk/openkiosk.conf" ]]
|
||||
then
|
||||
mkdir -p $HOME/.config/openkiosk
|
||||
cp /etc/openkiosk/openkiosk.conf $HOME/.config/openkiosk/
|
||||
fi
|
||||
conf_file="$HOME/.config/openkiosk/openkiosk.conf"
|
||||
run_type="workstation"
|
||||
fi
|
||||
if [[ ! -e "$conf_file" ]]
|
||||
then
|
||||
echo "Couldn't find config file. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source $conf_file
|
||||
|
||||
|
||||
function set_commands() {
|
||||
source $conf_file
|
||||
if [[ $TGT_URL == "test" ]]
|
||||
then
|
||||
# Enter test mode
|
||||
APP_CMD="xterm"
|
||||
ALIVE_STRING="xterm"
|
||||
KILL_CMD="pkill xterm"
|
||||
CLEANUP_CMD="sleep 1"
|
||||
debuglog "Entering test mode"
|
||||
elif echo "$TGT_URL" | grep -q '\.pdf$'
|
||||
then
|
||||
# The URL is a pdf file
|
||||
APP_CMD="kiosk_viewpdf $TGT_URL $conf_file"
|
||||
ALIVE_STRING="xpdf"
|
||||
KILL_CMD="pkill xpdf"
|
||||
CLEANUP_CMD="kiosk_cleanup"
|
||||
debuglog "URL is a pdf file. Command is $APP_CMD"
|
||||
else
|
||||
# Assume the URL returns HTML
|
||||
APP_CMD="kiosk_viewhtml $TGT_URL $conf_file"
|
||||
ALIVE_STRING="chromium"
|
||||
KILL_CMD="pkill chromium"
|
||||
CLEANUP_CMD="kiosk_cleanup"
|
||||
debuglog "URL is an HTML file. Command is $APP_CMD"
|
||||
fi
|
||||
}
|
||||
|
||||
function check_conf() {
|
||||
debuglog "Checking configuration file for changes."
|
||||
new_conf_md5=$(md5sum $conf_file|cut -d " " -f1)
|
||||
debuglog "New config file checksum: $new_conf_md5"
|
||||
curr_conf_md5=$(cat /dev/shm/curr_conf_md5.txt)
|
||||
debuglog "Current config file checksum: $curr_conf_md5"
|
||||
diff <(echo $new_conf_md5) <(echo $curr_conf_md5) >/dev/null 2>&1
|
||||
if [[ "$?" == "1" ]]
|
||||
then
|
||||
debuglog "Config file has changed!"
|
||||
echo $new_conf_md5 > /dev/shm/curr_conf_md5.txt
|
||||
debuglog "Killing application"
|
||||
krestart=true
|
||||
$KILL_CMD
|
||||
$CLEANUP_CMD
|
||||
return 1
|
||||
else
|
||||
krestart=false
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
function check_url() {
|
||||
debuglog "Checking URL for changes"
|
||||
if [[ $TGT_URL == "test" ]]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
if echo "$TGT_URL"|grep -q '^http'
|
||||
then
|
||||
new_url_md5=$(wget -q -o /dev/null -O - $TGT_URL|md5sum|cut -d " " -f1)
|
||||
elif echo "$TGT_URL"|grep -q '^file'
|
||||
then
|
||||
filepath=$(echo "$TGT_URL"|cut -d":" -f2-)
|
||||
new_url_md5=$(md5sum $filepath|cut -d " " -f1)
|
||||
else
|
||||
new_url_md5=""
|
||||
fi
|
||||
debuglog "New URL checksum: $new_url_md5"
|
||||
curr_url_md5=$(cat /dev/shm/curr_url_md5.txt)
|
||||
debuglog "Current URL checksum: $curr_url_md5"
|
||||
diff <(echo $new_url_md5) <(echo $curr_url_md5) >/dev/null 2>&1
|
||||
if [[ "$?" == "1" ]]
|
||||
then
|
||||
debuglog "URL has changed!"
|
||||
echo $new_url_md5>/dev/shm/curr_url_md5.txt
|
||||
debuglog "Killing application"
|
||||
krestart=true
|
||||
$KILL_CMD
|
||||
$CLEANUP_CMD
|
||||
return 1
|
||||
else
|
||||
krestart=false
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
function debuglog() {
|
||||
if [[ "$DEBUG" == "1" ]]
|
||||
then
|
||||
if [[ "$run_type" == "standalone" ]]
|
||||
then
|
||||
logfile_path="/var/log/openkiosk.log"
|
||||
else
|
||||
logfile_path="$HOME/openkiosk.log"
|
||||
fi
|
||||
if [[ ! -e "$logfile_path" ]]
|
||||
then
|
||||
echo "openkiosk log started : "$(date +%Y-%m-%d %H:%M:%S) > $logfile_path
|
||||
fi
|
||||
echo $(date +%H:%M:%S) "$1">>$logfile_path
|
||||
fi
|
||||
}
|
||||
|
||||
function set_blank_params() {
|
||||
if [[ "$INHIBIT_BLANK" == "1" ]]
|
||||
then
|
||||
xset s off
|
||||
xset -dpms
|
||||
else
|
||||
xset s off
|
||||
xset +dpms
|
||||
xset dpms $DSP_STBY_SEC $DSP_SUSP_SEC $DSP_OFF_SEC
|
||||
fi
|
||||
}
|
||||
|
||||
function set_rot_params() {
|
||||
output_name=$(xrandr --listactivemonitors|grep 0:|rev|cut -d " " -f1|rev)
|
||||
xrandr --output $output_name --rotate "normal"
|
||||
sleep 1
|
||||
xrandr --output $output_name --rotate $ROTATION
|
||||
}
|
||||
|
||||
set_commands
|
||||
if [[ "$run_type" == "standalone" ]]
|
||||
then
|
||||
openbox-session &
|
||||
fi
|
||||
sleep 1
|
||||
set_blank_params
|
||||
pkill xpdf
|
||||
pkill chromium
|
||||
pkill xterm
|
||||
kiosk_cleanup
|
||||
|
||||
# start application
|
||||
|
||||
$APP_CMD &
|
||||
sleep 3
|
||||
|
||||
if echo "$TGT_URL"|grep -q '^http'
|
||||
then
|
||||
new_url_md5=$(wget -q -o /dev/null -O - $TGT_URL|md5sum|cut -d " " -f1)
|
||||
elif echo "$TGT_URL"|grep -q '^file'
|
||||
then
|
||||
filepath=$(echo "$TGT_URL"|cut -d":" -f2-)
|
||||
new_url_md5=$(md5sum $filepath|cut -d " " -f1)
|
||||
else
|
||||
new_url_md5=""
|
||||
fi
|
||||
echo $new_url_md5>/dev/shm/curr_url_md5.txt
|
||||
new_conf_md5=$(md5sum $conf_file|cut -d " " -f1)
|
||||
echo $new_conf_md5 > /dev/shm/curr_conf_md5.txt
|
||||
|
||||
while true
|
||||
do
|
||||
|
||||
debuglog "Monitoring for URL and config file changes..."
|
||||
# Pull in changes in the configuration file
|
||||
debuglog "Reading config file"
|
||||
source $conf_file
|
||||
|
||||
if ! pgrep $ALIVE_STRING
|
||||
then
|
||||
# relaunch application if it terminates
|
||||
if $krestart
|
||||
then
|
||||
debuglog "Restarting with command $APP_CMD"
|
||||
$APP_CMD &
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$POLL_INTERVAL" == "0" ]]
|
||||
then
|
||||
sleep 1
|
||||
debuglog "Polling not enabled"
|
||||
if ! check_conf
|
||||
then
|
||||
set_blank_params
|
||||
set_rot_params
|
||||
set_commands
|
||||
fi
|
||||
else
|
||||
sleep $POLL_INTERVAL
|
||||
debuglog "Polling enabled"
|
||||
if ! check_conf
|
||||
then
|
||||
set_blank_params
|
||||
set_rot_params
|
||||
set_commands
|
||||
fi
|
||||
check_url
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user