diff --git a/.gitignore b/.gitignore index 3739f7c..e3dfd08 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,11 @@ kbd *.o +/*.deb +/*.ddeb +/*.buildinfo +/*.changes +/debian/files +/debian/*.debhelper* +/debian/*.substvars +/debian/fa608-kbd* +/debian/debhelper-build-stamp diff --git a/Makefile b/Makefile index aea2a48..819717a 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,10 @@ all: $(TARGET) $(TARGET): $(SRC) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) +PREFIX ?= /usr/local + install: $(TARGET) - install -D -m 0755 $(TARGET) $(DESTDIR)/usr/local/bin/$(TARGET) + install -D -m 0755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(TARGET) clean: rm -f $(TARGET) diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..e00863b --- /dev/null +++ b/debian/changelog @@ -0,0 +1,8 @@ +fa608-kbd (1.0.0) unstable; urgency=medium + + * Initial release. + * ITE51368 HID feature report to switch EC mode. + * Brightness + RGB effect control via sysfs. + * systemd service for boot-time init. + + -- 楼湘缘 <2216918339@qq.com> Sat, 27 Jun 2026 15:50:00 +0800 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..f100169 --- /dev/null +++ b/debian/control @@ -0,0 +1,28 @@ +Source: fa608-kbd +Section: utils +Priority: optional +Maintainer: 楼湘缘 <2216918339@qq.com> +Build-Depends: debhelper-compat (= 13), libhidapi-dev, pkg-config +Standards-Version: 4.6.2 +Homepage: https://gitee.com/louxian-yuan/fa608-kbd + +Package: fa608-kbd +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends}, libhidapi-hidraw0 +Description: ASUS TUF FA608 keyboard backlight CLI (INESE/中文) + kbd is a tiny C utility for controlling the keyboard backlight + on ASUS TUF Gaming A16 FA608 laptops. + . + It switches the ITE51368 (0B05:19B6) I2C HID keyboard controller + from Windows Dynamic Lighting mode to Embedded Controller mode, + then provides brightness and RGB effect control via sysfs. + . + Includes a systemd service for boot-time initialization. + . + 一款轻量级 C 命令行工具,用于控制 ASUS TUF Gaming A16 FA608 + 笔记本的键盘背光。 + . + 通过发送 HID feature report 将 ITE51368 键盘控制器切换到 EC + 模式,随后提供亮度调节和 RGB 灯效控制功能。 + . + 含 systemd 开机自动初始化服务。 diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..99d618f --- /dev/null +++ b/debian/copyright @@ -0,0 +1,26 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: fa608-kbd +Source: https://gitee.com/louxian-yuan/fa608-kbd + +Files: * +Copyright: 2026 楼湘缘 +License: MIT + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..0fb80a3 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,7 @@ +#!/bin/sh +set -e +if [ "$1" = "configure" ]; then + systemctl daemon-reload 2>/dev/null || true + systemctl enable kbd-init.service 2>/dev/null || true + systemctl start kbd-init.service 2>/dev/null || true +fi diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000..4d8b12c --- /dev/null +++ b/debian/prerm @@ -0,0 +1,6 @@ +#!/bin/sh +set -e +if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then + systemctl stop kbd-init.service 2>/dev/null || true + systemctl disable kbd-init.service 2>/dev/null || true +fi diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..507767d --- /dev/null +++ b/debian/rules @@ -0,0 +1,15 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_auto_build: + $(MAKE) PREFIX=/usr + +override_dh_auto_install: + $(MAKE) install PREFIX=/usr DESTDIR=debian/fa608-kbd + +override_dh_install: + dh_install + mkdir -p debian/fa608-kbd/lib/systemd/system + cp kbd-init.service debian/fa608-kbd/lib/systemd/system/ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native)