Open jokeyrhyme opened 1 year ago
This might not be part of the first alpha, but we have been waiting for this portal to arrive. We plan to make this a central part of our key-bindings and key-customization story, so support is definitely on the roadmap rather sooner than later.
It is not yet clear, how the key bindings would be communicated back to the compositor (likely through some non-existent private wayland protocol), but if you want to contribute a implementation of the frontend to the portal, that would be very welcome.
Yeah, the trick is allowing xdg-desktop-portal-cosmic to communicate with cosmic-comp in order to set the keyboard shortcut
hyprland did implement a custom wayland protocol to allow xdg-desktop-portal-hyprland to talk to hyprland for this purpose: https://github.com/hyprwm/hyprland-protocols/blob/main/protocols/hyprland-global-shortcuts-v1.xml
cosmic-comp could also expose a DBus API, or have a separate UNIX socket, or we could adopt hyprland's wayland protocol, or come up with our own wayland protocol
Or (and I doubt this is the approach we'd take), xdg-desktop-portal-cosmic could directly modify cosmic-comp's config.ron, cosmic-comp could reload it after receiving an fs inotify or a SIGHUP or something
I did propose a general purpose solution that relies on DBus and shell scripts to make this work ( https://github.com/emersion/xdg-desktop-portal-wlr/issues/240#issuecomment-1546811352 ) but that wouldn't be necessary here seeing as xdg-desktop-portal-cosmic only has to support cosmic-comp (and vice versa)
GlobalShortcuts portal briefly mentioned here: https://github.com/pop-os/cosmic-comp/pull/283
It is not yet clear, how the key bindings would be communicated back to the compositor (likely through some non-existent private wayland protocol)
Could/should cosmic-comp
subscribe to changes in cosmic-config
the same way other components do, and have that be the way it learns when keyboard shortcuts have changed?
Ah, I'm just realising that keybindings set via GlobalShortcuts are likely session-only, and probably shouldn't be persisted to disk, so cosmic-config
would need a separate session-only concept if it were to be used for communicating GlobalShortcuts with other components
Right so there are multiple open questions on this subject.
Lets first define some names:
Default Shortcuts are set by cosmic-comp and should likely include most of whats defined in the default-config file today. They could be overridden/replaced by static/dynamic shortcuts at runtime.
One set of open questions regards the "Static Shortcuts". They should be managed via cosmic-config for easy persistence and access for all components.
Open questions:
MPRIS
work then? Would cosmic-comp start a cli tool and call a dbus-service or something like that?The other set of questions concerns the dynamic shortcuts:
Howdie, thanks so much for sharing your work here
I noticed that there has been work done on specifying a portal for GlobalShortcuts: https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.GlobalShortcuts
This would be useful for communications apps that have push-to-talk functionality, as well as various other use cases
Do you know if this is likely to be on the roadmap? Or is it considered out-of-scope or otherwise not part of your project goals/vision?
Note that KDE does seem to advertise support for this portal: https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/blob/master/data/kde.portal#L3
To clarify: I'm grateful for the work shared here, and am curious about whether this work is already planned or if you'd accept a PR that implements this, I do not expect a timeline or ETA :people_hugging: