spotify-player: OpenSpotifyLinkFromClipboard does not work on Wayland
Describe the bug The action OpenSpotifyLinkFromClipboard to paste a spotify URL in spotify_player does not function on Wayland
To Reproduce
- Be on Wayland, no Xwayland
- Perform the action
- Observe logs
Expected behaviour It will get pasted and opened
Log and backtrace
2024-03-11T17:09:02.878456Z ERROR terminal_event{event=Key(KeyEvent { code: Char('O'), modifiers: KeyModifiers(SHIFT), kind: Press, state: KeyEventState(0x0) })}: spotify_player::event: Failed to handle event: get clipboard's content: XCB - couldn't establish conection: DisplayParsingError(DisplayNotSet)
2024-03-11T17:09:06.238562Z ERROR terminal_event{event=Key(KeyEvent { code: Char('O'), modifiers: KeyModifiers(SHIFT), kind: Press, state: KeyEventState(0x0) })}: spotify_player::event: Failed to handle event: get clipboard's content: XCB - couldn't establish conection: DisplayParsingError(DisplayNotSet)
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 16 (16 by maintainers)
Commits related to this issue
- Add `paste_command` to replace `copypasta` library and `clipboard` feature (#411) Resolves #393 ## Changes - add `paste_command` config option and use it to get clipboard's content - remove `c... — committed to aome510/spotify-player by aome510 3 months ago
- Better clipboard support (#421) Context for the PR: https://github.com/aome510/spotify-player/issues/393#issuecomment-2066613724 ## Breaking changes - remove `copy_command` and `paste_command` co... — committed to aome510/spotify-player by aome510 2 months ago
Thanks for the suggestion. I’ll think about what is the best way to handle this
Sorry for the misunderstanding, and that is very unfortunate. I’ve scoured all over GitHub for any other suitable clipboard libraries and it seems there isn’t. Don’t get me wrong, using the
copy_command
andpaste_command
approach is acceptable, but it’s very inconvenient for your users, including myself.Programs such as helix have many many checks for a suitable clipboard provider, and yazi executing all clipboard providers for a suitable one. I suggest you take the helix approach (seen here). Again, it is very unfortunate Rust does not have a universal clipboard 😦
Thats for copying. This issue is for pasting.
The routines used for copying
execute_copy_command
is not specific to a system clipboard, unlike pasting, which uses a library and imports XCB. That is why it doesn’t work, because the logs are from a library not a specific program error.