[GH-ISSUE #440] Add Shuffle & repeat to startup configuration file? #243

Open
opened 2026-03-02 23:45:51 +03:00 by kerem · 11 comments
Owner

Originally created by @mrfatboy on GitHub (Apr 29, 2024).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/440

Is it possible to set Shuffle and Repeat (others?) options in "app.toml" conf file?

I would like to set them both to True on start up without sending cli commands every time the Spotify player app restarts.

Originally created by @mrfatboy on GitHub (Apr 29, 2024). Original GitHub issue: https://github.com/aome510/spotify-player/issues/440 Is it possible to set Shuffle and Repeat (others?) options in "app.toml" conf file? I would like to set them both to True on start up without sending cli commands every time the Spotify player app restarts.
Author
Owner

@mrfatboy commented on GitHub (Apr 29, 2024):

A follow up question, currently there is a cli commands for toggling shuffle and repeat.

Can you add discrete On and Off commands? So when I send the on/off command I know exactly what state it is in.

Thanks

<!-- gh-comment-id:2083082651 --> @mrfatboy commented on GitHub (Apr 29, 2024): A follow up question, currently there is a cli commands for toggling shuffle and repeat. Can you add discrete On and Off commands? So when I send the on/off command I know exactly what state it is in. Thanks
Author
Owner

@mrfatboy commented on GitHub (Apr 30, 2024):

After experimenting with the repeat & shuffle commands I have some observations.

After I set Spotify player repeat to "context" it will get reset to off if Spotify player is restarted. However, if a new playlist is started the current repeat value is remembered. It would be good to have default settings in the app.toml file.

With regards to the shuffle command, it never gets remembered. It will always revert back to false on app restart as well as playing a new playlist (different from the repeat command). It would be good to have default settings in the app.toml file.

The current (non elegant) work around is start a playlist and toggle the shuffle. I have built a script that starts the playlist, sleep 5 seconds to give the playlist time to load then toggle the shuffle to True.

I don't know if these are Spotify limitations or Spotify_player bugs.

Please let me know what you think.

<!-- gh-comment-id:2084349766 --> @mrfatboy commented on GitHub (Apr 30, 2024): After experimenting with the repeat & shuffle commands I have some observations. After I set Spotify player repeat to "context" it will get reset to off if Spotify player is restarted. However, if a new playlist is started the current repeat value is remembered. It would be good to have default settings in the app.toml file. With regards to the shuffle command, it never gets remembered. It will always revert back to false on app restart as well as playing a new playlist (different from the repeat command). It would be good to have default settings in the app.toml file. The current (non elegant) work around is start a playlist and toggle the shuffle. I have built a script that starts the playlist, sleep 5 seconds to give the playlist time to load then toggle the shuffle to True. I don't know if these are Spotify limitations or Spotify_player bugs. Please let me know what you think.
Author
Owner

@aome510 commented on GitHub (Apr 30, 2024):

Can you add discrete On and Off commands? So when I send the on/off command I know exactly what state it is in.

Yes, should be easy to add one, but I will not be actively working on this project next few weeks. Open to PRs though.

<!-- gh-comment-id:2084387138 --> @aome510 commented on GitHub (Apr 30, 2024): > Can you add discrete On and Off commands? So when I send the on/off command I know exactly what state it is in. Yes, should be easy to add one, but I will not be actively working on this project next few weeks. Open to PRs though.
Author
Owner

@mrfatboy commented on GitHub (Apr 30, 2024):

Great. I look forward to the feature addition.

<!-- gh-comment-id:2084392747 --> @mrfatboy commented on GitHub (Apr 30, 2024): Great. I look forward to the feature addition.
Author
Owner

@aome510 commented on GitHub (Apr 30, 2024):

It will always revert back to false on app restart as well as playing a new playlist (different from the repeat command)

I know this as well and it's a limitation of the third-party library used for streaming (https://github.com/librespot-org/librespot/issues/19). However, shuffle should be the similar to repeat when playing a new playlist as I've implemented a patch in:

github.com/aome510/spotify-player@b3c0592c46/spotify_player/src/client/mod.rs (L196-L198)

Not sure if that's because you control the player using CLI. What's your setup?

<!-- gh-comment-id:2084394544 --> @aome510 commented on GitHub (Apr 30, 2024): > It will always revert back to false on app restart as well as playing a new playlist (different from the repeat command) I know this as well and it's a limitation of the third-party library used for streaming (https://github.com/librespot-org/librespot/issues/19). However, shuffle should be the similar to repeat when playing a new playlist as I've implemented a patch in: https://github.com/aome510/spotify-player/blob/b3c0592c46f32692a64784e750697ffd55b07533/spotify_player/src/client/mod.rs#L196-L198 Not sure if that's because you control the player using CLI. What's your setup?
Author
Owner

@mrfatboy commented on GitHub (Apr 30, 2024):

I built and run Spotify player on a macmini 2012 Ubuntu 22.04.

I am using your cli commands to control everything.

Is that what you are asking?

<!-- gh-comment-id:2084397863 --> @mrfatboy commented on GitHub (Apr 30, 2024): I built and run Spotify player on a macmini 2012 Ubuntu 22.04. I am using your cli commands to control everything. Is that what you are asking?
Author
Owner

@aome510 commented on GitHub (Apr 30, 2024):

I built and run Spotify player on a macmini 2012 Ubuntu 22.04.

Does it run as UI or daemon?

I am using your cli commands to control everything.

Do you run CLI commands in the same machine as the daemon?

<!-- gh-comment-id:2084401000 --> @aome510 commented on GitHub (Apr 30, 2024): > I built and run Spotify player on a macmini 2012 Ubuntu 22.04. Does it run as UI or daemon? > I am using your cli commands to control everything. Do you run CLI commands in the same machine as the daemon?
Author
Owner

@mrfatboy commented on GitHub (Apr 30, 2024):

I followed the instructions to make my own binary. The binary is either run directly from terminal (testing) to bring up the gui or I have Spotify player launched at startup.

Since you brought it up I wanted to ask you a related question. If I launch spotify player from terminal it opens the gui in that terminal window. If I launch it from startup I don't get a terminal gui window. Am I doing something incorrectly? I a not running a daemon service.

<!-- gh-comment-id:2085060966 --> @mrfatboy commented on GitHub (Apr 30, 2024): I followed the instructions to make my own binary. The binary is either run directly from terminal (testing) to bring up the gui or I have Spotify player launched at startup. Since you brought it up I wanted to ask you a related question. If I launch spotify player from terminal it opens the gui in that terminal window. If I launch it from startup I don't get a terminal gui window. Am I doing something incorrectly? I a not running a daemon service.
Author
Owner

@aome510 commented on GitHub (May 1, 2024):

If I launch it from startup I don't get a terminal gui window. Am I doing something incorrectly?

Not too familiar with this startup process, maybe you need to initiate the app with a terminal as spotify_player itself cannot spawn a terminal window. For example, IIRC, with kitty terminal, you can do it with

kitty --class floating spotify_player
<!-- gh-comment-id:2088547715 --> @aome510 commented on GitHub (May 1, 2024): > If I launch it from startup I don't get a terminal gui window. Am I doing something incorrectly? Not too familiar with this startup process, maybe you need to initiate the app with a terminal as `spotify_player` itself cannot spawn a terminal window. For example, IIRC, with kitty terminal, you can do it with ```shell kitty --class floating spotify_player ```
Author
Owner

@aome510 commented on GitHub (May 1, 2024):

Do you run CLI commands in the same machine as the daemon?

If you run the CLI in the same machine with the app/GUI, the shuffle state should be correct upon starting a new playback

<!-- gh-comment-id:2088548829 --> @aome510 commented on GitHub (May 1, 2024): > Do you run CLI commands in the same machine as the daemon? If you run the CLI in the same machine with the app/GUI, the shuffle state should be correct upon starting a new playback
Author
Owner

@mrfatboy commented on GitHub (May 2, 2024):

Everything is run one the same machine. Anytime I run a cli command to play a playlist the shuffle gets reset to false.

<!-- gh-comment-id:2091152997 --> @mrfatboy commented on GitHub (May 2, 2024): Everything is run one the same machine. Anytime I run a cli command to play a playlist the shuffle gets reset to false.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#243
No description provided.