Skip to content

Commit 1eb9563

Browse files
committed
minor changes to README.md and some variable refactorings
1 parent 69b958f commit 1eb9563

File tree

3 files changed

+31
-30
lines changed

3 files changed

+31
-30
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@ Use a RaspberryPi to show a full-screen Slideshow (Kiosk-mode)
33

44

55
## Installation TL;DR
6-
Use Raspbian and chromium, don't use midori
6+
We assume you have a RaspberryPi with Raspbian installed and a working internet connection.
77
```bash
8-
sudo apt-get update && sudo apt-get dist-upgrade
9-
sudo apt-get install git vim ntpdate chromium-browser apache2 php libapache2-mod-php -y
8+
sudo apt-get update && sudo apt-get upgrade
9+
sudo apt-get install git ntpdate chromium-browser apache2 php libapache2-mod-php -y
1010

1111
git clone git@github.com:timluedtke/raspberryPiKioskSlideshow.git
1212
cd raspberryPiKioskSlideshow
1313
mv -r ./system/lxde-pi_autostart /home/pi/.config/lxsession/LXDE-pi/autostart
1414
```
1515

16+
### ntpdate
17+
To keep the clock of your RaspberryPi up to date we use ntpdate. This is a simple command line tool that sets the date and time via NTP (Network Time Protocol).
18+
1619
## Installation - step by step
1720
### Basic Setup
1821
For basic RaspberryPi setup you can use most of the available guides, for example this one:
@@ -32,10 +35,8 @@ However I used this one:
3235
- Install **nptupdate** to keep your Raspi-clock set correctly
3336

3437
```bash
35-
sudo apt-get update
36-
sudo apt-get upgrade
37-
sudo apt-get dist-upgrade
38-
sudo apt-get install git vim ntpdate chromium-browser apache2 php libapache2-mod-php -y
38+
sudo apt-get update && sudo apt-get upgrade
39+
sudo apt-get install git ntpdate chromium-browser apache2 php libapache2-mod-php -y
3940

4041
git clone git@github.com:timluedtke/raspberryPiKioskSlideshow.git
4142
cd raspberryPiKioskSlideshow
@@ -59,7 +60,7 @@ Based on this Guides:
5960
Everything slideshow-related happens in the ./files folder.
6061
- Put some images into the /files folder. Ideally with the same resultion of the screen (eg. 1920x1080px).
6162
- Edit the slideshow.txt
62-
- Every line starting with # is a comment line
63+
- Every line starting with # is a comment line (except the transition delay setting)
6364
- Every other line shall be either the filename (without path) OR a URL (eg: image.jpg OR https://timluedtke.de)
6465
- if you want you can set the transition delay in the comment-line to a different value (seconds): # setting-transition-delay=
6566

index.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,61 +33,61 @@
3333
</style>
3434
</head>
3535
<body>
36-
<iframe src="datetimenow.html" id="fristFrame" style="visibility: hidden;"></iframe>
36+
<iframe src="datetimenow.html" id="firstFrame" style="visibility: hidden;"></iframe>
3737
<iframe src="datetimenow.html" id="secondFrame" style="visibility: visible;"></iframe>
3838
<script type="text/javascript">
3939
var urls = [];
4040
<?php
41-
$steuerungsinfos = file("./files/slideshow.txt");
41+
$slideshow = file("./files/slideshow.txt");
4242
$outputSize = 0;
4343
$delay = 14 / 2 * 1000;
4444

45-
for ($i = 0; $i < count($steuerungsinfos); $i++) {
46-
if (!(substr($steuerungsinfos[$i], 0, 1) === "#")) {
47-
$enhancedUrl = trim($steuerungsinfos[$i]);
45+
for ($i = 0; $i < count($slideshow); $i++) {
46+
if (!(substr($slideshow[$i], 0, 1) === "#")) {
47+
$enhancedUrl = trim($slideshow[$i]);
4848
if (!(substr($enhancedUrl, 0, 4) === "http")) {
4949
$enhancedUrl = "./files/" . $enhancedUrl;
5050
}
5151
echo "urls[" . $outputSize . "] = '" . $enhancedUrl . "';\r\n";
5252
$outputSize++;
53-
} else if (substr($steuerungsinfos[$i], 0, 35) === "# setting-transition-delay=") {
54-
$delayvalue = substr($steuerungsinfos[$i], 35);
53+
} else if (substr($slideshow[$i], 0, 35) === "# setting-transition-delay=") {
54+
$delayvalue = substr($slideshow[$i], 35);
5555
$delay = $delayvalue / 2 * 1000;
5656
}
5757
}
5858
echo "var delay = " . $delay . ";\r\n";
5959
?>
60-
var urlaktuell = 0;
61-
setTimeout("loadIntoFristFrame()", 1000);
60+
var urlnow = 0;
61+
setTimeout("loadIntoFirstFrame()", 1000);
6262

63-
function loadIntoFristFrame() {
64-
document.getElementById('fristFrame').src = urls[urlaktuell];
65-
urlaktuell++;
66-
if (urlaktuell === urls.length) {
67-
urlaktuell = 0;
63+
function loadIntoFirstFrame() {
64+
document.getElementById('firstFrame').src = urls[urlnow];
65+
urlnow++;
66+
if (urlnow === urls.length) {
67+
urlnow = 0;
6868
}
6969
setTimeout("switchToFirstFrame()", delay);
7070
}
7171

7272
function switchToFirstFrame() {
73-
document.getElementById('fristFrame').style.visibility = 'visible';
73+
document.getElementById('firstFrame').style.visibility = 'visible';
7474
document.getElementById('secondFrame').style.visibility = 'hidden';
7575
setTimeout("loadIntoSecondFrame()", delay);
7676
}
7777

7878
function loadIntoSecondFrame() {
79-
document.getElementById('secondFrame').src = urls[urlaktuell];
80-
urlaktuell++;
81-
if (urlaktuell === urls.length) {
82-
urlaktuell = 0;
79+
document.getElementById('secondFrame').src = urls[urlnow];
80+
urlnow++;
81+
if (urlnow === urls.length) {
82+
urlnow = 0;
8383
}
8484
setTimeout("switchToSecondFrame()", delay);
8585
}
8686

8787
function switchToSecondFrame() {
88-
document.getElementById('fristFrame').style.visibility = 'hidden';
88+
document.getElementById('firstFrame').style.visibility = 'hidden';
8989
document.getElementById('secondFrame').style.visibility = 'visible';
90-
setTimeout("loadIntoFristFrame()", delay);
90+
setTimeout("loadIntoFirstFrame()", delay);
9191
}
9292
</script>
9393
</body>

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.0
1+
1.3.1

0 commit comments

Comments
 (0)