⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 splash.sh

📁 美化linux的kernel启动画面的程序
💻 SH
字号:
#!/bin/bash## splash.sh - This shell script triggers bootsplash actions during# system boot/shutdown. It can be run by the init scripts repeatedly# specifying the currently executed system script.# # This script is used to play animations/sounds/show text/move the# progress bar, etc.# # We call this function from /etc/rc.status:rc_splash() ## This program is free software; you may redistribute it under # the terms of the GNU General Public License. This program has # absolutely no warranty.## written 2002-2003 Stefan Reinauer, <stepan@suse.de>## this script expects the following environment variables for an operable# progress bar:##  sscripts = number of start scripts to be executed for runlevel change#  kscripts = number of stop scripts to be executed for runlevel change#  progress = number of currently executed start/stop script#  RUNLEVEL = runlevel to be reached.## To play animations, it's advised that you have an animations.cfg in your# theme's config directory specifying the initscript name for an event and# the command to be executed:##   fsck start:bootanim start bounce.mng#   master:bootanim stop## See http://www.bootsplash.org/ for more information.#_procsplash="`cat /proc/splash 2>/dev/null`"THEME="No bootsplash theme selected"test -f /etc/sysconfig/bootsplash && . /etc/sysconfig/bootsplashtest ! -d "/etc/bootsplash/themes/$THEME" && exit 0# parse animations.cfg. This part should not be handled by the# splash binary.if [ -f /etc/bootsplash/themes/$THEME/config/animations.cfg ]; then  COMMAND="`cat /etc/bootsplash/themes/$THEME/config/animations.cfg| grep "^$1"|cut -f2 -d\:`"  eval $COMMANDfi# assertionstest -r /proc/splash || exit 0test -z "$progress" -a -z "$num" && exit 0test -z "`echo $_procsplash|grep on`" && exit 0test "$1" == "bootnetwork stop" -o "$1" == "YaST" && exit 0 # no progress# We chose verbose in grubtest "`cat /proc/cmdline |grep \"splash=silent\"`" == "" && exit 0 if [ "$PREVLEVEL" == "3" -o "$PREVLEVEL" == "5" ] ; then  if [ "$RUNLEVEL"  = "3" -o "$RUNLEVEL" == "5" ] ; then    exit 0  fifi# acquire data# num=$(( $sscripts + 2 ))_shutdown="no"_silent="no"test "`cat /proc/splash |grep silent`" && _silent="yes"test "$RUNLEVEL" == "6" -o "$RUNLEVEL" == "0" && _shutdown="yes"test "$_shutdown" == "yes" && num=$(( $kscripts + 2 ))function box() { true; } # ignore box descriptions in the config filetest -f "/etc/bootsplash/themes/$THEME/config/bootsplash-`fbresolution`.cfg" && \  . /etc/bootsplash/themes/$THEME/config/bootsplash-`fbresolution`.cfg## Print text string. (Booting/Shutting down the system. Press# F2 for verbose mode)#if [ "$progress" == 1 -o "$1" == "splash start" ]; then  test "$_shutdown" == "yes" && ( echo "silent" >/proc/splash; chvt 1)  _boot="Booting"; test "$_shutdown" == "yes" && _boot="Shutting down"  if [ "$text_x" != "" -a "$text_y" != "" \       -a "$text_color" != "" -a "$text_size" != "" -a "$_silent" == "yes" ];   then    fbtruetype -x $text_x -y $text_y -t $text_color -s $text_size \  			"$_boot the system... Press F2 for verbose mode"  fifi## Now paint the progressbar. This is done via the proc # interface of the bootsplash.#test -z "$progress_enable" && exit 0echo "show $(( 65534 * ( $progress + 1 ) / $num ))" > /proc/splash

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -