aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/switch-themes
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2003-08-26 11:06:17 +0000
committerFlorent Villard <warly@mandriva.com>2003-08-26 11:06:17 +0000
commit97c3eeb99a45bc2dcdc67d90c161d0e69d3ca153 (patch)
tree05eda5154ede93f96b451ef9f5272b6b71ebcb25 /scripts/switch-themes
parent07895b95bdff958d1b7189d07957107f27898b1b (diff)
downloadbootsplash-97c3eeb99a45bc2dcdc67d90c161d0e69d3ca153.tar
bootsplash-97c3eeb99a45bc2dcdc67d90c161d0e69d3ca153.tar.gz
bootsplash-97c3eeb99a45bc2dcdc67d90c161d0e69d3ca153.tar.bz2
bootsplash-97c3eeb99a45bc2dcdc67d90c161d0e69d3ca153.tar.xz
bootsplash-97c3eeb99a45bc2dcdc67d90c161d0e69d3ca153.zip
set Esc as the key to swich to verbose mode
improve switch-theme so that it can be used in post of mandrake_theme packages remove images and config files
Diffstat (limited to 'scripts/switch-themes')
-rwxr-xr-xscripts/switch-themes40
1 files changed, 31 insertions, 9 deletions
diff --git a/scripts/switch-themes b/scripts/switch-themes
index 3492e09..273044c 100755
--- a/scripts/switch-themes
+++ b/scripts/switch-themes
@@ -40,23 +40,22 @@ function lilo_switch_themes () {
if [[ ! -f $message_from_theme ]];then
return;
fi
- if [[ ! -e $bootdir/lilo ]];then
+ if [[ ! -e $bootdir/message ]];then
return;
fi
#Make sure to point on lilo-graphic
- if [[ -L $bootdir/lilo ]];then
- point_to=$(read_link $bootdir/lilo)
+ if [[ -L $bootdir/message ]];then
+ point_to=$(read_link $bootdir/message)
if [[ $point_to != lilo-graphic ]];then
- rm -f $bootdir/lilo
- ln -s lilo-graphic $bootdir/lilo
+ rm -f $bootdir/message
+ ln -s lilo-graphic $bootdir/message
fi
fi
if ! cmp -s $message_from_theme $message_from_current;then
cp -f $message_from_theme $message_from_current
fi
-
}
function check_it () {
@@ -89,6 +88,11 @@ function switch_theme () {
tmpfile=$(mktemp /tmp/.bootsplash.XXXXXXX)
cp -f $sysconfig $tmpfile && rm -f $sysconfig
while read line;do
+ if [[ $line == SPLASH=* ]];then
+ echo "SPLASH=auto" >> $sysconfig
+ ok=yes
+ continue;
+ fi
if [[ $line == THEME=* ]];then
echo "THEME=$toswitch" >> $sysconfig
ok=yes
@@ -100,13 +104,30 @@ function switch_theme () {
echo "THEME=$toswitch" >> $sysconfig
fi
rm -f $tmpfile
- if [[ -d /etc/bootsplash/$toswitch ]]; then
- rm -f /etc/bootsplash/current
- ln -s /etc/bootsplash/$toswitch current
+ if [[ -d /etc/bootsplash/themes/$toswitch ]]; then
+ rm -f /etc/bootsplash/themes/current
+ ln -s /etc/bootsplash/themes/$toswitch current
fi
fi
}
+function update_boot () {
+ pushd /boot &> /dev/null
+ if [[ -x /usr/share/loader/make-initrd ]]; then
+ /usr/share/loader/make-initrd -n &> /dev/null
+ if [[ -x /usr/sbin/detectloader ]]; then
+ LOADER=$(/usr/sbin/detectloader -q)
+ if [[ $LOADER = "LILO" ]] && [[ -x /sbin/lilo ]];then
+ /sbin/lilo >/dev/null 2>/dev/null
+ fi
+ if [[ $LOADER = "YABOOT" ]] && [[ -x /sbin/ybin ]];then
+ /sbin/ybin >/dev/null 2>/dev/null
+ fi
+ fi
+ fi
+ popd &> /dev/null
+}
+
function usage () {
basename=`basename $0`
cat <<EOF
@@ -154,3 +175,4 @@ fi
check_it $theme
switch_theme $theme
+update_boot