Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package for keyd #744

Open
wants to merge 23 commits into
base: testing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions package/keyd/default.conf
Eeems marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[ids]
# 2edd:0001 # type folio

[main]
11 changes: 11 additions & 0 deletions package/keyd/keyd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=key remapping daemon
Requires=local-fs.target
After=local-fs.target

[Service]
Type=simple
ExecStart=/opt/bin/keyd

[Install]
WantedBy=sysinit.target
58 changes: 58 additions & 0 deletions package/keyd/package
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env bash
# Copyright (c) 2020 The Toltec Contributors
# SPDX-License-Identifier: MIT

pkgnames=(keyd)
pkgdesc="A key remapping daemon for linux"
url="https://github.com/rvaiya/keyd"
pkgver=2.4.3-1
timestamp=2023-05-16T10:11Z
section=utils
maintainer="Kai <z@kwi.li>"
license=MIT

image=base:v3.1
source=(
https://github.com/rvaiya/keyd/archive/refs/tags/v2.4.3.zip
default.conf
keyd.service
)
sha256sums=(
cdfcc2cf0518b9a2d292ebac17b18f78548b92803e2a9deeb9f18c9641bf80e5
SKIP
SKIP
)

build() {
make DESTDIR=/opt CONFIG_DIR=/opt/etc/keyd "CC=${CROSS_COMPILE}cc"
}

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

configure() {
systemctl daemon-reload
if is-active keyd; then
systemctl restart keyd
elif ! is-enabled "$pkgname.service"; then
echo ""
echo "Run the following command(s) to enable the keyd service"
how-to-enable "$pkgname.service"
echo ""
echo "You will need to modify /opt/etc/keyd/default.conf before starting the service"
fi
}

preremove() {
kiwiz marked this conversation as resolved.
Show resolved Hide resolved
if is-active keyd; then
echo "Stopping keyd"
systemctl stop keyd
fi
}

postremove() {
systemctl daemon-reload
}