SpectreOS-old/startup

77 lines
2 KiB
Text
Raw Permalink Normal View History

2018-02-26 02:41:29 +01:00
#!/bin/bash
2018-08-26 19:40:55 +02:00
set -x
2018-02-26 02:41:29 +01:00
echo "Start!!!"
2018-05-05 00:20:09 +02:00
date >> /startup.log
2018-02-26 02:41:29 +01:00
2018-08-26 19:40:55 +02:00
startparameter=$(cat /proc/cmdline)
# for-schleife
2018-08-26 19:47:05 +02:00
for wort in ${startparameter}
do
2018-08-26 19:40:55 +02:00
echo "$wort"
export ${wort%=*}=${wort#*=}
echo "Parameter ${wort%=*} = ${wort#*=}"
2018-08-26 19:47:05 +02:00
done
2018-08-26 19:40:55 +02:00
if [ -n "${run}" ]; then
2018-08-26 19:47:05 +02:00
echo "${run}"
#sleep 5
${run}
2018-02-26 02:41:29 +01:00
fi
# Disable IPv6
#echo 0 > /proc/sys/net/ipv6/conf/wlan0/accept_ra
#echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
# tunneling
#echo 1 > /proc/sys/net/ipv4/ip_forward
if cat /proc/cmdline | grep "nvidia=y"; then
2018-08-26 19:47:05 +02:00
echo ":: nvidia driver loaded"
2018-02-26 02:41:29 +01:00
2018-08-26 19:47:05 +02:00
mkdir -p -m 755 /etc/X11/xorg.conf.d/
2018-02-26 02:41:29 +01:00
2018-08-26 19:47:05 +02:00
nvidia-xconfig
2018-02-26 02:41:29 +01:00
fi
echo ":: set graphical-desktop!"
mkdir -p -m 755 "/etc/X11/xinit"
if cat /proc/cmdline | grep "desktop=gnome"; then
2018-08-26 19:47:05 +02:00
echo "exec gnome-session" > /etc/X11/xinit/xinitrc
2018-02-26 02:41:29 +01:00
elif cat /proc/cmdline | grep "desktop=gnomeflash"; then
2018-08-26 19:47:05 +02:00
echo "export XDG_CURRENT_DESKTOP=GNOME-Flashback:GNOME" > /etc/X11/xinit/xinitrc
echo "exec gnome-session --session=gnome-flashback-metacity" >> /etc/X11/xinit/xinitrc
2018-02-26 02:41:29 +01:00
elif cat /proc/cmdline | grep "desktop=gnomeclassic"; then
2018-08-26 19:47:05 +02:00
echo "export XDG_CURRENT_DESKTOP=GNOME-Classic:GNOME" > /etc/X11/xinit/xinitrc
echo "export GNOME_SHELL_SESSION_MODE=classic" >> /etc/X11/xinit/xinitrc
echo "exec gnome-session --session=gnome-classic" >> /etc/X11/xinit/xinitrc
2018-02-26 02:41:29 +01:00
elif cat /proc/cmdline | grep "desktop=cinnamon"; then
2018-08-26 19:47:05 +02:00
echo "exec cinnamon-session" > /etc/X11/xinit/xinitrc
2018-02-26 02:41:29 +01:00
elif cat /proc/cmdline | grep "desktop=mate"; then
2018-08-26 19:47:05 +02:00
echo "exec mate-session" > /etc/X11/xinit/xinitrc
2018-02-26 02:41:29 +01:00
elif cat /proc/cmdline | grep "desktop=lxde"; then
2018-08-26 19:47:05 +02:00
echo "exec startlxde" > /etc/X11/xinit/xinitrc
2018-02-26 02:41:29 +01:00
elif cat /proc/cmdline | grep "desktop=lxqt"; then
2018-08-26 19:47:05 +02:00
echo "exec startlxqt" > /etc/X11/xinit/xinitrc
2018-02-26 02:41:29 +01:00
elif cat /proc/cmdline | grep "desktop=xfce4"; then
2018-08-26 19:47:05 +02:00
echo "exec startxfce4" > /etc/X11/xinit/xinitrc
2018-02-26 02:41:29 +01:00
elif cat /proc/cmdline | grep "desktop=kde"; then
2018-08-26 19:47:05 +02:00
echo "exec startkde" > /etc/X11/xinit/xinitrc
2018-02-26 02:41:29 +01:00
else
2018-08-26 19:47:05 +02:00
echo ":: default graphical-desktop"
2018-02-26 02:41:29 +01:00
fi