From f9457ebf7bd3aaa0ed5c1f1854d4025777c1422b Mon Sep 17 00:00:00 2001 From: Steffen Probst Date: Tue, 7 Sep 2021 16:03:42 +0200 Subject: [PATCH] =?UTF-8?q?Einstellungen=20f=C3=BCr=20raspian/pi=20angepas?= =?UTF-8?q?st?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- boot/client-cfg/xinitrc | 33 +++++++++++++++++++++++---------- etc/rc.local | 20 +++++++++++++++++--- home/thinnote/xinitrc | 1 - 3 files changed, 40 insertions(+), 14 deletions(-) delete mode 120000 home/thinnote/xinitrc diff --git a/boot/client-cfg/xinitrc b/boot/client-cfg/xinitrc index d3bbb37..8053251 100644 --- a/boot/client-cfg/xinitrc +++ b/boot/client-cfg/xinitrc @@ -3,21 +3,34 @@ while true; do # Clean up previously running apps, gracefully at first then harshly - killall -TERM chromium 2>/dev/null; + which chromium /dev/null && killall -TERM chromium 2>/dev/null; + which chromium-browser /dev/null && killall -TERM chromium-browser 2>/dev/null; killall -TERM matchbox-window-manager 2>/dev/null; sleep 2; - killall -9 chromium 2>/dev/null; + which chromium > /dev/null && killall -9 chromium 2>/dev/null; + which chromium-browser > /dev/null && killall -9 chromium-browser 2>/dev/null; killall -9 matchbox-window-manager 2>/dev/null; # Clean out existing profile information - rm -rf /home/thinnote/.cache; - rm -rf /home/thinnote/.config; - rm -rf /home/thinnote/.pki; + if [ -d /home/pi ]; then + rm -rf /home/pi/.cache; + rm -rf /home/pi/.config; + rm -rf /home/pi/.pki; + else + rm -rf /home/thinnote/.cache; + rm -rf /home/thinnote/.config; + rm -rf /home/thinnote/.pki; + fi + # Generate the bare minimum to keep Chromium happy! - mkdir -p /home/thinnote/.config/chromium/Default - sqlite3 /home/thinnote/.config/chromium/Default/Web\ Data "CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); INSERT INTO meta VALUES('version','46'); CREATE TABLE keywords (foo INTEGER);"; - + if [ -d /home/pi ]; then + mkdir -p /home/pi/.config/chromium/Default + sqlite3 /home/pi/.config/chromium/Default/Web\ Data "CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); INSERT INTO meta VALUES('version','46'); CREATE TABLE keywords (foo INTEGER);"; + else + mkdir -p /home/thinnote/.config/chromium/Default + sqlite3 /home/thinnote/.config/chromium/Default/Web\ Data "CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); INSERT INTO meta VALUES('version','46'); CREATE TABLE keywords (foo INTEGER);"; + fi # Disable DPMS / Screen blanking xset -dpms xset s off @@ -35,7 +48,7 @@ while true; do # Start the browser (See http://peter.sh/experiments/chromium-command-line-switches/) - #chromium-browser --app="https://wiki.lebenshilfe-bbg.de/wiki/doku.php?id=hidden:portal" - chromium --app="https://wiki.lebenshilfe-bbg.de/wiki/doku.php?id=hidden:portal" + which chromium-browser > /dev/null && chromium-browser --app="https://wiki.lebenshilfe-bbg.de/wiki/doku.php?id=hidden:portal" + which chromium > /dev/null && chromium --app="https://wiki.lebenshilfe-bbg.de/wiki/doku.php?id=hidden:portal" done; diff --git a/etc/rc.local b/etc/rc.local index fe1acd2..7d738cb 100755 --- a/etc/rc.local +++ b/etc/rc.local @@ -11,6 +11,8 @@ # # By default this script does nothing. +which chromium-browser > /dev/null && [ -d /etc/chromium ] && mv /etc/chromium/ /etc/chromium-browser + sleep 10 @@ -26,7 +28,14 @@ fi #fi #Hostname wird anhand des WLAN0 erstell / kann auch entsprechend auf anderes Geraet umgestellt werden -echo thin$(cat /sys/class/net/wlan0/address | sed '/://g') > /tmp/hostname && hostname --file /tmp/hostname +#ip a s wlan1 2&>1 /dev/null || +#Check einbauen der aktive Verbindung prüft +if [ -d /home/pi ]; then + echo pi$(cat /sys/class/net/wlan0/address | sed '/://g') > /tmp/hostname && hostname --file /tmp/hostname +else + echo thin$(cat /sys/class/net/wlan0/address | sed '/://g') > /tmp/hostname && hostname --file /tmp/hostname +fi + #Fuer eth0, wenn kein WLAN vorhanden ist. Kann dann auskommentiert werden. #echo rpi$(cat /sys/class/net/eth0/address | sed '/://g') > /tmp/hostname && hostname --file /tmp/hostname @@ -34,8 +43,13 @@ echo thin$(cat /sys/class/net/wlan0/address | sed '/://g') > /tmp/hostname && ho # start X environment if [ -f /boot/client-cfg/xinitrc ]; then - ln -fs /boot/client-cfg/xinitrc /home/thinnote/.xinitrc; - su -l thinnote -s /bin/bash -c 'startx -- vt1' & + if [ -d /home/pi ]; then + ln -fs /boot/client-cfg/xinitrc /home/pi/.xinitrc; + su -l pi -s /bin/bash -c 'startx -- vt1' & + else + ln -fs /boot/client-cfg/xinitrc /home/thinnote/.xinitrc; + su -l thinnote -s /bin/bash -c 'startx -- vt1' & + fi fi exit 0 diff --git a/home/thinnote/xinitrc b/home/thinnote/xinitrc deleted file mode 120000 index 119f5cc..0000000 --- a/home/thinnote/xinitrc +++ /dev/null @@ -1 +0,0 @@ -../../boot/client-cfg/xinitrc \ No newline at end of file