mirror of
https://github.com/balkian/dotfiles.git
synced 2024-11-23 12:42:29 +00:00
Working with latest flash (requires sudo)
This commit is contained in:
parent
d38a226922
commit
cf0a81e5e7
33
flasher.sh
33
flasher.sh
@ -5,22 +5,29 @@
|
|||||||
# @author: balkian
|
# @author: balkian
|
||||||
|
|
||||||
destfile="$HOME/VideoCuevana$$"
|
destfile="$HOME/VideoCuevana$$"
|
||||||
PID1=$(pgrep -f flash)
|
# PID1=$(pgrep -f flash)
|
||||||
info=($(lsof -p $PID1 | grep -i /tmp/flash | awk '{print $2; print $9}'))
|
# info=($(lsof -p $PID1 | grep -i /tmp/flash | awk '{print $2; print $9}'))
|
||||||
dir="/proc/${info[0]}/fd"
|
# dir="/proc/${info[0]}/fd"
|
||||||
file=${info[1]}
|
# file=${info[1]}
|
||||||
#echo "pid" $pid
|
# #echo "pid" $pid
|
||||||
#echo "file" $file
|
# #echo "file" $file
|
||||||
fdn=$(ls -l $dir | grep $file | awk '{print $9}')
|
# fdn=$(ls -l $dir | grep $file | awk '{print $9}')
|
||||||
sel=$(zenity --list --radiolist --text "Select action" --column "pick" --column "Option" TRUE "play" FALSE "copy" FALSE "link")
|
files=$(sudo lsof 2>/dev/null | grep "Pepper Data" | awk '{gsub(/[a-Z]/,"",$4);print "/proc/"$2"/fd/"$4}')
|
||||||
case $sel in
|
|
||||||
|
echo "Files:" $files
|
||||||
|
for file in $files; do
|
||||||
|
|
||||||
|
sel=$(zenity --list --radiolist --text "Select action for: $file" --column "pick" --column "Option" TRUE "play" FALSE "copy" FALSE "link")
|
||||||
|
case $sel in
|
||||||
play)
|
play)
|
||||||
xdg-open $dir/$fdn
|
sudo totem $file
|
||||||
;;
|
;;
|
||||||
link)
|
link)
|
||||||
ln -s $dir/$fdn $destfile && echo "Video linked successfully to $destfile." && echo "Enjoy"
|
ln -s $file $destfile && echo "Video linked successfully to $destfile." && echo "Enjoy"
|
||||||
;;
|
;;
|
||||||
copy)
|
copy)
|
||||||
cp $dir/$fdn $destfile && echo "Video copied successfully to $destfile." && echo "Enjoy"
|
cp $file $destfile && echo "Video copied successfully to $destfile." && echo "Enjoy"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
done;
|
||||||
|
Loading…
Reference in New Issue
Block a user