RedBearAK / toshy

Keymapper config to make Linux work like a 'Tosh!
https://toshy.app
GNU General Public License v3.0
375 stars 18 forks source link

[BUG] Yakuake in Wayland not working #58

Closed armerpunkt closed 1 year ago

armerpunkt commented 1 year ago
Bare metal or virtual machine: Bare metal
Linux distro name: openSUSE
Distro version: Tumbleweed
X11/Xorg or Wayland: Wayland
Desktop environment(s): KDE

Keyboard type: Apple
Keyboard device name: Apple Inc. Apple Internal Keyboard / Trackpad

Problem observed:


When running KDE in Wayland, keyboard shortcuts aren't working properly in Yakuake. For example, pressing command-c sends a control-c to the terminal. And pressing control-c results in this output:

user@localhost:~$
::1                    ff02::1                ipv6-allhosts          ipv6-localhost         ipv6-mcastprefix       
fe00::0                ff02::2                ipv6-allnodes          ipv6-localnet          localhost              
ff00::0                ff02::3                ipv6-allrouters        ipv6-loopback          localhost.localdomain  
user@localhost:~$ sc

However, Toshy is working as expected in Yakuake with KDE in X11, where command-c does a copy and control-c sends a control-c. So the issue seems to be Wayland specific.

(Also Toshy is working fine with Konsole and Alacritty in KDE in Wayland)

RedBearAK commented 1 year ago

@armerpunkt

Must be something odd going on with with the window context attributes in Wayland. I suspect that they may be empty for some reason.

If you just installed Toshy in the last few weeks there should be a sort of "diagnostic" shortcut available:

Shift+Opt+Cmd+I,I

On a PC keyboard that would be Shift+Win+Alt+I,I, and the last part means you have to quickly double-tap the "I" key.

If the context is messed up this shortcut may not work. It's supposed to bring up a zenity info dialog with the window info.

If it doesn't work you can use this command in a terminal:

toshy-config-verbose-start

Just type "tosh", Tab, "co", Tab, "ve", Tab, and you'll have the whole command. This will stop the background services and run just the config with full debugging output in the terminal. Let it start up before you touch any modifier keys. Just wait about 5 seconds or so.

When you activate Yakuake and try some kind of shortcut that you know should be getting remapped to something, you'll see the context info, such as the window class and name/title. I'm guessing you'll see what appear to be error messages for those fields.

If that is the case, there is probably nothing Toshy can do, and you may need to file a bug report with the Yakuake devs.

Or, it may be that the app is just using an app class that is no longer matching as a terminal. That's probably the simpler explanation, in which case the diagnostic shortcut from earlier probably worked, and you can just tell me the correct app class they are using in Wayland.

Wild guess: org.kde.Yakuake

RedBearAK commented 1 year ago

@armerpunkt

Confirmed in a VM, the new app class is "org.kde.yakuake". So it was not getting recognized as a terminal while in the Wayland session.

This seems to be a common pattern with KDE apps in Wayland, they just add the "org.kde." in front of the app class they used in X11/Xorg. Let me know if you see another KDE-related app class in the terminals list that should have a Wayland variant.

I'll be adding it to the terminals list in toshy_config.py as shown below, and you can do the same. Just restart the Toshy services after you save the change. You can get to the config folder quickly from the tray icon menu, and edit toshy_config.py with any sort of text editor.

terminals_lod = [
    {clas:"^alacritty$"                 },
    {clas:"^com.raggesilver.BlackBox$"  },
    {clas:"^contour$"                   },
    {clas:"^cutefish-terminal$"         },
    {clas:"^deepin-terminal$"           },
    {clas:"^eterm$"                     },
    {clas:"^gnome-terminal$"            },
    {clas:"^gnome-terminal-server$"     },
    {clas:"^guake$"                     },
    {clas:"^hyper$"                     },
    {clas:"^io.elementary.terminal$"    },
    {clas:"^kinto-gui.py$"              },
    {clas:"^kitty$"                     },
    {clas:"^Kgx$"                       },
    {clas:"^konsole$"                   },
    {clas:"^lxterminal$"                },
    {clas:"^mate-terminal$"             },
    {clas:"^org.gnome.Console$"         },
    {clas:"^org.kde.konsole$"           },
    {clas:"^org.kde.yakuake$"           },
    {clas:"^org.wezfurlong.wezterm$"    },
    {clas:"^roxterm$"                   },
    {clas:"^qterminal$"                 },
    {clas:"^st$"                        },
    {clas:"^sakura$"                    },
    {clas:"^station$"                   },
    {clas:"^tabby$"                     },
    {clas:"^terminator$"                },
    {clas:"^termite$"                   },
    {clas:"^tilda$"                     },
    {clas:"^tilix$"                     },
    {clas:"^urxvt$"                     },
    {clas:"^xfce4-terminal$"            },
    {clas:"^xterm$"                     },
    {clas:"^yakuake$"                   },
]
RedBearAK commented 1 year ago

@armerpunkt

Fix applied to the default Toshy config in the main branch.

https://github.com/RedBearAK/toshy/pull/59

Thanks for reporting the problem! Feel free to close this if you get it working yourself.

Open another issue for anything else you run into.

armerpunkt commented 1 year ago

Thank you for the quick and thorough response! I am happy to confirm that the change you suggested does fix it.

And thank you for making such a great utility! It has really made the transition from MacOS to Linux so much better.

RedBearAK commented 1 year ago

@armerpunkt

I am glad you find it as useful as I do, though I can't take credit for the original base config it evolved from.

Thanks for your very generous support as well. 💟