Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send clipboard on demand only and/or send text #1167

Open
getzze opened this issue Sep 8, 2021 · 11 comments
Open

Send clipboard on demand only and/or send text #1167

getzze opened this issue Sep 8, 2021 · 11 comments
Labels
enhancement A request for a feature or additional functionality help wanted An issue that needs contributors

Comments

@getzze
Copy link
Contributor

getzze commented Sep 8, 2021

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.

@andyholmes
Copy link
Collaborator

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?

@getzze
Copy link
Contributor Author

getzze commented Sep 8, 2021

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

@andyholmes
Copy link
Collaborator

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).

@getzze
Copy link
Contributor Author

getzze commented Sep 8, 2021

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.

@andyholmes
Copy link
Collaborator

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"]'

@getzze
Copy link
Contributor Author

getzze commented Sep 9, 2021

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 :)

@andyholmes
Copy link
Collaborator

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/gsconnect@andyholmes.github.io/service/daemon.js

@getzze
Copy link
Contributor Author

getzze commented Sep 9, 2021

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.

@andyholmes
Copy link
Collaborator

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

@andyholmes andyholmes added enhancement A request for a feature or additional functionality help wanted An issue that needs contributors labels Sep 9, 2021
@lantw44
Copy link

lantw44 commented Jul 28, 2024

This command works for me:

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

I use the panel instead of the default user menu due to #1640:

螢幕快照 2024-07-28 18-11-39

Now clipboard push is available as the second item.

@ferdnyc
Copy link
Member

ferdnyc commented Jul 29, 2024

Huh. How strange, that it would end up out of order like that. Looking at the code, items are even inserted with an index number that corresponds to their position in the menu-actions list — unless they don't have an index (meaning it gets defaulted to -1, in which case they're appended to the list. But I can't see why something would be inserted forward of its real position.

Hmm. Unless maybe the insertion somehow wraps around — because, the index of clipboardPush would be 6, and at the time it's inserted the menu would only have 5 items (since "commands" appears to be missing).

...But, no, if that were the case then "share" and "keyboard" would have the same issue. (Oh, but wait, they're also out of order — or, rather, their order is swapped. How odd.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A request for a feature or additional functionality help wanted An issue that needs contributors
Projects
None yet
Development

No branches or pull requests

4 participants