mpsq / arewewaylandyet

Sources for https://arewewaylandyet.com
https://arewewaylandyet.com
MIT License
280 stars 62 forks source link

Ability to screencast keys #184

Open quazar-omega opened 1 year ago

quazar-omega commented 1 year ago

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

rooiratel commented 1 year ago

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

mpsq commented 1 year ago

Feel free to create a PR.

quazar-omega commented 1 year ago

wshowkeys

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

quazar-omega commented 1 year ago

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

quazar-omega commented 1 year ago

@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?

rooiratel commented 1 year ago

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.

quazar-omega commented 1 year ago

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

rooiratel commented 1 year ago

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

quazar-omega commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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?

orowith2os commented 1 year ago

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.

quazar-omega commented 1 year ago

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

orowith2os commented 1 year ago

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

quazar-omega commented 1 year ago

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

quazar-omega commented 5 months ago

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 🎉