From 846a571cb04617d4f7e6ed54b2564a265445f7bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2EFernando=20S=C3=A1nchez?= Date: Sat, 7 Jan 2012 15:18:44 +0100 Subject: [PATCH] Added flasher.sh to link/view/copy flash videos --- flasher.sh | 25 +++++++++++++++++++++++++ lncuevana.sh | 14 -------------- 2 files changed, 25 insertions(+), 14 deletions(-) create mode 100755 flasher.sh delete mode 100755 lncuevana.sh diff --git a/flasher.sh b/flasher.sh new file mode 100755 index 0000000..f15878d --- /dev/null +++ b/flasher.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Script to copy/link Cuevana files to your home directory or play them with your default video player. +# Tested only with one cuevana instance at a time. +# The video can be played, but it's deleted when the flash player is closed (unless you copied it). +# @author: balkian + +destfile="$HOME/VideoCuevana$$" +info=($(lsof -c /npview/i | grep -i /tmp/flash | awk '{print $2; print $9}')) +dir="/proc/${info[0]}/fd" +file=${info[1]} +#echo "pid" $pid +#echo "file" $file +fdn=$(ls -l $dir | grep $file | awk '{print $8}') +sel=$(zenity --list --radiolist --text "Select action" --column "pick" --column "Option" TRUE "play" FALSE "copy" FALSE "link") +case $sel in + play) + xdg-open $dir/$fdn + ;; + link) + ln -s $dir/$fdn $destfile && echo "Video linked successfully to $destfile." && echo "Enjoy" + ;; + copy) + cp $dir/$fdn $destfile && echo "Video copied successfully to $destfile." && echo "Enjoy" + ;; +esac diff --git a/lncuevana.sh b/lncuevana.sh deleted file mode 100755 index e31bf72..0000000 --- a/lncuevana.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# Script to copy Cuevana files to your home directory. -# Tested only with one cuevana instance at a time. -# The video can be played, but I need to test if it's deleted when the flash player is closed. -# @author: balkian - -destfile="$HOME/VideoCuevana$$" -info=($(lsof -c /npview/i | grep -i /tmp/flash | awk '{print $2; print $9}')) -dir="/proc/${info[0]}/fd" -file=${info[1]} -#echo "pid" $pid -#echo "file" $file -fdn=$(ls -l $dir | grep $file | awk '{print $8}') -ln -s $dir/$fdn $destfile && echo "Video linked successfully to $destfile." && echo "Enjoy"