From f140a1642ebfde198946ad6760c1003c1cb9a8c3 Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Sat, 11 Aug 2012 02:40:34 +0200 Subject: scripts --- bin/flash | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 bin/flash (limited to 'bin/flash') diff --git a/bin/flash b/bin/flash new file mode 100755 index 0000000..6cee48d --- /dev/null +++ b/bin/flash @@ -0,0 +1,21 @@ +#!/bin/sh +# Play flash videos in mplayer +# https://bbs.archlinux.org/viewtopic.php?pid=901228#p901228 + +# The original: works only when there is only one plugin-container process +# mplayer $(d=/proc/$(pidof plugin-container)/fd; ls --color=no -l $d | gawk '/\/tmp\/Flash/ {print "'$d'/" $9}' ) + +videos= +for pid in $(pidof plugin-container) +do + d=/proc/$pid/fd + videos="$videos $(ls --color=no -l $d | gawk '/\/tmp\/Flash/ {print "'$d'/" $9}')" +done + +if [ "$videos" ] +then + mplayer $videos +else + echo 'No Flash is loaded' + exit 1 +fi -- cgit v1.2.3-24-g4f1b