Update to Nautilus script to automatically fill folders on a folder name
autofill
# AutoFill, version 1.2, by Ian Spillane (ispillane at ccoc dot ie), 2008.
# A Nautilus script to automatically populate a folder with links to files matching the folder name. A simple but effective implementation for virutal folders for music, images, or any file type.
# Released on the GPL (http://www.gnu.org/copyleft/gpl.html).
# To do: Implementation of further search options, multiple key words, file types, etc., still based on a simple syntax in the folder name, e.g. black|white[image].
search=$*
if test -z "$*"
then
# If no arguments: install as Nautilus script
cp autofill ~/.gnome2/nautilus-scripts/autofill
echo "Installed as Nautilus script. To use, right-click on a folder in Nautilus and select scripts."
else
cd $search
# Make links in folder for every file matching name, except for .Trash
for f in $(find ~ | grep -i "$search" | grep -v "$(pwd)" | grep -v ".Trash" | sed s/[\ ]/{}/g)
do
file=$(echo $f | sed s/{}/\ /g ) # return spaces
link="$(date +"%H%M%S-%N")-$(basename "$file")"
ln -s "$file" "$link"
done
zenity --info --text="Done"
fi
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment