Open emanrdesu opened 5 years ago
Check out #834. Once playerctl is installed, use:
$ playerctl metadata
to get current track's metadata.
To fetch the title:
$ playerctl metadata title
EDIT: You can get the length with:
$ playerctl metadata mpris:length
Divide this value by (1000*1000)
to convert in seconds.
How do I exactly do all that stuff in ArchLinux? I installed dbus-python and playerctl from the AUR, but PyGObject fails and the other first two I have on clue about.
I am on Ubuntu, but I just installed playerctl, started a video, and
ran playerctl metadata title
I want to access the current song playing in order to output it to my taskbar, but I'm unable because I have no easy way of retrieving this information.
Issue / Suggestion
Whenever a song is playing, write to a file ~/.config/mps-youtube/current_song, which is (for now) 1 line containing the song/video's title. If nothing's playing, the file should be empty. Maybe it shouldn't be restricted to just a line containg the title, but also multiple lines with other information, like perhaps video length
This is one of my favorite software, if this got implemented, it'd mean a great deal.