Improve KdeEcoTest tool using kwin scripting API and uinput
Abstract:
Measuring the energy consumption of KDE software is a vital task in achieving the sustainability goal. This is done by running the software and executing repetitive actions that simulate human use. KdeEcoTest is a tool used for building and testing standard usage scenario scripts which simulate human use. During this season of KDE, I would like to work on improving KdeEcoTest
and improve its compatibility.
Proposal:
KdeEcoTest
currently lacks support for wayland
systems since it uses xdotool (written using libX11) for simulating actions and thus only works on X11
window systems. Making way for wayland support will enable running on both the widely used linux window systems and provide a generalised testing solution for both platforms.
A Solution can be:
Use Kwin
script for window actions and uinput
to simulate keyboard/mouse input:
Kwin scripting API can be used to run scripts on kwin window manager/compositor which can be used to simulate window actions. kdotool is a command line application written using rust which uses kwin scripting API to manipulate windows. uinput is a kernel module which can be used to emulate input devices and ydotool is a command line application similar to xdotool that uses uinput and can be used to simulate mouse and keyboard inputs. Thus using the two, we can replace xdotool and the resulting solution would support both wayland and X window systems.
KdeEcoTest also doesn’t work well with window decorations as xdotool
cannot handle them. A shift to Kwin script can provide a solution which will help us handle window decorations as well. Also KdeEcoTest is yet to support actions on modal window, which is a vital part in simulating a standard usage scenario which often includes actions on multiple modal windows. I hope an efficient solution for this can also be found using window class names.
Timeline:
- Week(1-3): Make KdeEcoTest compatible on both wayland and X window systems using Kwin scripting API.
- Replace xdotool with kdotool for all window related functions (Keep support for Non-KDE X11 based systems).
- Week(4-6): Replace xdotool with ydotool/uinput to handle all input device related functions.
- Week(6-8): Add support for modal windows.
- Week(8-10): Test and improve documentation for KdeEcoTest.
- Create Test scripts using KdeEcoTest on various applications.
- Add a detailed documentation on KdeEcoTest, and also steps for usage and contribution guidelines.
Challenges and Limitations: Currently there exists no robust solution which will help us to enable support for wayland as most of the APIs that exists in X11 is not implemented in wayland protocol and also due to the diverse nature of wayland compositors which are free to implement its own APIs. The use of Kwin script is also just limited to the kwin compositor.
About Myself: I am Athul Raj K, currently a 4th year undergraduate pursuing Integrated Masters degree in mathematics at National Institute of Technology Surat, India. I have experience in working on various software development projects (https://github.com/krathul) and have worked as a freelance ML developer. I have previously made small contributions to open source development (https://github.com/huggingface/optimum/pull/1296). I am passionate about free and open source software and would be happy to start my journey with FOSS and KDE with sok`24.
Contact:
- @krathul:matrix.org
- krathul3152@gmail.com
/cc @teams/season-of-kde