diff options
-rw-r--r-- | .SRCINFO | 36 | ||||
-rw-r--r-- | PKGBUILD | 59 | ||||
-rw-r--r-- | asus-touchpad-numpad-driver-git.install | 17 |
3 files changed, 112 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..0f3859daf69f --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,36 @@ +pkgbase = asus-touchpad-numpad-driver-git + pkgdesc = Linux newest feature-rich configurable driver for Asus numpad + pkgver = r56.9044584 + pkgrel = 1 + url = https://github.com/asus-linux-drivers/asus-touchpad-numpad-driver + install = asus-touchpad-numpad-driver-git.install + arch = any + license = GPL3 + makedepends = git + depends = libevdev + depends = python-libevdev + depends = i2c-tools + depends = python-numpy + provides = asus-touchpad-numpad-driver + source = git+https://github.com/asus-linux-drivers/asus-touchpad-numpad-driver.git + sha256sums = SKIP + +pkgname = asus-touchpad-numpad-driver-ux433fa-qwerty-git + +pkgname = asus-touchpad-numpad-driver-ux433fa-azerty-git + +pkgname = asus-touchpad-numpad-driver-up5401ea-qwerty-git + +pkgname = asus-touchpad-numpad-driver-up5401ea-azerty-git + +pkgname = asus-touchpad-numpad-driver-ux581l-qwerty-git + +pkgname = asus-touchpad-numpad-driver-ux581l-azerty-git + +pkgname = asus-touchpad-numpad-driver-gx701-qwerty-git + +pkgname = asus-touchpad-numpad-driver-gx701-azerty-git + +pkgname = asus-touchpad-numpad-driver-g533-qwerty-git + +pkgname = asus-touchpad-numpad-driver-g533-azerty-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..7c47e414d7d7 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,59 @@ +# Maintainer: Kamack38 <kamack38.biznes@gmail.com> + +_pkgbase=asus-touchpad-numpad-driver +pkgbase="${_pkgbase}-git" +pkgname=( + "${_pkgbase}-ux433fa-qwerty-git" + "${_pkgbase}-ux433fa-azerty-git" + "${_pkgbase}-up5401ea-qwerty-git" + "${_pkgbase}-up5401ea-azerty-git" + "${_pkgbase}-ux581l-qwerty-git" + "${_pkgbase}-ux581l-azerty-git" + "${_pkgbase}-gx701-qwerty-git" + "${_pkgbase}-gx701-azerty-git" + "${_pkgbase}-g533-qwerty-git" + "${_pkgbase}-g533-azerty-git" +) +pkgver=r56.9044584 +pkgrel=1 +pkgdesc="Linux newest feature-rich configurable driver for Asus numpad" +arch=('any') +url="https://github.com/asus-linux-drivers/asus-touchpad-numpad-driver" +license=('GPL3') +depends=('libevdev' 'python-libevdev' 'i2c-tools' 'python-numpy') +makedepends=('git') +provides=("${_pkgbase}") +source=("git+${url}.git") +sha256sums=('SKIP') +install="$pkgbase.install" + +pkgver() { + cd "${srcdir}/asus-touchpad-numpad-driver" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +_package() { + cd "${srcdir}/${_pkgbase}" + if [ "$layout" == "qwerty" ]; then + PERCENTAGE_KEY=6 + elif [ "$layout" == "azerty" ]; then + PERCENTAGE_KEY=40 + fi + sed -i "s/\$LAYOUT \$PERCENTAGE_KEY/${model} ${PERCENTAGE_KEY}/" "asus_touchpad.service" + sed -i "s#/usr/share/asus_touchpad_numpad-driver/asus_touchpad.py#${pkgdir}/usr/share/asus_touchpad_numpad-driver/asus_touchpad.py#" "asus_touchpad.service" + install -Dm755 asus_touchpad.py "${pkgdir}/usr/share/asus_touchpad_numpad-driver/asus_touchpad.py" + install -Dm644 "asus_touchpad.service" "${pkgdir}/usr/lib/systemd/system/asus_touchpad_numpad.service" + install -Dm 644 -t "${pkgdir}/usr/share/asus_touchpad_numpad-driver/numpad_layouts" numpad_layouts/*.py +} + +main() { + for _pkgname in "${pkgname[@]}"; do + eval "package_${_pkgname}() { + model="$(echo ${_pkgname%-*} | sed "s/${_pkgbase}-//" | awk -F '-' '{print $1}')" + layout="$(echo ${_pkgname%-*} | sed "s/${_pkgbase}-//" | awk -F '-' '{print $2}')" + _package + }" + done +} + +main diff --git a/asus-touchpad-numpad-driver-git.install b/asus-touchpad-numpad-driver-git.install new file mode 100644 index 000000000000..34c0dede8cd6 --- /dev/null +++ b/asus-touchpad-numpad-driver-git.install @@ -0,0 +1,17 @@ +post_install() { + modprobe i2c-dev + echo "i2c-dev" | tee /etc/modules-load.d/i2c-dev.conf >/dev/null + systemctl enable --now asus_touchpad_numpad +} + +pre_upgrade() { + systemctl disable --now asus_touchpad_numpad +} + +post_upgrade() { + systemctl enable --now asus_touchpad_numpad +} + +pre_remove() { + systemctl disable --now asus_touchpad_numpad +} |