-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon-cheatcodes
executable file
·207 lines (180 loc) · 4.31 KB
/
common-cheatcodes
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME="common-cheatcodes"
###
# source distro-defaults
###
if [ -r /etc/default/distro ]; then
. /etc/default/distro
fi
###
# source lsb functions
###
. /lib/lsb/init-functions
###
# source fll functions
###
. /lib/init/fll
###
# read in variables from /etc/default/fll-locales
###
if [ -r /etc/default/fll-locales ]; then
. /etc/default/fll-locales
fi
FLL_LIVE_USER_HOME=$(getent passwd ${FLL_LIVE_USER} | cut -d \: -f 6)
###
# cheatcode handling
###
for param in $(cat /proc/cmdline); do
case "${param}" in
flldebug=*)
if [ "${param#flldebug=}" = "${NAME}" ] || [ "${param#flldebug=}" = "all" ]; then
fll_redirect
fi
;;
nointro)
NOINTRO="nointro"
;;
esac
done
no_intro()
{
for mntpnt in /fll/*; do
if [ -d "${mntpnt}" ] && [ -f "${mntpnt}/index.html" ]; then
INDEXFILE="${mntpnt}/index.html"
for ext in svg png gif ico; do
if [ -f "${mntpnt}/${FLL_CDROM_INDEX_ICON}.${ext}" ]; then
INDEXICON="${mntpnt}/${FLL_CDROM_INDEX_ICON}.${ext}"
break
fi
done
break
fi
done
###
# create desktop shortcut to index.html
###
if [ -f "${INDEXFILE}" ] && [ ! -f "${FLL_LIVE_USER_HOME}/Desktop/${FLL_DISTRO_NAME}.desktop" ]; then
[ ! -d ${FLL_LIVE_USER_HOME}/Desktop ] && sudo -u ${FLL_LIVE_USER} mkdir ${FLL_LIVE_USER_HOME}/Desktop
cat > "${FLL_LIVE_USER_HOME}/Desktop/${FLL_DISTRO_NAME}.desktop" <<EOF
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Type=Application
Exec=x-www-browser file:${INDEXFILE}
Icon=${INDEXICON}
Terminal=0
Name=${FLL_CDROM_INDEX}
GenericName=${FLL_CDROM_INDEX}
EOF
chmod 755 "${FLL_LIVE_USER_HOME}/Desktop/${FLL_DISTRO_NAME}.desktop"
chown ${FLL_LIVE_USER} "${FLL_LIVE_USER_HOME}/Desktop/${FLL_DISTRO_NAME}.desktop"
chgrp ${FLL_LIVE_USER} "${FLL_LIVE_USER_HOME}/Desktop/${FLL_DISTRO_NAME}.desktop"
echo "Release Notes scheduled for start."
fi
}
set_hidpi() {
RESOLUTION=$(fbset -s | awk -F '"' 'FNR == 2 {print $2}'| cut -c -4)
echo Resolution: $RESOLUTION > /tmp/livesettings.txt
if [ "$RESOLUTION" -ge 3440 ]; then
for file in /home/${FLL_LIVE_USER}/.config/kdeglobals /etc/skel/.config/kdeglobals
do
cat <<'EOF' > "$file"
[KScreen]
ScaleFactor=2
ScreenScaleFactors=-1eDP-1=2;HDMI-1=2;DP-1=2;HDMI-2=2;DP-2=2;HDMI-3=2;DP-3=2;HDMI-4=2;DP-4=2;Virtual-1=2;
EOF
done
for file in /home/${FLL_LIVE_USER}/.config/kcmfonts /etc/skel/.config/kcmfonts
do
cat <<'EOF' > "$file"
[General]
forceFontDPI=192
EOF
done
for file in /home/${FLL_LIVE_USER}/.config/kcminputrc /etc/skel/.config/kcminputrc
do
cat <<'EOF' > "$file"
[Mouse]
cursorSize=48
EOF
done
cat <<'EOF' >> /etc/sddm.conf.d/kde_settings.conf
[X11]
EnableHiDPI=true
ServerArguments=-dpi 192
EOF
else
if [ "$RESOLUTION" -ge 2040 ]; then
for file in /home/${FLL_LIVE_USER}/.config/kdeglobals /etc/skel/.config/kdeglobals
do
cat <<'EOF' > "$file"
[KScreen]
ScaleFactor=1.5
ScreenScaleFactors=eDP-1=1.5;HDMI-1=1.5;DP-1=1.5;HDMI-2=1.5;DP-2=1.5;HDMI-3=2;DP-3=1.5;HDMI-4=1.5;DP-4=1.5;Virtual-1=1.5;
EOF
done
for file in /home/${FLL_LIVE_USER}/.config/kcmfonts /etc/skel/.config/kcmfonts
do
cat <<'EOF' > "$file"
[General]
forceFontDPI=144
EOF
done
for file in /home/${FLL_LIVE_USER}/.config/kcminputrc /etc/skel/.config/kcminputrc
do
cat <<'EOF' > "$file"
[Mouse]
cursorSize=36
EOF
done
cat <<'EOF' >> /etc/sddm.conf.d/kde_settings.conf
[X11]
EnableHiDPI=true
ServerArguments=-dpi 144
EOF
else
echo kein HiDPI > /tmp/livesettings-2-txt
fi
fi
chown -R ${FLL_LIVE_USER}.${FLL_LIVE_USER} /home/${FLL_LIVE_USER}
}
hack_kde()
{
if [ $LANG = "de_DE.UTF-8" ] || [ $LANG = "de_DE.utf8" ]; then
cat > /home/tux/.config/plasma-localerc <<EOF
[Formats]
LANG=de_DE.UTF-8
[Translations]
LANGUAGE=de:en_US
EOF
fi
mkdir -p /home/${FLL_LIVE_USER}/.config/autostart/
cp -a /usr/share/siduction/user-dirs.desktop /home/${FLL_LIVE_USER}/.config/autostart/
chown -R ${FLL_LIVE_USER}.${FLL_LIVE_USER} /home/${FLL_LIVE_USER}
}
do_start()
{
if [ -z "${NOINTRO}" ]; then
no_intro
fi
}
case "${1}" in
start)
log_daemon_msg "${NAME}"
set_hidpi
hack_kde
do_start
log_end_msg "${?}"
;;
stop)
;;
restart|force-reload)
echo "Error: argument '${1}' not supported" >&2
exit 3
;;
*)
echo "Usage: ${NAME} {start|stop}" >&2
exit 3
;;
esac