Metadata-Version: 2.4
Name: wacom-utility
Version: 0.1.4
Summary: GTK4 Wacom utility with Wayland pad daemon
Author: ggveryhard
License-Expression: GPL-2.0-only
Project-URL: Homepage, https://github.com/ggveryhard/wacom-utility
Project-URL: Repository, https://github.com/ggveryhard/wacom-utility
Project-URL: Issues, https://github.com/ggveryhard/wacom-utility/issues
Keywords: wacom,wayland,gtk4,tablet,ydotool
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: X11 Applications :: GTK
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Desktop Environment
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyGObject
Requires-Dist: pycairo
Requires-Dist: evdev
Dynamic: license-file

# Wacom Utility (GTK4 + Wayland)

Modernized Wacom utility with:
- GTK4 GUI (`wacom-utility`)
- Wayland backend via `evdev + ydotool` (`wacom-wayland-pad-daemon`)
- X11 fallback for `xsetwacom` where available

## Current Architecture

- Frontend: `wacom-utility`
  - Device list, pad layout, mapping UI
  - Writes Wayland mappings to `~/.wacom_utility_wayland.json`
- Backend daemon: `wacom-wayland-pad-daemon`
  - Reads pad events from `evdev`
  - Executes mapped actions through `ydotool`
  - Supports strip scrolling (`EV_ABS`) with threshold/smoothing/multiplier

## Dependencies

### Common
- Python 3.10+
- `python3-gi` / GTK4 runtime
- `python3-cairo`
- `python3-evdev`

### Wayland (sway/wlroots path)
- `ydotool`
- `ydotoold` running in user session
- `swaymsg` (for output mapping in GUI)

### X11
- `xsetwacom` (`wacom-tools`)

## Run

PyPI-style user install:

```bash
python3 -m pip install --user .
```

This installs console entry points to:
- `~/.local/bin/wacom-utility`
- `~/.local/bin/wacom-wayland-pad-daemon`

The Python package and bundled UI/images/XML are installed under the user
site-packages directory, typically:
- `~/.local/lib/python3.x/site-packages/wacom_utility`

That is the standard Python packaging layout. A normal `pip install --user`
does not install package data to `~/.local/share`.

Run after user install:

```bash
wacom-utility
```

Quick environment check:

```bash
wacom-utility --check
```

Source checkout without installation:

```bash
PYTHONPATH=src python3 -m wacom_utility.wacom_utility
```

## Wayland Mapping Flow

1. Open GUI and configure pad buttons (Pad/Edit or Mapping tab).
2. Settings are stored in:
   - `~/.wacom_utility_wayland.json`
3. Start daemon:

```bash
wacom-wayland-pad-daemon
```

Source checkout without installation:

```bash
PYTHONPATH=src python3 -m wacom_utility.wayland_pad_daemon
```

### Strip scroll tuning

`~/.wacom_utility_wayland.json` supports:

```json
{
  "strip_scroll": {
    "enabled": true,
    "threshold": 150,
    "multiplier": 3,
    "smoothing": 0.4
  }
}
```

Future enhancement note:
- The current Wayland touch strip behavior applies pressure-based acceleration by
  default for scroll actions.
- If finer control is needed later, add dedicated left/right touch strip tuning
  controls in the GUI for pressure threshold and multiplier instead of relying
  only on the shared `strip_scroll` defaults.

## systemd --user (Auto-start daemon)

For PyPI-style user installs, the repo user unit targets:
- `%h/.local/bin/wacom-wayland-pad-daemon`
- `/usr/bin/ydotoold --socket-path=%t/.ydotool_socket --socket-perm=0660`

Service files included:
- `%h/.local/bin/wacom-wayland-pad-daemon`
- `systemd/user/wacom-wayland-pad-daemon.service`
- `systemd/user/ydotoold.service`

Both the repo user unit and the RPM unit are rendered from the shared template:
- `systemd/wacom-wayland-pad-daemon.service.in`
- `systemd/ydotoold.service.in`

User install flow:

```bash
python3 -m pip install --user .
mkdir -p ~/.config/systemd/user
cp systemd/user/wacom-wayland-pad-daemon.service ~/.config/systemd/user/
cp systemd/user/ydotoold.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now ydotoold.service wacom-wayland-pad-daemon.service
```

For RPM installs, the packaged user unit targets the system wrapper:
- `/usr/bin/wacom-wayland-pad-daemon`
- `/usr/bin/ydotoold --socket-path=%t/.ydotool_socket --socket-perm=0660`

RPM install:

```bash
systemctl --user daemon-reload
systemctl --user enable --now ydotoold.service wacom-wayland-pad-daemon.service
```

Source checkout:

Do not use the bundled user unit directly from a source checkout unless you have
already installed the package to `~/.local/bin`. Otherwise run the daemon
directly from the repo:

```bash
PYTHONPATH=src python3 -m wacom_utility.wayland_pad_daemon
```

Check status/logs:

```bash
systemctl --user status wacom-wayland-pad-daemon.service
journalctl --user -u ydotoold.service -f
journalctl --user -u wacom-wayland-pad-daemon.service -f
```

Disable:

```bash
systemctl --user disable --now wacom-wayland-pad-daemon.service ydotoold.service
```
