arewewaylandyet icon indicating copy to clipboard operation
arewewaylandyet copied to clipboard

Ability to screencast keys

Open quazar-omega opened this issue 2 years ago • 16 comments

As of now it seems there is no application to show the keys being pressed that works on Wayland.
The X11 equivalent would be screenkey

quazar-omega avatar May 16 '23 23:05 quazar-omega

There is this : https://github.com/ammgws/wshowkeys

rooiratel avatar May 17 '23 12:05 rooiratel

Feel free to create a PR.

mpsq avatar May 17 '23 15:05 mpsq

wshowkeys

Oh I haven't heard of it, I'll try it soon, thanks @rooiratel

quazar-omega avatar May 17 '23 18:05 quazar-omega

@mpsq ok, will do! If the suggestion works well enough I'll mark the functionality as covered

quazar-omega avatar May 17 '23 18:05 quazar-omega

@rooiratel I wasn't able to run it, I tried doing so both through distrobox and got no output at all, then by running the executable produced from within the container from the host system, but it keeps saying

wshowkey needs to be setuid to read input events

although I have run

chmod a+s /path/to/wshowkey

as instructed.

What should I do?

quazar-omega avatar May 17 '23 18:05 quazar-omega

Hi @quazar-omega I haven't tried it myself either! But I'll give it a go on my system and see if I can get it to work.

rooiratel avatar May 18 '23 07:05 rooiratel

Ok, I'll wait for your comment then, thank you! In the meantime, I'll open a draft pull request

quazar-omega avatar May 18 '23 14:05 quazar-omega

I just installed and tried it now. It works for me without any issues.

For context I am on Arch Linux and I just installed the AUR package : https://aur.archlinux.org/packages/wshowkeys-git

I'm not sure which distro you use, but the PKGBUILD file should hopefully help you get it working on your system:

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=wshowkeys-git

rooiratel avatar May 25 '23 16:05 rooiratel

Hm I see, that is the package I had installed in my Arch container too, I'm on Fedora Kinoite so my system is immutable, that's why I couldn't install it directly on my host.

I'll see if I can build it with a Fedora container, maybe that could make a difference, though to be fair, if it is becoming so hard to install (aside from Arch-based distros) I'm leaning on considering it not really user ready, don't know what the maintainers' stance on that is

quazar-omega avatar Jun 16 '23 13:06 quazar-omega

Update: I was actually able to find the dependencies I was missing thanks to pkgs.org like so and I repeated the same thing by replacing the word enclosed in parentheses after "pkgconfig" (e.g. pkgconfig(xkbcommon) in the search field) so I was finally able to complete the build process.

Dependency problem

I've been trying to compile it, but I got stuck at a missing dependency when I run meson build:

Run-time dependency wayland-client found: NO (tried pkgconfig and cmake)

meson.build:45:0: ERROR: Dependency "wayland-client" not found, tried pkgconfig and cmake

But if I check my system, libwayland-client is present:

$ sudo dnf install libwayland-client
Last metadata expiration check: 0:22:04 ago on Wed 19 Jul 2023 12:26:42 CEST.
Package libwayland-client-1.22.0-1.fc38.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

I'm really confused, what should I do?

quazar-omega avatar Jul 19 '23 10:07 quazar-omega

Now the problem (just as before) is that when I run it I don't see any output.
I also tried moving the binary to my host system and running it from there but I keep getting:

$ wshowkeys
wshowkeys needs to be setuid to read input events

Even though I set it as setuid:

sudo chmod a+s .local/bin/wshowkeys

Update: Now I also tried by compiling directly on my host system, but the issue persists anyway, maybe it has to do with some permissions?

quazar-omega avatar Jul 19 '23 11:07 quazar-omega

I may be interested in working on a project like this that works on both X11 and Wayland without root or any special permissions, after I set up some APIs in the appropriate libraries to get it done.

orowith2os avatar Aug 22 '23 06:08 orowith2os

That would be great, but can it really be done without root?

quazar-omega avatar Aug 22 '23 12:08 quazar-omega

Yes it can. That's why the InputCapture portal exists.

orowith2os avatar Aug 22 '23 20:08 orowith2os

Oh cool, I'll be looking forward to it then!

quazar-omega avatar Aug 22 '23 21:08 quazar-omega

Update here! A new (not actually new, but I just didn't know about its existence until it was brought up in a random thread) application is available: https://github.com/AlynxZhou/showmethekey
It needs root access unfortunately, but it's better than nothing until someone succeeds in implementing a key screencaster that makes use of the Input Capture portal mentioned by @orowith2os.
I guess I'll be updating my PR 🎉

quazar-omega avatar Jun 17 '24 22:06 quazar-omega