summaryrefslogtreecommitdiff
path: root/app-laptop/tiny-dfr/files/tiny-dfr.initd
blob: dd5a0bd2fbed99638bb7345bd01542a38c763476 (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
#!/sbin/openrc-run
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

J293_Z2="/dev/input/by-path/platform-235100000.spi-cs-0-event"
J493_Z2="/dev/input/by-path/platform-23510c000.spi-cs-0-event"

pidfile=/run/${RC_SVCNAME}.pid
command=/usr/bin/tiny-dfr
command_background=true

depend() {
	need localmount
	after modules-load
}


# Check for the presence of the touchbar digitiser.
start_pre() {
	ebegin "${RC_SVCNAME}: checking for a touchbar"
	if [ -e ${J293_Z2} ]; then
		eend $?
	elif [ -e ${J493_Z2} ]; then
		eend $?
	else
		eend "${RC_SVCNAME}: no touchbar present on this machine"
	fi
}