-
Notifications
You must be signed in to change notification settings - Fork 2
/
xorg-cheatcodes
executable file
·76 lines (64 loc) · 1.74 KB
/
xorg-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
#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME="xorg-cheatcodes"
if [ -r /etc/default/distro ]; then
. /etc/default/distro
fi
. /lib/lsb/init-functions
. /lib/init/fll
systemctl stop wpa_supplicant.service
systemctl mask wpa_supplicant.service
systemctl stop NetworkManager.service
systemctl enable --now iwd.service
systemctl start NetworkManager.service
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() {
if [ -z "${NOINTRO}" ] ; then
[ ! -f ${FLL_LIVE_USER_HOME}/.config/autostart/${FLL_DISTRO_NAME}.desktop ] && \
sudo -u ${FLL_LIVE_USER} ln -sf "${FLL_LIVE_USER_HOME}/Desktop/${FLL_DISTRO_NAME}.desktop" \
"${FLL_LIVE_USER_HOME}/.config/autostart/"
elif [ -e "${FLL_LIVE_USER_HOME}/.config/autostart/${FLL_DISTRO_NAME}.desktop" ]; then
# toram + persistency
rm -f "${FLL_LIVE_USER_HOME}/.config/autostart/${FLL_DISTRO_NAME}.desktop"
fi
}
do_start() {
if [ -f ${FLL_LIVE_USER_HOME}/Desktop/${FLL_DISTRO_NAME}.desktop ]; then
no_intro
fi
}
case "${1}" in
start)
log_daemon_msg "${NAME}"
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