Hacker News new | ask | show | jobs
by James_K 84 days ago
Or you could write portable software that doesn't rely on reading global input. OBS you give as an example, and it is a good one. They could simply register a D-Bus handler and provide a second binary that sends messages to the running instance. The software is more general in this way as it allows full programmatic control. A Sway user, for instance, could add

  bindsym $mod+r exec obs-control toggle-recording
to their configuration. What's more, they can do this in response to other system events. A user might wish to change the recording configuration of OBS in response to an application opening, and it now becomes possible to write a script which opens the application and applies the change.

If your disdain for desktop isolation is so great, you needn't even use D-Bus. Registering a simple UNIX socket that accepts commands would work equally well in this case.

What's really desired here is a standard way for programs to expose user-facing commands to the system, which is clearly not within the scope of the specification for a display server. The problem with X11 is that it has for a long time exposed too much unrelated functionality like this to the user, and so many apps have become reliant on this and developers have neglected the creation of portable ways to achieve these objectives. A new specification for display servers that excludes this harmful behaviour is a clear long-term positive.

3 comments

I'm not sure how any of that sidesteps the point of my comment, which was having to rely on many different wayland compositors all implementing hotkeys properly.

I don't think it's always practical or desired to move the hotkey support completely out of the program itself. Most users (especially consumer/nontechnical people such as many OBS users) are not willing to setup hotkeys through a third-party program to manually get it to control OBS externally... so I think it needs to support hotkeys internally, whether there is also control possible via an external socket/dbus/etc. or not.

This is an excellent description of why this is an awful situation.

It's extremely user hostile.

> The problem with X11 is that it has for a long time exposed too much unrelated functionality like this to the user

It's not "unrelated functionality". It's an entirely generic ability to listen to events that is available with Wayland as well, just with an added restriction.

So either every user needs to manually bind every command using their WM's bespoke global hotkey mechanism, or the developer needs to ship keybinds for every possible WM.

Sounds like a nightmare for everyone involved to me

I think you've got it backwards. Applications like OBS do not typically register default global keybindings to avoid clobbering, you have to do it manually in their settings menu. The only difference with a generic interface is that the dialogue opened from the setting menu would be from the WM instead of OBS.
The problem with Wayland in this respect is that there is no such generic interface that works everywhere - each compositor may choose not to support it at all, or support it in different ways.

If there was a single standard way, great. In the meantime I'll stick to X11, which isn't this incredibly user-hostile.

That is not a problem with Wayland because specifying this is not a within the purview of Wayland. People like you don't seem to understand that Wayland is specification, and not an implementation like X11.
No, i understand that, and consider it a failing of Wayland
Yes, the generic interface which does not exist, has no defined standard, and is likely to be different for each WM.

That doesn't really change what i said.