Giter Site home page Giter Site logo

Comments (14)

noelpilled avatar noelpilled commented on May 22, 2024 1

recently made the switch to nixos & not really in a comfortable place to figure out how to package this myself at the moment so I won’t be able to help :(

from spotify-player.

treeshateorcs avatar treeshateorcs commented on May 22, 2024 1

@aome510 hmmm, it isn't!

2023-09-09T17:44:41.506603Z INFO spotify_player: General configurations: AppConfig { theme: "dracula", client_id: "######", client_port: 8080, copy_command: Command { command: "xclip", args: ["-sel", "c"] }, playback_format: "{track} • {artists}\n{album}\n{metadata}", notify_format: NotifyFormat { summary: "{track} • {artists}", body: "{album}" }, tracks_playback_limit: 50, proxy: None, ap_port: None, app_refresh_duration_in_ms: 32, playback_refresh_duration_in_ms: 0, page_size_in_rows: 20, track_table_item_max_len: 32, play_icon: "▶", pause_icon: "▌▌", liked_icon: "♥", border_type: Plain, progress_bar_type: Rectangle, playback_window_position: Top, playback_window_width: 6, enable_media_control: true, enable_streaming: true, enable_cover_image_cache: true, default_device: "spotify-player", device: DeviceConfig { name: "fedora", device_type: "speaker", volume: 100, bitrate: 320, audio_cache: true } }

and here's my config

client_id = "#####"

[device]
name = "fedora"
volume = 100
bitrate = 320
audio_cache = true
copy_command = { command = "/usr/bin/wl-copy", args = [] } # linux

just to make sure it's in the correct place - /home/tho/.config/spotify-player/app.toml

edit 1: okay i've found the culprit copy_command should be at the top level, not at device

from spotify-player.

apprehensions avatar apprehensions commented on May 22, 2024

i suggest only displaying the link as copying it would require support for Wayland, X11, etc.

from spotify-player.

aome510 avatar aome510 commented on May 22, 2024

@apprehensions, @noelpilled can you guys test the changes in #110? The copy-link action should be available for all Spotify items. I only tested on macos. The default copy_command on Linux is xsel -ib but feel free to change it by setting copy_command option in app.toml file. For example,

copy_command = { command = "...", args = ["...", "..."] }

from spotify-player.

apprehensions avatar apprehensions commented on May 22, 2024

@aome510, why did you device to do a copy method via a copy command? why don't you just display the track link and have the terminal handle the copying? anyhoo, xsel should not be used; xclip should, as its the most used and well-known C xclipboard program. you should also provide an example for wayland via wl-copy.

however, since you said i can test:

copy_command = { command = "xclip", args = ["-sel", "c"] }
2023-01-19T11:24:27.311804Z  INFO client_request{request=GetUserPlaylists}: spotify_player::client: successfully handled the client request, took: 621ms
2023-01-19T11:24:29.580103Z ERROR terminal_event{event=Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-01-19T11:24:30.650885Z ERROR terminal_event{event=Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-01-19T11:24:30.696877Z ERROR terminal_event{event=Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-01-19T11:24:30.804890Z ERROR terminal_event{event=Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)

tl;dr, it doesn't work for me. xclip is similar to xsel as it takes in stdin as input by default.

from spotify-player.

aome510 avatar aome510 commented on May 22, 2024

why did you device to do a copy method via a copy command? why don't you just display the track link and have the terminal handle the copying?

I found it not trivial in my case to copy display text from the terminal. Not sure if it was because the text is rendered by TUI library but I couldn't just select it like I do normally with terminal text. That said, imo, most people would prefer to have one-step action to achieve the goal instead of displaying the link, trying to copy it with terminal.

tl;dr, it doesn't work for me. xclip is similar to xsel as it takes in stdin as input by default.

Judging from the log, it seems the app couldn't find xclip from your path. Can you specify the full path in the app.toml config file then try again?

from spotify-player.

aome510 avatar aome510 commented on May 22, 2024

xsel should not be used; xclip should, as its the most used and well-known C xclipboard program. you should also provide an example for wayland via wl-copy.

I could change it to xclip for linux. I'm not too familiar with wayland though

from spotify-player.

apprehensions avatar apprehensions commented on May 22, 2024

It supports simply displaying the link.. Right?

from spotify-player.

noelpilled avatar noelpilled commented on May 22, 2024

Curious what the use case for simply displaying the link is? Aren't the strings pretty long?

from spotify-player.

aome510 avatar aome510 commented on May 22, 2024

It supports simply displaying the link.. Right?

No, it uses a default command to copy the link to clipboard. Like I mentioned before, I found it nontrivial to display the link and copy to clipboard using my terminal.

from spotify-player.

treeshateorcs avatar treeshateorcs commented on May 22, 2024

i added

copy_command = { command = "wl-copy", args = [] } # linux

to my config, but i still can't copyTrackLink. when i press 5 nothing happens (not even the menu closes)

from spotify-player.

aome510 avatar aome510 commented on May 22, 2024

i added

copy_command = { command = "wl-copy", args = [] } # linux

to my config, but i still can't copyTrackLink. when i press 5 nothing happens (not even the menu closes)

Can you check if there is any errors in the application's log (in ~/.cache/spotify_player/)?

from spotify-player.

treeshateorcs avatar treeshateorcs commented on May 22, 2024

it says

2023-09-09T11:25:05.900974Z ERROR terminal_event{event=Key(KeyEvent { code: Char('5'), modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:06.141760Z ERROR terminal_event{event=Key(KeyEvent { code: Char('5'), modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:06.340173Z ERROR terminal_event{event=Key(KeyEvent { code: Char('5'), modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:06.496259Z ERROR terminal_event{event=Key(KeyEvent { code: Char('5'), modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:07.604987Z ERROR terminal_event{event=Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:07.801972Z ERROR terminal_event{event=Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:07.996163Z ERROR terminal_event{event=Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:08.150035Z ERROR terminal_event{event=Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:27:01.026774Z  INFO spotify_player::streaming: Got an event from the integrated player: TimeToPreloadNextTrack { play_request_id: 0, track_id: SpotifyId { id: 254099813482921766222209309487781320590, audio_type: Track } }
2023-09-09T11:27:02.022980Z  INFO client_request{request=GetCurrentPlayback}: spotify_player::client: successfully handled the client request, took: 996ms

even though wl-copy is in path

edit 1: even if i write the full path to wl-copy (/usr/bin/wl-copy) it says no such file or directory

edit 2: with the same config on macos everything works fine (except s/wl-copy/pbcopy)

from spotify-player.

aome510 avatar aome510 commented on May 22, 2024

it says

2023-09-09T11:25:05.900974Z ERROR terminal_event{event=Key(KeyEvent { code: Char('5'), modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:06.141760Z ERROR terminal_event{event=Key(KeyEvent { code: Char('5'), modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:06.340173Z ERROR terminal_event{event=Key(KeyEvent { code: Char('5'), modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:06.496259Z ERROR terminal_event{event=Key(KeyEvent { code: Char('5'), modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:07.604987Z ERROR terminal_event{event=Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:07.801972Z ERROR terminal_event{event=Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:07.996163Z ERROR terminal_event{event=Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:25:08.150035Z ERROR terminal_event{event=Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE })}: spotify_player::event: Failed to handle event: No such file or directory (os error 2)
2023-09-09T11:27:01.026774Z  INFO spotify_player::streaming: Got an event from the integrated player: TimeToPreloadNextTrack { play_request_id: 0, track_id: SpotifyId { id: 254099813482921766222209309487781320590, audio_type: Track } }
2023-09-09T11:27:02.022980Z  INFO client_request{request=GetCurrentPlayback}: spotify_player::client: successfully handled the client request, took: 996ms

even though wl-copy is in path

edit 1: even if i write the full path to wl-copy (/usr/bin/wl-copy) it says no such file or directory

edit 2: with the same config on macos everything works fine (except s/wl-copy/pbcopy)

interesting, can you provide a complete log as well? I want to make sure that the copy_command is correctly configured.

from spotify-player.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.