Skip to content

Commit

Permalink
Add package for rmstylusbutton
Browse files Browse the repository at this point in the history
Apply suggestions from code review

Co-authored-by: Nathaniel van Diepen <[email protected]>
  • Loading branch information
MoritzBoehme and Eeems committed Feb 12, 2025
1 parent 4478af9 commit ed5c6e2
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
52 changes: 52 additions & 0 deletions package/rmstylusbutton/package
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
# Copyright (c) 2025 The Toltec Contributors
# SPDX-License-Identifier: MIT

archs=(rm2)
pkgnames=(rmstylusbutton)
_pkgver=3.0
pkgver=$_pkgver-1
pkgdesc="Use a stylus button with the reMarkable 2"
timestamp=2024-03-04T04:30:52Z
maintainer="Moritz <[email protected]>"
license=GPL-3.0
url=https://github.com/rschroll/RMStylusButton
section="utils"
installdepends=(xochitl)
conflicts=(remarkable-stylus)

image=base:v3.2
source=(
"$url/archive/refs/tags/v$_pkgver.tar.gz"
rmstylusbutton.service
rmstylusbutton.conf
)
sha256sums=(
5f468b9f78b705ca67ea3288ae923b10fb70193c236b31507a4e6148ebb4e60e
SKIP
SKIP
)

build() {
export CC=arm-linux-gnueabihf-gcc
make
}

package() {
install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir"/RMStylusButton/RMStylusButton
install -D -m 644 -t "$pkgdir"/lib/systemd/system/ "$srcdir"/rmstylusbutton.service
install -D -m 644 -t "$pkgdir"/opt/etc/ "$srcdir"/rmstylusbutton.conf
}

configure() {
systemctl daemon-reload
systemctl enable --now rmstylusbutton.service
}

preremove() {
disable-unit rmstylusbutton.service
}

postremove() {
systemctl daemon-reload
}
2 changes: 2 additions & 0 deletions package/rmstylusbutton/rmstylusbutton.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# possible flags: --verbose, --toggle
FLAGS=
11 changes: 11 additions & 0 deletions package/rmstylusbutton/rmstylusbutton.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Stylus Button Input
After=xochitl.service

[Service]
ExecStart=/opt/bin/RMStylusButton $FLAGS
Restart=on-failure
EnvironmentFile=/opt/etc/rmstylusbutton.conf

[Install]
WantedBy=multi-user.target

0 comments on commit ed5c6e2

Please sign in to comment.