summarylogtreecommitdiffstats
path: root/fbcondecor.daemon
blob: 39a441d61a9bce153b7733414cd6eae7ba014b5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash

# /etc/rc.d/fbcondecor

# Set FbConDecor backgrounds
#

. /etc/rc.conf
. /etc/rc.d/functions.d/fbsplash-basic.sh
. /etc/conf.d/fbcondecor
. /usr/bin/splash-functions.sh

splash_setup force

retval=0
[ -z "${SPLASH_TTYS%% }" ] && retval=1
case "$1"
in start )
	if [ "${SPLASH_MODE_REQ}" != "off" ]; then
		stat_busy "Setting FBconDecor console images"
		for tty in ${SPLASH_TTYS}; do
			# avoid blinking on boot
			[[ "$( fbcondecor_ctl --tty=${tty} -c getstate )" == *\ on ]] && continue
			fbcondecor_set_theme ${SPLASH_THEME} ${tty} || retval=1
		done
		if [ $retval = 0 ]; then
			stat_done
		else
			stat_fail
		fi
	fi
;; stop )
	stat_busy "Disabling FBconDecor console images"
	for tty in ${SPLASH_TTYS}; do
		# avoid errors on restart
		[[ "$( fbcondecor_ctl --tty=${tty} -c getstate )" == *\ off ]] && continue
		fbcondecor_ctl --tty=${tty} -c off || retval=1
	done
	if [ $retval = 0 ]; then
		stat_done
	else
		stat_fail
	fi
;; restart )
	$0 stop
	sleep .1
	echo # don't swallow our status line
	$0 start
;; * )
	echo "usage: $0 {start|stop|restart}"
esac

exit 0

# EOF #