keyd: keyd-application-mapper doesn't detect wayland?

Hi.

Running keyd v2.4.3 under KDE Plasma 6 with a wayland session. From the terminal:

% KEYD_DEBUG=1 keyd-application-mapper -v
X detected

and no wayland windows are detected at all. If a run an X application then I start to get

Active window: root|

listed on window change out of a wayland window. Anyone else seeing this?

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Hello.

Good work for KDE compatibility. Thanks to both of you.

I’ve test this commit on both Kde Plasma 5 and 6 (Fedora) I have 3 comment :

  1. In the Kwin Script, the client.resourceName seems to be less reliable than client.resourceClass to identify the class of an window. With mpv and Firefox (Flatpak) the 1st is empty but the 2nd is in all case populate.

  2. The Kwin Script work with Plasma 6 but need some adjustment for Plasma 5 Line 127 workspace.windowActivated.connect => workspace.clientActivated.connect

ressourceClass vs ressourcename.txt

  1. The python script keys-application-mapper work with Plasma 6 but need some adjustment for Plasma 5 Line 144 script = bus.get_object(‘org.kde.KWin’, ‘/Scripting/Script%d’ % num).run() => script = bus.get_object(‘org.kde.KWin’, f’/%d’ % num).run()

I’ve made a rough modification for testing

keyd-application-mapperMOD.txt

I hope that helps.

Denez1

Short answer is: yes

Longer answer is: read https://github.com/rvaiya/keyd particularly the section on Application Specific Remapping:

  1. You should have an app.conf in ~/.config/keyd which contains application specific mappings. This is different to your /etc/keyd/default.conf
  2. Don’t chmod /var/run/keyd.socket; add yourself to the keyd group (may need then to reboot or at least open a new terminal and check you’ve been added)
  3. Then run my keyd-application-mapper as above (with KEYD_DEBUG=1 and -v option) to test everything’s working.

Ok - here’s a first pass at a KDE/Wayland version of keyd-application-mapper. This is alpha quality - beta at best - and requires a lot more testing. If anyone wants to test it, I’m happy to look at bugs/feedback.

Download: keyd-for-kde.zip

A few notes:

  1. Consists of two files:
  • keyd-application-mapper should be a drop-in replacement for /usr/bin/keyd-application-mapper. There may be edge cases that I’ve missed, but works for me on KDE Plasma 6.0.2.
  • keyd.kwinscript is a kwinscript that can be installed via System Settings -> Window Management -> KWin Scripts -> Install from File. See note below though.
  1. Dependencies:

This keyd-application-mapper is written in Perl (because that’s what I know!), and relies on the following modules:

  • File::HomeDir
  • Net::DBus
  • Proc::Daemon
  • File::FnMatch
  1. Starting the kwinscript:

After installing the kwinscript, you might need to enable it in order for it to work. The most reliable way of doing this is

kwriteconfig6 --file kwinrc --group Plugins --key keydEnabled true
qdbus6 org.kde.KWin /KWin reconfigure

I’ll look into this and see if I can make this slicker.

Hurray! That’s great news. As far as I’m aware you’re the first user (other than me) - so please do let me know any problems that you come across.

Got it. Thanks. However I think there is a way to do this for KDE using KWin scripts and DBUS messaging. I’m working on a proof of concept now - will report back in a day or two.

With a bit of debugging, it looks like this is because the KDE 6 compositor doesn’t implement zwlr_foreign_toplevel_manager_v1

These are the interfaces that keyd-application-mapper gets back:

Wayland: wl_compositor
Wayland: zwp_tablet_manager_v2
Wayland: zwp_keyboard_shortcuts_inhibit_manager_v1
Wayland: zxdg_decoration_manager_v1
Wayland: wp_viewporter
Wayland: wp_security_context_manager_v1
Wayland: wp_fractional_scale_manager_v1
Wayland: wl_shm
Wayland: wl_seat
Wayland: zwp_pointer_gestures_v1
Wayland: zwp_pointer_constraints_v1
Wayland: zwp_relative_pointer_manager_v1
Wayland: wl_data_device_manager
Wayland: zwlr_data_control_manager_v1
Wayland: wp_cursor_shape_manager_v1
Wayland: zwp_primary_selection_device_manager_v1
Wayland: org_kde_kwin_idle
Wayland: zwp_idle_inhibit_manager_v1
Wayland: ext_idle_notifier_v1
Wayland: org_kde_plasma_shell
Wayland: org_kde_kwin_appmenu_manager
Wayland: org_kde_kwin_server_decoration_palette_manager
Wayland: org_kde_plasma_virtual_desktop_management
Wayland: org_kde_kwin_shadow_manager
Wayland: org_kde_kwin_dpms_manager
Wayland: org_kde_kwin_server_decoration_manager
Wayland: kde_output_management_v2
Wayland: zxdg_output_manager_v1
Wayland: wl_subcompositor
Wayland: zxdg_exporter_v2
Wayland: zxdg_importer_v2
Wayland: xdg_activation_v1
Wayland: wp_content_type_manager_v1
Wayland: wp_tearing_control_manager_v1
Wayland: xdg_toplevel_drag_manager_v1
Wayland: kde_screen_edge_manager_v1
Wayland: frog_color_management_factory_v1
Wayland: wp_presentation
Wayland: xdg_wm_base
Wayland: zwlr_layer_shell_v1
Wayland: wp_drm_lease_device_v1
Wayland: kde_output_order_v1
Wayland: zwp_text_input_manager_v1
Wayland: zwp_text_input_manager_v2
Wayland: zwp_text_input_manager_v3
Wayland: wl_drm
Wayland: zwp_linux_dmabuf_v1
Wayland: kde_output_device_v2
Wayland: wl_output
Wayland: org_kde_kwin_blur_manager
Wayland: org_kde_kwin_contrast_manager
Wayland: org_kde_kwin_slide_manager