@@ -19,7 +19,7 @@ if ! id $USER &>/dev/null; then
19
19
fi
20
20
21
21
# Autologin default user
22
- mkdir -
p /etc/systemd/system/
[email protected]
22
+ mkdir -
-parents /etc/systemd/system/
[email protected]
23
23
24
24
# Note: The empty ExecStart is not insignificant!
25
25
# By default the value is appended, so the empty line changes it to an override
32
32
33
33
# Create script to rotate screen
34
34
35
- cat << EOF > /usr/local/bin/rotate_screen.sh
35
+ ROTATE_SCREEN_SCRIPT_PATH=" /usr/share/os2borgerpc/bin/rotate_screen.sh"
36
+ OLD_ROTATE_SCREEN_SCRIPT_PATH=" /usr/local/bin/rotate_screen.sh"
37
+
38
+ # ...remove the rotate script from its previous location
39
+ rm --force $OLD_ROTATE_SCREEN_SCRIPT_PATH
40
+
41
+ cat << EOF > $ROTATE_SCREEN_SCRIPT_PATH
36
42
#!/usr/bin/env sh
37
43
38
44
set -x
39
45
40
- sleep $TIME
46
+ TIME=\$ 1
47
+ ORIENTATION=\$ 2
48
+
49
+ sleep \$ TIME
41
50
42
51
export XAUTHORITY=/home/$USER /.Xauthority
43
52
@@ -50,22 +59,22 @@ OTHER_MONITORS=\$(echo "\$ALL_MONITORS" | tail -n +2)
50
59
echo "\$ OTHER_MONITORS" | xargs -I {} xrandr --output {} --same-as "\$ PRIMARY_MONITOR"
51
60
52
61
# Rotate screen - and if more than one monitor, rotate them all.
53
- echo "\$ ALL_MONITORS" | xargs -I {} xrandr --output {} --rotate $ORIENTATION
62
+ echo "\$ ALL_MONITORS" | xargs -I {} xrandr --output {} --rotate \ $ ORIENTATION
54
63
EOF
55
64
56
- chmod +x /usr/local/bin/rotate_screen.sh &
65
+ chmod +x $ROTATE_SCREEN_SCRIPT_PATH
57
66
58
67
59
68
# Create a script dedicated to launch chromium, which both xinit or any wm
60
69
# launches, to avoid logic duplication, fx. having to update chromium settings
61
70
# in multiple files
62
71
# If this script's path/name is changed, remember to change it in
63
72
# wm_keyboard_install.sh as well
64
- #
65
- # password-store=basic and enable-offline-auto-reload do not exist as policies so we add them as flags.
66
73
CHROMIUM_SCRIPT=' /usr/share/os2borgerpc/bin/start_chromium.sh'
67
74
mkdir --parents " $( dirname " $CHROMIUM_SCRIPT " ) "
68
75
76
+ # TODO: Make URL a policy instead ("RestoreOnStarupURLs", see chrome_install.sh)
77
+ # password-store=basic and enable-offline-auto-reload do not exist as policies so we add them as flags.
69
78
cat << EOF > "$CHROMIUM_SCRIPT "
70
79
#!/bin/sh
71
80
@@ -94,11 +103,11 @@ xset s off
94
103
xset s noblank
95
104
xset -dpms
96
105
97
- # Dev note: We used to have "sleep 20" here but we removed it.
106
+ # Dev note: We used to have "sleep 20" hardcoded here but we removed it.
98
107
# Re-add if it causes timing issues. That said such potential issues should be
99
108
# solveable simple by raising the sleep parameter to rotate_screen.sh
100
109
101
- /usr/local/bin/rotate_screen.sh
110
+ $ROTATE_SCREEN_SCRIPT_PATH $TIME $ORIENTATION
102
111
103
112
# Launch chromium with its non-WM settings
104
113
exec $CHROMIUM_SCRIPT nowm
0 commit comments