克莱门汀当前歌曲为同理心状态

克莱门汀当前歌曲为同理心状态

任何可用于将 Clementine 当前播放的歌曲设置为同理心状态的插件

[更新]

我试过了,但没有成功,这是我的问题https://stackoverflow.com/questions/7671763/error-setting-status-to-empathy-with-dbus/7760194#7760194

但我发现无法通过 dbus 设置 empathy 的状态

http://telepathy.freedesktop.org/spec/Connection_Interface_Simple_Presence.html#Method:SetPresence

问候

[更新] 在上面给出的堆栈溢出链接中找到答案 https://stackoverflow.com/questions/7671763/error-setting-status-to-empathy-with-dbus/8160857#8160857

答案1

有人提出,Stack Overflow 问题回答主题:

import dbus
session_bus = dbus.SessionBus()
player = session_bus.get_object('org.mpris.clementine', '/Player')
iface = dbus.Interface(player, dbus_interface='org.freedesktop.MediaPlayer')
metadata = iface.GetMetadata()
status = "♫ ".decode('utf8')+metadata["title"]+' - '+metadata["album"]+" ♫".decode('utf8')
print status
from gi.repository import TelepathyGLib as Tp
from gi.repository import GObject
loop = GObject.MainLoop()
am = Tp.AccountManager.dup()
am.prepare_async(None, lambda *args: loop.quit(), None)
loop.run()
am.set_all_requested_presences(Tp.ConnectionPresenceType.AVAILABLE,
'available', status)

答案2

评论中建议的脚本在我之后起作用了aptitude install libtelepathy-glib-dev

相关内容