summaryrefslogtreecommitdiff
path: root/recipes-graphics/wayland/weston-init.bbappend
blob: 223eb2cb0619c978d9964a1f3b55b46a85d6d318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"

SRC_URI += "file://toradex-save-touchscreen-calibration.sh"

PACKAGECONFIG[touchscreen-calibration] = ",,"
PACKAGECONFIG:append:tdx = " touchscreen-calibration"

do_install:append:tdx() {
    if [ "${@bb.utils.contains('PACKAGECONFIG', 'touchscreen-calibration', 'yes', 'no', d)}" = "yes" ]; then
        sed -i -e "s/^#\\[libinput\\]/[libinput]/g" ${D}${sysconfdir}/xdg/weston/weston.ini

        sed -i -e "/calibration_helper=/d" ${D}${sysconfdir}/xdg/weston/weston.ini
        sed -i -e "/^\[libinput\]/a calibration_helper=${bindir}/toradex-save-touchscreen-calibration" ${D}${sysconfdir}/xdg/weston/weston.ini

        sed -i -e "/touchscreen_calibrator=/d" ${D}${sysconfdir}/xdg/weston/weston.ini
        sed -i -e "/^\[libinput\]/a touchscreen_calibrator=true" ${D}${sysconfdir}/xdg/weston/weston.ini

        sed -i -e "/enable_tap=/d" ${D}${sysconfdir}/xdg/weston/weston.ini
        sed -i -e "/^\[libinput\]/a enable_tap=true" ${D}${sysconfdir}/xdg/weston/weston.ini

        install -Dm0755 ${WORKDIR}/toradex-save-touchscreen-calibration.sh ${D}${bindir}/toradex-save-touchscreen-calibration
    fi
}