From 0411cae32be1053c3b5ad788a06a830591df4769 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Wed, 28 Jul 2021 14:44:04 +0200 Subject: switcher for easier lulz and unlulz in case of management presence --- peps/README.md | 14 ++++++++++++++ peps/usr/local/bin/1920megapixel | 4 ++++ peps/usr/local/bin/browser-launcher | 5 +---- peps/usr/local/bin/grafana | 5 +++++ peps/usr/local/bin/keinepeps | 11 +++++++++++ peps/usr/local/bin/peps | 11 +++++++++++ 6 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 peps/README.md create mode 100755 peps/usr/local/bin/1920megapixel mode change 100755 => 120000 peps/usr/local/bin/browser-launcher create mode 100755 peps/usr/local/bin/grafana create mode 100755 peps/usr/local/bin/keinepeps create mode 100755 peps/usr/local/bin/peps diff --git a/peps/README.md b/peps/README.md new file mode 100644 index 0000000..f6675a2 --- /dev/null +++ b/peps/README.md @@ -0,0 +1,14 @@ +# Prerequisites + +Install LXDE and Chromium-Browser without recommendations. Set up the RaspBi to auto-login a user with X. +Then use the files in here to have him auto-launch Chromium with the desired URLs. + +# Details + +1. /usr/local/bin/browser-launcher is being used to launch the browser +1. /usr/local/bin/peps will make the above a symlink to a script launching a website with great lulz +1. /usr/local/bin/keinepeps will make that symlink redirect to something more serious +1. /etc/xdg/lxsession/LXDE/autostart will launch the above-mentioned symlink +1. /home/user/.config/lxsession/LXDE/autostart will symlink to the /etc file. Replace "user" with the actual + auto-login user. Why this file? Otherwise, it will be created with the /etc content upon creation and then + be a file (inode) of its own. diff --git a/peps/usr/local/bin/1920megapixel b/peps/usr/local/bin/1920megapixel new file mode 100755 index 0000000..6b32d04 --- /dev/null +++ b/peps/usr/local/bin/1920megapixel @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +/usr/bin/chromium-browser --kiosk --disable-restore-session-state file:///usr/share/playlist.html \ + --autoplay-policy=no-user-gesture-required --no-gesture-required diff --git a/peps/usr/local/bin/browser-launcher b/peps/usr/local/bin/browser-launcher deleted file mode 100755 index 6b32d04..0000000 --- a/peps/usr/local/bin/browser-launcher +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh - -/usr/bin/chromium-browser --kiosk --disable-restore-session-state file:///usr/share/playlist.html \ - --autoplay-policy=no-user-gesture-required --no-gesture-required diff --git a/peps/usr/local/bin/browser-launcher b/peps/usr/local/bin/browser-launcher new file mode 120000 index 0000000..a6eb9f7 --- /dev/null +++ b/peps/usr/local/bin/browser-launcher @@ -0,0 +1 @@ +1920megapixel \ No newline at end of file diff --git a/peps/usr/local/bin/grafana b/peps/usr/local/bin/grafana new file mode 100755 index 0000000..4c6eb39 --- /dev/null +++ b/peps/usr/local/bin/grafana @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +# Here we place a more serious link, e.g. the original purpose of your display :-) Below example is a Grafana playlist. + +/usr/bin/chromium-browser --kiosk --disable-restore-session-state https://url-to-grafana/playlists/play/1?autofitpanels diff --git a/peps/usr/local/bin/keinepeps b/peps/usr/local/bin/keinepeps new file mode 100755 index 0000000..c539c0b --- /dev/null +++ b/peps/usr/local/bin/keinepeps @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +rm -vf /usr/local/bin/browser-launcher||exit 1 +ln -vsf grafana /usr/local/bin/browser-launcher||exit 2 +printf "Restarting LightDM in " +for i in {5..1};do + printf "$i..." + sleep 1 +done +printf "\\n" +systemctl restart lightdm.service diff --git a/peps/usr/local/bin/peps b/peps/usr/local/bin/peps new file mode 100755 index 0000000..1cd3eb4 --- /dev/null +++ b/peps/usr/local/bin/peps @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +rm -vf /usr/local/bin/browser-launcher||exit 1 +ln -vsf 1920megapixel /usr/local/bin/browser-launcher||exit 2 +printf "Restarting LightDM in " +for i in {5..1};do + printf "$i..." + sleep 1 +done +printf "\\n" +systemctl restart lightdm.service -- cgit v1.2.3