#!/bin/bash

#Plymouth
cd /usr/src/linux
make menuconfig
echo "PLYMOUTH=\"yes\"" >> /etc/genkernel.conf
echo "PLYMOUTH_THEME=\"bgrt\"" >> /etc/genkernel.conf
genkernel --kernel-config=$PWD/.config all
cd

#GRUB Plymouth entry
sed -i "s/.*GRUB_CMDLINE_LINUX_DEFAULT.*/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash\"/" /etc/default/grub
sed -i "s/.*GRUB_GFXMODE.*/GRUB_GFXMODE=\"1366x768x24\"/" /etc/default/grub
sed -i "s/.*GRUB_TIMEOUT.*/GRUB_TIMEOUT=0/" /etc/default/grub
sed -i "s/.*GRUB_GFXPAYLOAD_LINUX.*/GRUB_GFXPAYLOAD_LINUX=keep/" /etc/default/grub

#Root password
passwd root

#Automatic login
sed -i "3a AutomaticLoginEnable=true" /etc/gdm/custom.conf
sed -i "4a AutomaticLogin=root" /etc/gdm/custom.conf

#Enable GNOME Shell extensions on startup (workaround)
sed -i "22a \ \ gsettings set org.gnome.shell.enabled-extensions ['dash-to-panel@jderose9.github.com', 'user-theme@gnome-shell-extensions.gcampax.github.com', 'desktop-icons@csoriano']" /etc/gdm/Init/Default
