From dadac25a4e0c008cf5821b4d2f7bb6a27e9528f1 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 2 Oct 2026 17:50:44 +0200 Subject: ak820-ctl: add version 0.1.0+git20260414 CLI and GUI control software for the Ajazz AK820 Pro keyboard (lighting, sleep timer, clock sync). Upstream has no tags, so the source is pinned to a commit and nvchecker tracks the commit date. Ships a uaccess udev rule for 0c45:8009, a desktop entry for ak820-gui, and rc.ak820-lcd, a Slackware replacement for upstream's systemd unit that runs the lcd subcommand in a restart loop. Co-Authored-By: Claude Opus 5.5 --- ak820-ctl/doinst.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ak820-ctl/doinst.sh (limited to 'ak820-ctl/doinst.sh') diff --git a/ak820-ctl/doinst.sh b/ak820-ctl/doinst.sh new file mode 100644 index 0000000..7d36484 --- /dev/null +++ b/ak820-ctl/doinst.sh @@ -0,0 +1,34 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.ak820-lcd.new + +if [ -z "$ROOT" ] && [ -x /sbin/udevadm ]; then + /sbin/udevadm control --reload-rules >/dev/null 2>&1 + /sbin/udevadm trigger --subsystem-match=usb --subsystem-match=hidraw >/dev/null 2>&1 +fi + +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi -- cgit v1.2.3