Skip to content

About

Linux/Wayland support and configurable button/dial remapping for Huion Kamvas 13 Gen 3 (GS1333, USB 256c:2008).

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

Huion Kamvas 13 Gen 3 Linux — kamvas-bridge

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.

Project note

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.

Features

  • 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

Architecture

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_HWHEEL events 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.

Installation from a checkout

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-linux

Only 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.

Setup

Preview every operation without changing the system:

PYTHONPATH=src python -m kamvas_bridge setup --dry-run

Apply upstream support, permissions and the automatic remapper service:

PYTHONPATH=src python -m kamvas_bridge setup --apply

For Hyprland, first list the actual outputs:

hyprctl -j monitors

Then 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-1

The 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.

Live ISO and kernel safety

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.

Automatic daily use

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 enable

Logs:

journalctl --user -u kamvas-bridge.service -b --no-pager

The 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.

Configurable buttons and dials

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 validate

The 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 restart

Shortcut 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.

Manual development mode

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 remap

After testing, stop the foreground command with Ctrl+C and restore automatic operation:

PYTHONPATH=src python -m kamvas_bridge service enable

Hyprland output mapping

Configure 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 status

Current 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 remove

niri output mapping

On niri, list your connected outputs:

niri msg outputs

Then 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.

Diagnosis and recovery

Run diagnostics as the regular user:

PYTHONPATH=src python -m kamvas_bridge doctor

Doctor 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=hid

Then 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

Uninstalling/reverting project changes

Remove the automatic user service and managed runtime copy:

PYTHONPATH=src python -m kamvas_bridge service uninstall

Remove the managed Hyprland fragment/include:

PYTHONPATH=src python -m kamvas_bridge hyprland remove

The 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 --reload

This 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.

Development tests

PYTHONPATH=src python -m unittest discover -s tests -v

The tests do not require a physical tablet, Hyprland session, systemd user bus, or Linux input device.

Documentation

Scope

Only the Huion Kamvas 13 Gen 3 / GS1333 (256c:2008) is supported. Per-app profiles, arbitrary macros/commands and a GUI are not implemented.

License

MIT License. Copyright (c) 2026

About

Linux/Wayland support and configurable button/dial remapping for Huion Kamvas 13 Gen 3 (GS1333, USB 256c:2008).

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages