Linux setup, diagnostics and configurable userspace remapping for the Huion Kamvas 13 Gen 3
(GS1333, 256c:2008). The complete dial path has been confirmed on physical
hardware running Arch/CachyOS with Hyprland and niri on Wayland.
Status: Experimental, tested on real hardware.
This project was created to solve a real compatibility issue I encountered while using the Huion Kamvas 13 Gen 3 on Linux.
AI-assisted development was used extensively during research, implementation, debugging, testing and documentation. The resulting software has been tested on real hardware, but this repository is not intended to represent the code as entirely hand-written by me or as a traditional portfolio project.
I am publishing it because the work may be useful to other Huion users facing similar Linux compatibility issues.
Bug reports, testing on other systems, improvements and contributions are welcome.
- Huion Kamvas 13 Gen 3 / GS1333 support
- Linux Wayland support (tested on Hyprland and niri)
- Hyprland and niri display mapping
- Configurable tablet buttons
- Dual dial support
- Automatic systemd user service
- Hotplug support
- HID-BPF integration
- evdev → uinput remapping
- Diagnostic and recovery tools
- No X11/xinput dependency
GS1333 -> huion-switcher -> HID-BPF -> evdev/libinput tablet-pad
-> kamvas-bridge user service
-> uinput virtual pointer + virtual keyboard -> applications
HID-BPF stylus -> compositor device mapping (Hyprland / niri) -> configured Kamvas output
Physical testing confirmed:
- the top dial scrolls vertically in real applications;
- the bottom dial's normalized
REL_HWHEELevents worked through the original horizontal-scroll mapping; - the HID-BPF stylus can be mapped exclusively to the Kamvas display;
- the uinput remapper runs without root after its targeted udev permissions are installed.
The normal path reads only the normalized REL_WHEEL and REL_HWHEEL events
and BTN_0 through BTN_6 events created by upstream HID-BPF. It does not
parse hidraw, duplicate the upstream decoder, or apply arbitrary debounce.
Hidraw remains a compatibility fallback for unsupported kernels/distributions.
The configurable button shortcuts and new bottom-dial zoom mapping are covered by hardware-independent tests but still require their final real-device test on CachyOS + Hyprland + Wayland.
On an installed, updated CachyOS/Arch system, clone as the regular desktop user:
sudo pacman -S --needed git python
git clone https://github.com/dev-knz/huion-kamvas-linux.git
cd huion-kamvas-linuxOnly on a fresh Live ISO whose package databases do not exist yet, bootstrap
with sudo pacman -Sy --needed git python instead.
Do not run the Python command itself with sudo. The setup requests sudo only
for its audited package and system-file operations.
Preview every operation without changing the system:
PYTHONPATH=src python -m kamvas_bridge setup --dry-runApply upstream support, permissions and the automatic remapper service:
PYTHONPATH=src python -m kamvas_bridge setup --applyFor Hyprland, first list the actual outputs:
hyprctl -j monitorsThen pass the connector used by the Kamvas explicitly. HDMI-A-1 is only an
example and is never assumed automatically:
PYTHONPATH=src python -m kamvas_bridge setup --apply \
--hyprland-output HDMI-A-1The Hyprland mapping targets only the confirmed HID-BPF device
huion-huion-tablet_gs1333-stylus. It does not configure the older
huion-huion-tablet_gs1333-pen interface.
The setup is idempotent. Re-running it refreshes the managed runtime copy, reloads the systemd user unit and restarts the remapper with the current code. It creates the default remapper configuration only when none exists and never overwrites a customized file. It does not overwrite the user's Hyprland configuration: it installs a separate managed fragment and adds one marked, removable include block.
On an installed CachyOS/Arch system, setup uses a full pacman -Syu transaction.
On an ArchISO/CachyOS Live environment it avoids a full upgrade and installs only
the selected packages with pacman -Sy --needed.
Before and after the package transaction, setup compares uname -r with the
available /usr/lib/modules//lib/modules directories. If they do not match,
setup stops before modprobe and service activation. Reboot into the matching
installed kernel and run setup again. Do not keep updating a broken Live session
just to force the hardware test through.
Setup installs and enables kamvas-bridge.service in the current user's systemd
manager. It starts at login, restarts after failures, keeps waiting when the
tablet is disconnected, and follows changing /dev/input/event* numbers after
hotplug. No terminal needs to remain open.
Useful controls:
PYTHONPATH=src python -m kamvas_bridge service status
PYTHONPATH=src python -m kamvas_bridge service restart
PYTHONPATH=src python -m kamvas_bridge service disable
PYTHONPATH=src python -m kamvas_bridge service enableLogs:
journalctl --user -u kamvas-bridge.service -b --no-pagerThe service executes a managed copy below
$XDG_DATA_HOME/kamvas-bridge/runtime (normally
~/.local/share/kamvas-bridge/runtime), so daily operation does not depend on
the clone remaining in the same directory.
Setup creates the XDG-aware configuration at:
$XDG_CONFIG_HOME/kamvas-bridge/config.toml
The normal location is ~/.config/kamvas-bridge/config.toml. Find or validate
it with:
PYTHONPATH=src python -m kamvas_bridge config path
PYTHONPATH=src python -m kamvas_bridge config validateThe physical button names observed on the GS1333 are:
| Physical control | evdev event | Code | MSC_SCAN |
|---|---|---|---|
| Top side button | BTN_0 |
256 | 90001 |
| Second side button | BTN_1 |
257 | 90002 |
| Third side button | BTN_2 |
258 | 90003 |
| Fourth side button | BTN_3 |
259 | 90004 |
| Bottom side button | BTN_4 |
260 | 90005 |
| One dial-center button | BTN_5 |
261 | 90006 |
| Other dial-center button | BTN_6 |
262 | 90007 |
BTN_STYLUS is intentionally not remapped. The generated defaults are:
[buttons]
BTN_0 = "ctrl+z"
BTN_1 = "disabled"
BTN_2 = "disabled"
BTN_3 = "disabled"
BTN_4 = "disabled"
BTN_5 = "disabled"
BTN_6 = "disabled"
[top_dial]
clockwise = "scroll_up"
counterclockwise = "scroll_down"
[bottom_dial]
clockwise = "zoom_in"
counterclockwise = "zoom_out"The top-dial names deliberately preserve the original pass-through sign:
clockwise is the existing positive REL_WHEEL direction. Swap the two action
values if the opposite physical scrolling direction is preferred.
Edit the file directly, for example:
code ~/.config/kamvas-bridge/config.toml[buttons]
BTN_0 = "ctrl+z"
BTN_1 = "ctrl+shift+z"
BTN_2 = "ctrl+s"
BTN_3 = "space"
BTN_4 = "disabled"
BTN_5 = "disabled"
BTN_6 = "disabled"Then validate and restart the existing service; reinstalling is unnecessary:
PYTHONPATH=src python -m kamvas_bridge config validate
PYTHONPATH=src python -m kamvas_bridge service restartShortcut parsing is case-insensitive and accepts zero or more of ctrl,
shift, alt, and super, followed by one normal key, such as ctrl+c,
ctrl+shift+z, alt+tab, shift+x, space, escape, enter, delete, or
f5. Special actions are disabled, scroll_up, scroll_down,
scroll_left, scroll_right, zoom_in, and zoom_out.
zoom_in emits a complete Ctrl+Shift+= press/release sequence and zoom_out
emits Ctrl+-. A separate, narrowly capable virtual keyboard is used instead
of turning the virtual pointer into a combined input device. Configuration
cannot execute shell commands, scripts, timed macros, or arbitrary programs.
The manual command remains available. Disable the automatic instance first so the instance lock does not reject the second process:
PYTHONPATH=src python -m kamvas_bridge service disable
PYTHONPATH=src python -m kamvas_bridge remapAfter testing, stop the foreground command with Ctrl+C and restore automatic
operation:
PYTHONPATH=src python -m kamvas_bridge service enableConfigure or change the output without rerunning the system setup:
PYTHONPATH=src python -m kamvas_bridge hyprland configure \
--output HDMI-A-1
PYTHONPATH=src python -m kamvas_bridge hyprland statusCurrent Hyprland Lua configurations receive kamvas_bridge.lua and a guarded
pcall(require, "kamvas_bridge") include. Legacy hyprland.conf configurations
receive a separate kamvas-bridge.conf fragment and marked source block.
To choose another monitor, rerun configure with a name from
hyprctl -j monitors. To remove only the project-managed mapping:
PYTHONPATH=src python -m kamvas_bridge hyprland removeOn niri, list your connected outputs:
niri msg outputsThen configure the tablet mapping in ~/.config/niri/config.kdl:
input {
tablet {
map-to-output "HDMI-A-1"
}
}Replace "HDMI-A-1" with the output name reported by niri msg outputs for the
Kamvas display.
Run diagnostics as the regular user:
PYTHONPATH=src python -m kamvas_bridge doctorDoctor distinguishes:
- missing/incomplete HID-BPF installation;
- installed but unloaded HID-BPF;
- missing GS1333 Keypad;
- evdev permission failure;
- missing or unwritable
/dev/uinput; - inactive, failed or active remapper service;
- invalid remapper configuration;
- missing virtual pointer or virtual keyboard;
- missing Hyprland mapping, output or HID-BPF stylus;
- Live ISO/running-kernel module mismatch.
It never runs recovery commands automatically. For an installed-but-unloaded HID-BPF path, the documented recovery is:
sudo systemd-hwdb update
sudo udevadm control --reload
sudo udevadm trigger --subsystem-match=hidThen physically unplug the Kamvas, wait two seconds, reconnect it, and rerun doctor. A fully operating configured system reports:
upstream HID path: READY
remapper config: READY (.../kamvas-bridge/config.toml)
remapper service: ACTIVE (running)
remapper: READY
Hyprland mapping: READY
Remove the automatic user service and managed runtime copy:
PYTHONPATH=src python -m kamvas_bridge service uninstallRemove the managed Hyprland fragment/include:
PYTHONPATH=src python -m kamvas_bridge hyprland removeThe two system files owned by this project can be removed explicitly:
sudo rm -f /etc/udev/rules.d/70-kamvas-bridge.rules
sudo rm -f /etc/modules-load.d/kamvas-bridge.conf
sudo udevadm control --reloadThis intentionally does not remove udev-hid-bpf, huion-switcher or their
upstream rules because they may be useful independently. It also does not unload
uinput, which other applications may be using.
PYTHONPATH=src python -m unittest discover -s tests -vThe tests do not require a physical tablet, Hyprland session, systemd user bus, or Linux input device.
- Architecture and hotplug
- Installer and service lifecycle
- Hyprland stylus mapping
- Normalized dial remapping
- Testing and recovery
- Observed fallback protocol
Only the Huion Kamvas 13 Gen 3 / GS1333 (256c:2008) is supported. Per-app
profiles, arbitrary macros/commands and a GUI are not implemented.
MIT License. Copyright (c) 2026