gnome-shell-extension-gsconnect icon indicating copy to clipboard operation
gnome-shell-extension-gsconnect copied to clipboard

Send clipboard on demand only and/or send text

Open getzze opened this issue 4 years ago • 19 comments

The clipboard plugin is nice but it shares EVERY text with the phone. It would be nice to have the possibility to send the clipboard on demand, like this new feature request in KDE connect: https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/396

Otherwise (or in addition to the other feature), a button that opens a small text entry (like the sms window) and then sends this text to the phone would be great. On Android you can do something similar by selecting text and sharing it via KDE connect.

getzze avatar Sep 08 '21 22:09 getzze

This should be easy already, there are settings in the preferences for automatic bi-directional sync:

Screenshot from 2021-09-08 15-37-19

And there are two GActions, exposed over D-Bus, device.clipboardPull and device.clipboardPush that can be assigned to keyboard shortcuts. Were you thinking something else?

andyholmes avatar Sep 08 '21 22:09 andyholmes

The GAction would have to be defined for a specific device, but I have several devices. I was thinking of buttons in the menu: gsconnect

getzze avatar Sep 08 '21 23:09 getzze

If you add clipboardPush/clipboardPull to the GSettings key:

/org/gnome/shell/extensions/gsconnect/<device-id>/menu-actions

Whose default value is

["sms", "ring", "mount", "commands", "share", "photo", "keyboard"]

Do they show up in the menu then? You might have to restart the service for it to take effect (I can't remember).

andyholmes avatar Sep 08 '21 23:09 andyholmes

I don't have the menu-actions key in /org/gnome/shell/extensions/gsconnect/<device-id>/ and I don't know how to create it with dconf Editor.

getzze avatar Sep 08 '21 23:09 getzze

Something like this should work:

dconf write /org/gnome/shell/extensions/gsconnect/<device-id>/menu-actions '["sms", "ring", "mount", "commands", "share", "photo", "keyboard", "clipboardPull", "clipboardPush"]'

andyholmes avatar Sep 08 '21 23:09 andyholmes

It's not working, the actions in the menu are unchanged (Messaging, Ring, ...)

In the meantime I remembered that you can send text with the Share action, it is so hidden that I had forgotten :)

getzze avatar Sep 09 '21 00:09 getzze

Did you restart the service? I'm not sure there's any machinery for handling the menu actions changing on the fly.

touch ~/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js

andyholmes avatar Sep 09 '21 00:09 andyholmes

I logged out after sending the dconf command. When I logged in, the previous items appeared in the menu of my device, then evething disappeared after 1s. Then some time later the items reappeared. But clipboardPull and clipboardPush never appeared. I have another device connected that showed the normal items all the time. It seems it first showed the items in cache, then tried to add the new ones but failed so all the menu disappeared and then it went back to default afterwards.

getzze avatar Sep 09 '21 09:09 getzze

Yes, there's no real testing that case. The menu code could all probably use a good look.

andyholmes avatar Sep 09 '21 15:09 andyholmes