spicetify / cli

Command-line tool to customize Spotify client. Supports Windows, MacOS, and Linux.
https://spicetify.app
GNU Lesser General Public License v2.1
18.54k stars 730 forks source link

spicetify breaks spotify on Ubuntu #175

Closed benjaminBrownlee closed 4 years ago

benjaminBrownlee commented 4 years ago

I have followed the basic instructions several times now yet i still can't get Spotify to launch normally after using this tool to apply a new theme. Of course, Spotify still operates fine when it is launched using spicetify apply, but trying to access Spotify in the usual manner results in the following manner, even after the backups have been restored:

benjamin:~$ spotify
Gtk-Message: 01:03:26.108: Failed to load module "canberra-gtk-module"
[0418/010326.238108:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command

Spotify will launch with a blank, unusable canvas. The only way to fix this is to reinstall Spotify, which have done multiple time now. This is not expected behavior, correct? Is there something I am doing incorrectly?

khanhas commented 4 years ago

Spicetify does not modify executable or binar files so it is not possible to "fail" anything on start up. Please try reinstall Spotify and run spicetify backup apply again.

benjaminBrownlee commented 4 years ago

@khanhas I figured out the issue is permissions related. When I tried to apply the spicetify theme, it requires root to open /usr/share/spotify/Apps, so my fix was to run the apply tool with sudo. But the apply tool must also be modifying other files and changing their owner to root, because spotify is only runnable as root after this. What is the workaround for this? Just change the owner of the file in the specified directory instead of using root?

benjaminBrownlee commented 4 years ago

I now see the FAQs suggest changing the permissions on all spotify files to be fully readable, writable and executable. This will definitely do the trick, but I feel like that is a poor way to approach the issue from a security standpoint, right? It appears that all files in the spotify folder are root, so running with sudo should not create issues, but spicetify then changes the permissions on the files to make them not readable outside of root. Why does this happen?

khanhas commented 4 years ago

Spicetify actually just need write permission for /usr/share/spotify/Apps. If you think applying permission for whole spotify directory is security problem, reinstall Spotify to original sate, then set "user" write permission for spotify folder itself (not recursively) andspotify/Apps folder. After that, you can run spicetify without sudo.

benjaminBrownlee commented 4 years ago

Sweet, that worked great, but I think a better fix would be to keep permissions and use sudo for applying instead of lowering the permissions of the files. Actually, spicetify apply can be run without issue expect that it changes the permissions of the Apps folder from 775 to 700, which is why it breaks spotify. An easy fix is sudo chmod 775 -R /usr/share/spotify/Apps, but it would be even easier if the script didn't change these permissions in the first place.

What are your thoughts on this @khanhas ?

khanhas commented 4 years ago

Thanks, I updated Wiki.