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

  1. Be on Wayland, no Xwayland
  2. Perform the action
  3. 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

Most upvoted comments

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 and paste_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.