mirror of
https://github.com/Rigellute/spotify-tui.git
synced 2026-04-26 16:15:55 +03:00
[GH-ISSUE #741] Cannot initialize headlessly: "Error: no context available" #299
Labels
No labels
bug
enhancement
good first issue
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-tui#299
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @j-hui on GitHub (Feb 20, 2021).
Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/741
I run spotifyd as a service that starts automatically on boot. When I boot up my machine, I'd like it so that I can immediately start using spt's CLI to interact with spotifyd without having to first go into the UI and select a device.
I was trying to do this via:
spt playback --device <device-name>, but it would tell meError: no context available. If I go into the UI to select a device, the CLI works as normal.I'm wondering if there's something I'm missing here, or if what I'm trying is at all possible?
@OrangeFran commented on GitHub (Feb 21, 2021):
The command line interface and the terminal user interface do not share functionality. The
playbackcommand is there to control the playback of a device. By default,spt playback --device <device-name>will just output the current song on the specified device. If nothing is playing, it will output the error message you received.Maybe you want to start a playlist? Then you can just use
spt play --playlist --name <playlist-name> --device <device-name>. Now regarding the device selection: I think spotify-tui stores the last used device id in a file so you do not always have to use the--deviceflag. I hope I could help.@OrangeFran commented on GitHub (Feb 21, 2021):
The
playbacksubcommand is just there to pause, shuffle, repeat, skip and other stuff. You play something withplay. And to list or search you can uselistandsearch.@j-hui commented on GitHub (Feb 22, 2021):
I think I understand now, thanks @OrangeFran . I suppose what I was trying won't work, but that's ok.
Another thing that I wanted to do was just to be able to start playing on my current machine after it reboots (or in any other situation where Spotify believes nothing is playing on my current device). And I wanted to this without invoking the
sptGUI (e.g., so that I can just run it via Rofi). What seems to work is to runspt playback --transfer <device-name>, which will allow me to continue playing whatever was playing before on my current device.@trbKnl commented on GitHub (Sep 27, 2021):
I am trying to do the exactly same thing, this is also relevant if for whatever reason spotifyd has been restarted (in case of system resume after sleep for example).
Steps to reproduce:
With info in the answer of j-hui I created a "toggle" script which works for my purposes: