-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add sharing functionality #67
Conversation
This is great just one question. Why is "sharing" under "m" and not under "s"? |
Because |
Thanks for the PR! Other options:
Do you want to re-map it before I merge it? I'm fine with it either way. |
I'll move it to |
Do you have a preference on saving the selected song vs currently playing? |
To the clipboard? I'd say the currently selected, otherwise one needs to first play a song to share the link. What do you think? |
I can definitely see both usecases. We could amend the command with a parameter. |
I like the idea! |
I am struggling with finding out which track/element is currently selected. You could make it general to any selected "shareable" element, but right now I think that requires doing backwards parsing from Cursive. |
Commands are handled in their respective UI source files. The UI structs should have access to the currently selected track, e.g. |
That was indeed very helpful! Do you want me to move the entire |
If the single handler doesn't get too convoluted, I'd prefer that, as new code readers might miss the specific implementations distributed across the files. However, if it results in a too large method, it would seem reasonable to split it. Just my two cents, though. |
One last thing. I come from a functional programming background. If the command option chaining is too big I can easily break it up if you prefer. |
Looks good to me. I commented a minor detail, after that I think we can merge it. |
I updated the readme. I don't think I have anything else to add. |
Great, thanks a lot for your contribution. Merged! |
@Herbstein I cannot use this feature in Wayland. Is this suppose to work in Wayland? Edit: It seems the upstream project has not yet support Wayland, never mind. |
I do a lot of sharing of Spotify songs, and to make this my main client I need the feature. This implementation uses the key-bind
m
and the commandshare
to copy the currently playing song to the system clipboard.Creating a clipboard context for each time a share happens isn't great, but because sharing is (generally) a rare occurrence.
The new library is used by Mozilla in Servo so shouldn't be an issue to include.
Is copying the currently playing song the desired functionality, or would it be better to share the currently selected song? Maybe sharing the currently playing song only when used with a shift modifier. You could then modify the command to be either
share selected
orshare current
.