mirror of
https://github.com/Tooloop/Tooloop-Packages.git
synced 2026-04-27 20:41:37 +02:00
initial commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
Package: tooloop-kiosk-browser
|
||||
Version: 0.9.0
|
||||
Maintainer: vollstock
|
||||
Homepage: https://www.vollstock.de
|
||||
Bugs: https://github.com/vollstock/Tooloop-Examples.git
|
||||
Section: tooloop/presentation
|
||||
Architecture: amd64
|
||||
Depends: chromium-browser
|
||||
Recommends: tooloop-transparent-cursor
|
||||
Description: Kiosk Browser
|
||||
A simple fullscreen kiosk browser based using chromium.
|
||||
You can define its’ homepage in the settings.
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Exit immediately if a command exits with a non-zero status
|
||||
set -e
|
||||
# Restart the settings server
|
||||
systemctl restart tooloop-settings-server
|
||||
# Exit cleanly
|
||||
exit 0
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Exit immediately if a command exits with a non-zero status
|
||||
set -e
|
||||
# Restart the settings server
|
||||
systemctl restart tooloop-settings-server
|
||||
# Exit cleanly
|
||||
exit 0
|
||||
@@ -0,0 +1,217 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Simple Kiosk</title>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
canvas {
|
||||
display: block;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
#particles {
|
||||
position:absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #172e4d;
|
||||
/*background: radial-gradient(ellipse at center, #224a5e 0%,#172e4d 100%);*/
|
||||
background: radial-gradient(ellipse at center, #224a5e 0%,#172e4d 50%,#050b23 100%);
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-position: 50% 50%;
|
||||
}
|
||||
|
||||
#box {
|
||||
width: 50%;
|
||||
position: absolute;
|
||||
background: rgba(255,255,255,0.9);
|
||||
left: 25%;
|
||||
top: 25%;
|
||||
border-radius: 2px;
|
||||
padding: 20px;
|
||||
max-width: 640px;
|
||||
box-sizing: border-box;
|
||||
padding: 50px 40px 50px 40px;
|
||||
-webkit-user-select: none; /* Chrome all / Safari all */
|
||||
-moz-user-select: none; /* Firefox all */
|
||||
-ms-user-select: none; /* IE 10+ */
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
#credits {
|
||||
color: white;
|
||||
z-index: 999;
|
||||
position: absolute;
|
||||
font-size: 10px;
|
||||
right: 20px;
|
||||
bottom: 20px;
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
body, div, h1, p {
|
||||
margin: 0;
|
||||
font-family: 'ClearSans', sans-serif;
|
||||
font-weight: 100;
|
||||
font-size: 18px;
|
||||
line-height: 1.25em;
|
||||
}
|
||||
|
||||
h1, p {
|
||||
margin: 0 0 1em 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-weight: lighter;
|
||||
color: #b1148e;
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
a, a:visited, a:active {
|
||||
color: #b1148e;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="particles"></div>
|
||||
|
||||
<div id="box">
|
||||
<h1>Simple Kiosk</h1>
|
||||
<p>This is a simple browser for your show room or trade fair booth.</p>
|
||||
<p>It has very few features but works for simple things.</p>
|
||||
<p>By default it loads <span style="font-family: monospace;">/assets/data/index.html</span> but you can choose any page you like.</p>
|
||||
<p>Simple Kiosk comes with a plugin for the Tooloop Settings Server so you can configure it in there.</p>
|
||||
</div>
|
||||
|
||||
<div id="credits"><a href="http://vincentgarreau.com/particles.js/">particles.js</a> by Vincent Garreau</div>
|
||||
|
||||
<!-- particles.js lib - https://github.com/VincentGarreau/particles.js -->
|
||||
<script src="particles.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
particlesJS("particles", {
|
||||
"particles": {
|
||||
"number": {
|
||||
"value": 100,
|
||||
"density": {
|
||||
"enable": true,
|
||||
"value_area": 1000
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"value": "#ffffff"
|
||||
},
|
||||
"shape": {
|
||||
"type": "polygon",
|
||||
"stroke": {
|
||||
"width": 0,
|
||||
"color": "#000000"
|
||||
},
|
||||
"polygon": {
|
||||
"nb_sides": 8
|
||||
},
|
||||
// "image": {
|
||||
// "src": "img/github.svg",
|
||||
// "width": 100,
|
||||
// "height": 100
|
||||
// }
|
||||
},
|
||||
"opacity": {
|
||||
"value": 0.5,
|
||||
"random": false,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 1,
|
||||
"opacity_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"size": {
|
||||
"value": 2,
|
||||
"random": true,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 40,
|
||||
"size_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"line_linked": {
|
||||
"enable": true,
|
||||
"distance": 150,
|
||||
"color": "#ffffff",
|
||||
"opacity": 0.4,
|
||||
"width": 1.5
|
||||
},
|
||||
"move": {
|
||||
"enable": true,
|
||||
"speed": 3,
|
||||
"direction": "none",
|
||||
"random": true,
|
||||
"straight": false,
|
||||
"out_mode": "out",
|
||||
"bounce": false,
|
||||
"attract": {
|
||||
"enable": true,
|
||||
"rotateX": 600,
|
||||
"rotateY": 1200
|
||||
}
|
||||
}
|
||||
},
|
||||
"interactivity": {
|
||||
"detect_on": "window",
|
||||
"events": {
|
||||
"onhover": {
|
||||
"enable": false,
|
||||
"mode": "repulse"
|
||||
},
|
||||
"onclick": {
|
||||
"enable": true,
|
||||
"mode": "push"
|
||||
},
|
||||
"resize": true
|
||||
},
|
||||
"modes": {
|
||||
"grab": {
|
||||
"distance": 400,
|
||||
"line_linked": {
|
||||
"opacity": 1
|
||||
}
|
||||
},
|
||||
"bubble": {
|
||||
"distance": 400,
|
||||
"size": 40,
|
||||
"duration": 2,
|
||||
"opacity": 8,
|
||||
"speed": 3
|
||||
},
|
||||
"repulse": {
|
||||
"distance": 200,
|
||||
"duration": 0.4
|
||||
},
|
||||
"push": {
|
||||
"particles_nb": 3
|
||||
},
|
||||
"remove": {
|
||||
"particles_nb": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"retina_detect": true
|
||||
});
|
||||
var update = function() {
|
||||
requestAnimationFrame(update);
|
||||
};
|
||||
requestAnimationFrame(update);;
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+9
File diff suppressed because one or more lines are too long
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
URL="file:///assets/data/index.html"
|
||||
|
||||
# List of Chromium Command Line Switches
|
||||
# https://peter.sh/experiments/chromium-command-line-switches/
|
||||
COMMAND="chromium-browser \
|
||||
--kiosk \
|
||||
--bwsi \
|
||||
--overscroll-history-navigation=1 \
|
||||
--incognito \
|
||||
--disable-infobars \
|
||||
--disable-translate \
|
||||
--no-default-browser-check \
|
||||
--no-first-run \
|
||||
--disable-translate-new-ux \
|
||||
--num-raster-threads=4 \
|
||||
--enable-zero-copy \
|
||||
--noerrdialogs \
|
||||
--class=TooloopKiosk \
|
||||
$URL"
|
||||
|
||||
if [ $EUID == 0 ]; then
|
||||
pkill chromium
|
||||
sleep 0.1
|
||||
su tooloop -c "$COMMAND" &
|
||||
else
|
||||
pkill chromium
|
||||
sleep 0.1
|
||||
$COMMAND &
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
IDLETIME=60
|
||||
RESET_COMMAND="/bin/bash /assets/presentation/reset-kiosk.sh"
|
||||
|
||||
$RESET_COMMAND
|
||||
xidlerun -t $IDLETIME -c "$RESET_COMMAND" &
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
pkill xidlerun &
|
||||
pkill chromium &
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "Simple Kiosk",
|
||||
"description": "A simple kiosk browser based using chromium.",
|
||||
"media": [],
|
||||
"version": "1.0",
|
||||
"last_updated": "2017-12-21",
|
||||
"license": "Public domain",
|
||||
"category": "Examples",
|
||||
"tags": ["example"],
|
||||
"developer": "vollstock",
|
||||
"homepage": "http://www.vollstock.de/",
|
||||
"compatibility": {
|
||||
"s": "True",
|
||||
"m": "True",
|
||||
"l": "True",
|
||||
"xl": "True"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from flask import Flask, jsonify, request, abort
|
||||
from os import chown
|
||||
from pwd import getpwnam
|
||||
from grp import getgrnam
|
||||
|
||||
class InstalledApp(object):
|
||||
|
||||
def __init__(self, flask):
|
||||
super(InstalledApp, self).__init__()
|
||||
|
||||
# default homepage
|
||||
self.homepage = 'file:///assets/data/index.html';
|
||||
|
||||
# connect flask routes to tooloop api calls
|
||||
self.add_routes(flask)
|
||||
|
||||
|
||||
|
||||
def add_routes(self, flask):
|
||||
|
||||
@flask.route('/simple-kiosk/change-homepage', methods=['POST'])
|
||||
def change_homepage():
|
||||
if not request.form or not 'homepage' in request.form:
|
||||
abort(400)
|
||||
|
||||
try:
|
||||
self.homepage = request.form['homepage'];
|
||||
|
||||
file = open('/assets/presentation/reset-kiosk.sh','w')
|
||||
|
||||
file.write('#!/bin/bash\n')
|
||||
file.write('\n')
|
||||
file.write('URL="'+self.homepage+'"\n')
|
||||
file.write('\n')
|
||||
file.write('# List of Chromium Command Line Switches\n')
|
||||
file.write('# https://peter.sh/experiments/chromium-command-line-switches/\n')
|
||||
file.write('COMMAND="chromium-browser \\\n')
|
||||
file.write('--kiosk \\\n')
|
||||
file.write('--bwsi \\\n')
|
||||
file.write('--overscroll-history-navigation=1 \\\n')
|
||||
file.write('--incognito \\\n')
|
||||
file.write('--disable-infobars \\\n')
|
||||
file.write('--disable-translate \\\n')
|
||||
file.write('--no-default-browser-check \\\n')
|
||||
file.write('--no-first-run \\\n')
|
||||
file.write('--disable-translate-new-ux \\\n')
|
||||
file.write('--num-raster-threads=4 \\\n')
|
||||
file.write('--enable-zero-copy \\\n')
|
||||
file.write('--noerrdialogs \\\n')
|
||||
file.write('--class=TooloopKiosk \\\n')
|
||||
file.write('$URL"\n')
|
||||
file.write('\n')
|
||||
file.write('if [ $EUID == 0 ]; then\n')
|
||||
file.write(' pkill chromium\n')
|
||||
file.write(' sleep 0.1\n')
|
||||
file.write(' su tooloop -c "$COMMAND" &\n')
|
||||
file.write('else\n')
|
||||
file.write(' pkill chromium\n')
|
||||
file.write(' sleep 0.1\n')
|
||||
file.write(' $COMMAND &\n')
|
||||
file.write('fi\n')
|
||||
file.write('\n')
|
||||
file.write('exit 0\n')
|
||||
|
||||
file.close()
|
||||
|
||||
uid = getpwnam('tooloop').pw_uid
|
||||
gid = getgrnam('tooloop').gr_gid
|
||||
chown('/assets/presentation/reset-kiosk.sh', uid, gid)
|
||||
|
||||
return jsonify({'message':'homepage changed'})
|
||||
|
||||
except Exception as e:
|
||||
abort(500)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -0,0 +1,43 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<table class="settings-table">
|
||||
<tr><td colspan="2"><h2>{{installed_app.name}}</h2></td></tr>
|
||||
|
||||
<tr>
|
||||
<td class="label-column" style="vertical-align: top; padding-top: 1.1em;">Homepage</td>
|
||||
<td class="value-column">
|
||||
<form id="homepage-form">
|
||||
<input type="text" id="homepage-input" value="{{app_controller.homepage}}">
|
||||
<button type="submit">Save</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block page_footer_scripts %}
|
||||
<script type="text/javascript">
|
||||
|
||||
$('#homepage-form').on('submit', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var feedback = attachFeedback(event.target);
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
data: { "homepage":$('#homepage-input').val() },
|
||||
url: "/simple-kiosk/change-homepage"
|
||||
}).done(function( data ) {
|
||||
displayConfirmFeedback(feedback, 'Saved');
|
||||
$.ajax( {url:"/tooloop/api/v1.0/presentation/reset"} );
|
||||
}).error(function( jqXHR, textStatus, errorThrown ) {
|
||||
displayErrorFeedback(feedback, errorThrown);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user