#!/bin/bash ### # This script switches from KDE to XFCE ### if [ `whoami` != root ]; then echo "YOU MUST BE ROOT TO USE THIS" exit fi if [ ! -z `grep -m1 -i onxfce1 /etc/conf.d/magic-database` ]; then export onxfce="true" else export onxfce="false" fi if [ $onxfce == "true" ]; then echo "XFCE is already enabled, exiting." exit fi if [ ! -z `grep -m1 -i xfce-patch3 /etc/conf.d/magic-database` ]; then ### # Update all default users (and future users) .xinitrc file # /s/startkde/xfce ### sed "s/startkde/startxfce4/" /etc/skel/.xinitrc > /tmp/xinitrc && rm -rf /etc/skel/.xinitrc && mv /tmp/xinitrc /etc/skel/.xinitrc && chmod 755 /etc/skel/.xinitrc sed "s/startkde/startxfce4/" /home/gentoox/.xinitrc > /tmp/xinitrc && rm -rf /home/gentoox/.xinitrc && mv /tmp/xinitrc /home/gentoox/.xinitrc && chmod 755 /home/gentoox/.xinitrc && chown gentoox:users /home/gentoox/.xinitrc sed "s/startkde/startxfce4/" /root/.xinitrc > /tmp/xinitrc && rm -rf /root/.xinitrc && mv /tmp/xinitrc /root/.xinitrc && chmod 755 /root/.xinitrc clear echo "onxfce1" >> /etc/conf.d/magic-database grep -vi onkde1 /etc/conf.d/magic-database >> /etc/conf.d/magic-database.tmp mv /etc/conf.d/magic-database.tmp /etc/conf.d/magic-database chown root:root /etc/conf.d/magic-database chmod 600 /etc/conf.d/magic-database echo "Running xbvset..." sleep 5 xbvset sleep 100 reboot ### # This should be enough time to halt the system without letting the script # continue or allow any human intervention! ### sleep 100 ### # Exit to be safe ### exit else echo "XFCE is not installed, please run magic" exit fi