web-dev-qa-db-ja.com

共感ステータスとしてのクレメンタインの現在の歌

クレメンタインの現在再生中の曲を共感ステータスとして設定するために利用できるプラグイン

[更新]

私は試しましたが成功しませんでした、これが私の問題です https://stackoverflow.com/questions/7671763/error-setting-status-to-empathy-with-dbus/7760194#7760194

しかし、私はdbusを通じて共感のステータスを設定することは不可能であることを理解しました

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

3
pahnin

この Stack Overflow Question が件名に回答することが示唆されています。

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
Marco Ceppi

コメントで提案されたスクリプトは、aptitude install libtelepathy-glib-devの後に機能しました。

0
Leonardo Amaral