1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-11-24 05:02:29 +00:00

Added flasher.sh to link/view/copy flash videos

This commit is contained in:
J.Fernando Sánchez 2012-01-07 15:18:44 +01:00
parent 28b14bc7aa
commit 846a571cb0
2 changed files with 25 additions and 14 deletions

25
flasher.sh Executable file
View File

@ -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

View File

@ -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"