You are not logged in.

#1 2010-09-25 16:49:09

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

script to show current mplayer video in dzen2

hey.. i am trying to show the filename of the currently playing file in mplayer with dzen2.

this is what i tried by now:

mplayer Last\ Action\ Hero.mkv |&grep Playing | dzen2 -dock -p 2

while this does show what i want it has 2 major issues:

- It displays the filename AFTER mplayer quits, which is definately not what i want.
- it does not work with wildcards (mplayer *.avi)


Any ideas?

Last edited by Rasi (2010-09-25 17:20:11)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#2 2010-09-25 17:57:29

livibetter
Member
From: Taipei
Registered: 2008-05-14
Posts: 95
Website

Re: script to show current mplayer video in dzen2

Here is a snippet I extract from my another script:

#!/bin/bash

exec 8> >(mplayer -msglevel all=5 *.avi | grep Playing)
subshell_pid=$!
while true; do
    ps $subshell_pid &> /dev/null
    (( $? != 0 )) && break
done
exec 8>&-

I was trying to get real-time output of mplayer when I was writing that script. It should resolve well for your two issues.

Last edited by livibetter (2010-09-25 17:59:26)

Offline

Board footer

Powered by FluxBB