Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: gnome wacom configuration #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,8 @@ remouse --key ~/.ssh/remarkable
--threshold THRESH stylus pressure threshold (default 600)
--evdev use evdev to support pen pressure (requires root,
Linux only)

# Integration

To get gnome control center to treat remarkable-mouse as a wacom tablet, copy [remarkable.tablet](./remarkable.tablet) into `/usr/share/libwacom/`
Once copied, `libwacom-list-local-devices` should show `'reMarkable tablet 1'` whenever `remarkable-mouse` is running using the `--evdev` option. `gnome-control-center` (aka gnome settings) will show remarkable in `Devices > Wacom Tablet` and allow you to easily map to a monitor, change the rotation, etc.
29 changes: 29 additions & 0 deletions remarkable.tablet
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# reMarkable
#
# Button Map: TODO
#
# Default button assignments: TODO
#
# stylus with two buttons and no eraser
# Pen active area: 8.25 x 6.125 in

[Device]
Name=reMarkable tablet 1
DeviceMatch=usb:056a:0004
Class=Bamboo
Width=6
Height=8
IntegratedIn=
#Layout=
Styli= #FIXME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Styli should be set to 0xffffe;0xffffff;.

See here.


[Features]
Stylus=true
Reversible=true
Touch=false # will update when we fix this
Buttons=3
Ring=false

[Buttons]
Top=A;B;C
EvdevCodes=0x110;0x112;0x111 # might need tweaking
20 changes: 14 additions & 6 deletions remarkable_mouse/evdev.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,22 @@ def create_local_device():
import libevdev
device = libevdev.Device()

# Set device properties to emulate those of Wacom tablets
device.name = 'reMarkable tablet'
# Set device properties to emulate those of Wacom tablet.
# "pen" or "wacom" must be in the name or gdk will treat us as a TOUCHSCREEN device
# rather than a PEN device.
#
# Then "Mutter", which is responsible for doing the input mapping will silently
# refuse to map our device when requested in gnome-control-center
#
# (see https://gitlab.gnome.org/GNOME/gtk/blob/master/gdk/x11/gdkdevicemanager-xi2.c)
# (See https://gitlab.gnome.org/GNOME/mutter/-/blob/master/src/backends/meta-input-settings.c)
device.name = 'reMarkable pen' # keep "pen" !
Evidlo marked this conversation as resolved.
Show resolved Hide resolved

device.id = {
'bustype': 0x18, # i2c
'vendor': 0x056a, # wacom
'product': 0,
'version': 54
'bustype': 0x03, # usb though this is pretend and only for matching
'vendor': 0x056a, # wacom since input systems will look for this and match x driver
'product': 0x04, # no collision https://www.the-sz.com/products/usbid/index.php?v=0x056A
'version': 0 # I don't think this matters
}

# Enable buttons supported by the digitizer
Expand Down