Skip to content

Expose `SharePlugin.shareText()` in GUI.

Will Chen requested to merge intralexical/kdeconnect-kde:share-text_qml into master

This adds an option to the systray plasmoid to call .shareText() with the current clipboard contents.

This should be equivalent to:

$ kdeconnect-cli -d <DEVICE_ID> --share-text "$(xclip -o -selection clipboard)"


Compare with: !396 (closed)

I was unaware of the above MR when I made this for my own customization. I have taken a much simpler approach that does not include modifying any plugin behaviour, only the UI.

This way, if a user does not want automatic synchronization of every clipboard update but still wants to be able to share text, they may simply leave the clipboard plugin disabled, and use the sharing plugin's text feature instead.

Note that the description for the "Share and receive" plugin currently says "Receive and send files, URLs, or plain text easily". As a user, I spent significant time digging through my computer and on the Internet trying to figure out how to do the "or plain text" part. So personally I consider this change to be bringing the exposed feature set closer to what it is presented as.

I went back and forth a lot on the icon to use. edit-paste-symbolic looked best on my own configuration. However, it might need to be added to the default themes/Breeze. Also, there's a couple variations— edit-paste and editpaste are both valid icons sometimes, apparently. For what I can tell, versions that aren't symbolic are shrunk down and may look too small in some themes.

Using an invisble TextEdit to access the clipboard feels a little hacky. But for how simple it is, it is probably also the cleanest and therefore most robust way to do this.

Oh, implements 392164, I suppose.


This is my first time doing any KDE or QML. I was a little shocked how readable and expressive the codebase is.

Edited by Will Chen

Merge request reports