[Share Experiences] 状态栏歌词
Tofloor
poster avatar
火星漫游者
deepin
2024-03-30 19:40
Author

一、说明

状态栏歌词仅支持Gnome桌面,需要借助Gnome的executor插件来显示实时歌词,

实现方式为,封装了 get_lrc命令会解析YesPlayMusic 和 落雪音乐的api得到实时歌词,借助executor插件在状态栏展示,

deepin并不支持,若deepin提供了类似executor的状态栏插件,那么就可以直接接入;

deepin的状态栏插件开发流程是怎么样的,若有相关文档可以尝试开发下,欢迎回复UP主。

二、支持的播放器

  • YesPlayMusic
  • 落雪音乐(beta4,落雪作者提供了开发支持,目前还在beta阶段,后续正式版会有该功能)

播放器接入状态栏歌词需要提供API接口,有想法的同学可以留言~

三、效果

YesPlayMusic状态栏歌词

截图 2024-03-30 19-22-37_upscayl_1x_ultrasharp.jpg

落雪音乐状态栏歌词

截图 2024-03-30 02-37-15_upscayl_1x_ultrasharp.jpg

四、教程

https://www.bilibili.com/video/BV1PM4m1R7mM/?spm_id_from=333.788&vd_source=379f4a1b8c622777c5bc1436f69a9454

Reply Favorite View the author
All Replies
TXOS-C.User
deepin
2024-03-30 19:52
#1
Reply View the author
阿尼樱奈奈
deepin
2024-03-30 21:48
#2

agree

Reply View the author
王文昊·(Wenhao Wang)
deepin
2024-03-30 21:55
#3

@babyfengfjx 老冯你曾经征集过的状态栏歌词。要不要参考下。pride

Reply View the author
沈拙言
deepin
2024-03-30 22:35
#4

截图 2024-03-30 22-34-25.png
漂亮!

Reply View the author
新手小白
deepin
2024-03-31 11:08
#5
It has been deleted!
火星漫游者
deepin
2024-03-31 12:37
#6
新手小白 It has been deleted!

尝试下gnome桌面呗

Reply View the author
兆兆嘟嘟嘟
Moderator
2024-03-31 13:39
#7

yoyoos好像做过这个。

Reply View the author
ice
deepin
2024-04-11 22:01
#8

YesplayMusic 获取歌词的接口是啥?

Reply View the author
jiangyin14
deepin
2025-05-31 21:25
#9
ice

YesplayMusic 获取歌词的接口是啥?

zsiothsu/org.kde.plasma.yesplaymusic-lyrics的README:

YesPlayMusic在运行时会开放两个api获取歌曲信息,一个是 http://127.0.0.1:27232/player用来获取基本信息,另一个是 http://127.0.0.1:10754/lyric?id=用来获取歌词,两个api的返回值如下:

/* http://127.0.0.1:27232/player */:

{
    "currentTrack": {
    "name": "broKen NIGHT",
    "id": 476081900,
    // 此处省略一些没什么用的东西
    "progress":61.662793
}

/* http://127.0.0.1:10754/lyric?id=476081900 */:

{
     "sgc": false,
     "sfy": false,
     "qfy": false,
     "transUser": {
         "id": 2090794,
         "status": 99,
         "demand": 1,
         "userid": 59957287,
         "nickname": "虎纹鲨鱼子",
         "uptime": 1493869287084
     },
     "lyricUser": {
         "id": 2090785,
         "status": 99,
         "demand": 0,
         "userid": 59957287,
         "nickname": "虎纹鲨鱼子",
         "uptime": 1493869287084
     },
     "lrc": {
         "version": 16,
         "lyric": "[00:19.83]流れる星(ひかり)を\n[00:18.62]\n[00:26.19]ただ 重ねる指を\n"
     },
     "klyric": {
         "version": 0,
         "lyric": ""
     },
     "tlyric": {
         "version": 7,
         "lyric": "[by:虎纹鲨鱼子]\n[00:11.13]\n[00:19.83]向着流星祈愿\n[00:26.19]看,只要双手合十\n"
     },
     "romalrc": {
         "version": 4,
         "lyric": "[by:虎纹鲨鱼子]\n[00:11.13]\n[00:19.83]na ga re ru ho shi wo\n[00:26.19]ta da ka sa ne ru yu bi wo\n"
     },
     "code": 200
 }
Reply View the author