-
Notifications
You must be signed in to change notification settings - Fork 0
/
chrome_kiosk_disable_restore.sh
executable file
·57 lines (41 loc) · 1.23 KB
/
chrome_kiosk_disable_restore.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
set -e
if [ $# -ne 2 ]
then
echo "Dette script skal bruge to parametre: brugernavn og hjemmeside"
exit -1
fi
user=$1
site=$2
# Create exec script for Chrome
cat <<CHROME-EXEC > /home/$user/.chrome.sh
#!/usr/bin/env bash
# Rotate screen
xrandr -o left
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/$user/.config/google-chrome/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"None"/' /home/$user/.config/google-chrome/Default/Preferences
sed -i 's/"restore_on_startup":[0-9]/"restore_on_startup":0/' /home/$user/.config/google-chrome/Default/Preferences
google-chrome --kiosk $site --full-screen --password-store=basic
CHROME-EXEC
chmod +x /home/$user/.chrome.sh
# Make the Chrome-script autostart
autostart_dir=/home/$user/.config/autostart
if [ ! -d "$autostart_dir" ]
then
mkdir -p $autostart_dir
fi
rm -f $autostart_dir/*chrome*
cat <<CHROME-DESKTOP > $autostart_dir/chrome.desktop
[Desktop Entry]
Type=Application
Exec=/home/$user/.chrome.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=Chrome
Name=Chrome
Comment[en_US]=run the Google-chrome webbrowser at startup
Comment=run the Google-chrome webbrowser at startup
Name[en]=Chrome
CHROME-DESKTOP
exit 0