This program is still in the early stages of development! It is not functional, let alone stable. Do not use it until more work has been done!
The loss of xdotool has been widely bemoaned since Wayland has grown more popular. Alternatives such as ydotool have sprung up, but they create kernel input devices to emulate input to the compositor. While this solution is functional, in this developer's humble opinion, it is quite flawed for the following reasons:
- Elegance: Creating a virtual uinput device is a low-level operation that affects the entire system. For automating tasks within the confines of a single graphical environment, and often on a single application, it is excessive; furthermore, it has the potential to create unintended side-effects.
- Security: This method sends arbitrary inputs to the system as if through a real keyboard and mouse. This poses the same risks as did the APIs leveraged by xdotool, which led to their exclusion from the Wayland protocol. This is, again, especially serious in the case of input emulation on a single application, wherein inputs may be sent to the rest of the graphical environment, or even to the virtual console. Furthermore, it requires components of the program to run as root, which is disastrous if any exploit were to be discovered.
Cagey aims to resolve both of these problems for the single-application use case. It consists of a modified version of the cage kiosk compositor, which exposes an IPC socket that allows input events to be sent to the program within. Because it is an isolated compositor, it is completely impossible for these events to be received by any program other than the intended recipient. The entire setup is completely rootless, and can be easily used on a pre-existing graphical environment via cage's pre-existing nested mode.
Cagey has exactly the same dependencies as cage; see its README for details.
The build process is the same, as well:
$ meson setup build
$ meson compile -C build
By default, this builds a debug build. To build a release build, use meson setup build --buildtype=release.
You can run Cagey by running ./build/cagey APPLICATION. It will launch in nested mode if you are already in a graphical session, and directly on the display if not.
In debug mode (default build type with Meson), press Alt+Esc to quit.
Since cage was originally designed as a kiosk, it was not possible to escape from it when running on a physical TTY by switching to a different one, unless TTY switching was enabled with the -s switch. Since Cagey's use case is a bit different, TTY switching is enabled by default. The -s switch instead disables it.
For more configuration options, see Configuration (WIP).
For any bug, please create an issue on GitHub.
Please note that any issues submitted before the software is actually completed will be ignored, as it is not meant for use in its present state.
Cage is copyright © 2018-2020 Jente Hidskes [email protected]. It is used in accordance with its license.
The idea for IPC-based input emulation was inspired by the Hyprland project, which implements the possibility for it.