diff options
author | Rasmus Steinke <rasi@xssn.at> | 2012-08-11 02:40:34 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2012-08-11 02:40:34 +0200 |
commit | f140a1642ebfde198946ad6760c1003c1cb9a8c3 (patch) | |
tree | 7538aa90092f99c661ec3abb4a69944767315dc5 /bin/flash | |
parent | e3fd45703267ce67d8b1e1fb53a4a1b4ccda551e (diff) | |
download | dotfiles-f140a1642ebfde198946ad6760c1003c1cb9a8c3.tar.gz dotfiles-f140a1642ebfde198946ad6760c1003c1cb9a8c3.tar.xz |
scripts
Diffstat (limited to 'bin/flash')
-rwxr-xr-x | bin/flash | 21 |
1 files changed, 21 insertions, 0 deletions
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 |