一个博客

Spotify For Linux

Posted at — Mar 3, 2021

苦寻许久发现Spotify或许是最佳的Linux端音乐播放器。下面记录一下配置过程。

Preview

Preview

安装

详见Spotify官网,下面给出本人安装过程

添加源

$ curl -sS https://download.spotify.com/debian/pubkey_0D811D58.gpg | sudo apt-key add - 
$ echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list

更新源并安装

sudo apt-get update && sudo apt-get install spotify-client

大功告成!

若不是Spotify订阅用户,使用时会弹出广告且播放音乐时也有语音广告体验不佳。本学生党找到了一条歪路。。

配合去除广告插件提升听歌体验

官方插件在此-Adblock下面给出本人安装过程

需要的依赖:

$ git clone https://github.com/abba23/spotify-adblock-linux.git     //下载包
$ cd spotify-adblock-linux    //切换至目录
$ wget -O cef.tar.bz2 https://cef-builds.spotifycdn.com/cef_binary_88.1.6%2Bg4fe33a1%2Bchromium-88.0.4324.96_linux64_minimal.tar.bz2    //下载文件
$ tar -xf cef.tar.bz2 --wildcards '*/include' --strip-components=1    //解压
$ make   //make安装
$ sudo make install   //安装

使用command启动

$ LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify

添加快捷方式启动

$ cd ~/.local/share/applications
$ sudo vim spotify-adblock.desktop

粘贴以下

[Desktop Entry]
Type=Application
Name=Spotify (adblock)
GenericName=Music Player
Icon=spotify-client
TryExec=spotify
Exec=env LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify %U
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;Player;AudioVideo;
StartupWMClass=spotify

退出vim安装完成,通过系统找到Spotify固定至任务栏开始享用