You are not logged in.

#1 2018-02-02 14:11:36

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Media Player Info Script

Called without arguments, it returns the title (filled as intelligently as
possible, whether it's a network stream or a file without metadata) of the
currently playing song to stdout, clipped and ellipsized to a width of 60
chars, and a more verbose tooltip to stderr.
mpi-panel.png

Features and options include splitting into multiple lines respecting word boundaries, support of multiple players without having to settle on one, player controls dumped to a file, icons...

If you use tint2 it will fit right into its executor plugin, and that's what i wrote it for, but it doesn't require tint2 at all.

https://notabug.org/ohnonot/media-player-info

Last edited by ondoho (2018-06-22 01:34:09)

Offline

#2 2018-02-08 19:24:14

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Re: Media Player Info Script

there's been a few more commits.
i have a few ideas for additions already, and will definitely implement something, but it is stable now (famous last words).
i think the plugin thing is pretty neat, you can not only add other media players but hack existing functionality in a relatively simple way (plugin overrides builtin).

I've been using this script for over 2 years.
i think it could be useful for others, too?
what should i develop further, what features should i add? what's too much?

Offline

#3 2018-02-11 11:00:56

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Re: Media Player Info Script

added support for notification on song change and artwork display.

Offline

#4 2018-02-17 20:20:26

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Re: Media Player Info Script

the script can now also extract album art from local files.
i also fixed a glitch where enabling the -I option actually disabled the display of normal play/pause/stop icons, and improved mpd title recognition for e.g. soundcloud playlists.

somebody asked about openBSD support; it seems the BSDs don't ship with some fairly standard linux utilities. the missing pidof completely breaks the script.
anybody have an idea how i can reproduce that with ps or other bsd utilities without using pipes or too much additional logic?
the script just needs to know whether the media player is running, e.g. pidof mpd >/dev/null 2>&1.

i have updated the list of dependencies and will see what i can do about it.

Offline

#5 2018-02-17 22:32:04

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: Media Player Info Script

ondoho wrote:

the script just needs to know whether the media player is running, e.g. pidof mpd >/dev/null 2>&1

My OpenBSD box has pgrep, will that work?

Last edited by Head_on_a_Stick (2018-02-17 22:43:23)

Offline

#6 2018-02-19 15:44:21

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Re: Media Player Info Script

^ thanks, i just changed to pgrep, i think that should work on both systems.

also fixed one or two bugs.

Offline

Board footer

Powered by FluxBB