[Zsh] kirkwood env update + Trash

This commit is contained in:
Mathieu Maret 2010-04-30 11:07:46 +02:00
parent 660c380b8d
commit 278184071b
2 changed files with 67 additions and 1 deletions

65
.zsh/70_Trash.zsh Normal file
View File

@ -0,0 +1,65 @@
##
## Part of configuration files for Zsh4
## AUTHOR: Hugues Hiegel <hugues@hiegel.fr>
##
## You are encouraged to use, modify, and redistribute
## these files with or without this notice.
##
## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS
##
TRASH=$ZDOTDIR/.trash
move_to_trash ()
{
FOLDER=$TRASH/$PWD
for element in $@
do
if [ -e $element ]
then
echo "Deleting $element..."
mkdir -p $FOLDER/${element:h}
mv -f $element $FOLDER/${element:h}/.
fi
done
}
list_deleted_elements ()
{
FOLDER=$TRASH/$PWD
if [ -d $FOLDER ]
then
ls -lad $(find $FOLDER -maxdepth 1 ! -wholename $FOLDER) | sed "s:$FOLDER/::"
else
echo "Nothing found in trash."
fi
}
undelete_from_trash ()
{
FOLDER=$TRASH/$PWD
for element in $@
do
if [ -e $FOLDER/$element ]
then
echo "Getting back $element..."
mkdir -p ${element:h}
mv $FOLDER/$element .
rmdir --ignore-fail-on-non-empty -p $FOLDER
else
echo "Not found in trash: $element"
fi
done
}
alias delete='move_to_trash'
alias undelete='undelete_from_trash'
alias lsdeleted='list_deleted_elements'
alias cdtrash='cd $TRASH/$PWD'
alias sotrash='cd ${PWD/$TRASH/}'
hash -d trash=$TRASH

View File

@ -8,7 +8,8 @@ export ANDROID_HOME=$HOME/Android/android-sdk-linux_86
export ANDROID_SKD=$ANDROID_HOME/platforms/android-1.6/
export ECLIPSE_HOME=$HOME/Tools/eclipse
export NETBEANS_HOME=$HOME/netbeans-6.8
export PATH=$NETBEANS_HOME/bin:$JAVA_HOME/bin/:$ANDROID_HOME/tools:$ANDROID_SKD/tools:$ECLIPSE_HOME:$PATH
export OOFICE_HOME=/opt/openoffice.org3/program
export PATH=$NETBEANS_HOME/bin:$JAVA_HOME/bin/:$ANDROID_HOME/tools:$ANDROID_SKD/tools:$ECLIPSE_HOME:$OOFICE_HOME:$PATH
#Perso Bin
export PATH=$HOME/bin/bin:$HOME/bin:$PATH