2 if [[ -x /bin/plymouth && -x /sbin/plymouthd ]]; then
4 ply_client() { /bin/plymouth --ping && /bin/plymouth "$@"; }
5 ply_daemon() { /sbin/plymouthd "$@"; }
7 # save a function under a new name
9 local ORIG=$(declare -f $1)
13 save_function stat_busy std_stat_busy
14 save_function stat_fail std_stat_fail
16 # overwrite status functions
18 ply_client --update="$1"
19 ply_client message --text="$1"
28 # update after local filesystems are mounted
29 ply_sysinit_postmount() { ply_client --sysinit; }
30 add_hook sysinit_postmount ply_sysinit_postmount
32 # stop plymouth after rc.multi
34 ply_client quit --retain-splash
36 add_hook multi_end ply_quit_boot
38 # stop plymouth before shutdown
41 [[ $(ps h $(cat /tmp/plymouthd)) ]] && kill -9 $(cat /tmp/plymouthd)
43 add_hook shutdown_poweroff ply_quit_shutdown
45 # start plymouth at the beginning of rc.shutdown
49 if [ "`runlevel | cut -c 3`" != '5' ]; then
51 for DM in slim gdm kdm xdm entrance; do
52 ck_daemon "$DM" || stop_daemon "$DM"
55 kill -9 $XPID &> /dev/null
57 ply_daemon --mode=shutdown --pid-file=/tmp/plymouthd
58 ply_client --show-splash
60 # don't get killed by kill_all
61 add_omit_pids `cat /tmp/plymouthd`
63 add_hook shutdown_start ply_shutdown_start
66 # vim: set ts=2 sw=2 ft=sh noet: