#!/sbin/openrc-run

name="buffyboard"
command="/usr/bin/buffyboard"
command_args="-r $(cat /sys/class/graphics/fbcon/rotate)"
pidfile="/var/run/buffyboard.pid"
command_background=true

depend()
{
	after consolefont
	keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
}

start_pre()
{
	# Setup kernel support for user level drivers (input subsystem)
	if [ ! -e /dev/uinput ]; then
		if ! modprobe -q uinput; then
			eerror "The uinput module needs to be loaded by " \
				"the buffyboard service or built in."
		fi
	fi
	# save energy
	echo 0 >/sys/class/graphics/fbcon/cursor_blink
}
