BLOG main image
전체 (70)
글-음악 (12)
리눅스 (51)
기타 (1)
그림-사진 (6)
125386 Visitors up to today!
Today 4 hit, Yesterday 11 hit
daisy rss
tistory 티스토리 가입하기!
2007/11/10 05:25
노틸러스 사용중 파일의 복사 이동을 편하게 할수 있는 스크립(혼자말) 입니다.
혼자말이 위치할 디렉토리는 ~/.gnome2/nautilus-scripts 이며...
여기에 다음의 두파일 을 만든 후 노틸러스를 재시작 하면 됩니다.

$gedit ~/.gnome2/nautilus-scripts/복사
Code:
#! /bin/bash
location=`zenity --file-selection --directory --title="Select a directory"`
for arg
do
if [ -e "$location/$arg" ]; then
zenity --question --title="Conflict While Copying" --text="File $location/$arg already exists. Would you like to replace it?"
if [ "$?" = 1 ]; then
exit 1
fi
fi
cp -R "$arg" "$location" &
ORIG_SIZE=`du -bs "$arg"|awk '{print $1}'`
CP_SIZE=`du -bs "$location/$arg"|awk '{print $1}'`
(
while [ $CP_SIZE -ne $ORIG_SIZE ]; do
expr `expr $CP_SIZE \* 100` / $ORIG_SIZE
CP_SIZE=`du -bs "$location/$arg"|awk '{print $1}'`
done
echo 100
)| zenity --progress --auto-close --text "Copying \"$arg\"..."
done

$gedit ~/.gnome2/nautilus-scripts/이동
     Code:
#! /bin/bash
location=`zenity --file-selection --directory --title="Select a directory"`
for arg
do
if [ -e $location/$arg ];then
zenity --question --title="Conflict While Moving" --text="File "$location/$arg" already exists. Would you like to replace it?"
case "$?" in
1 ) exit 1 ;;
0 ) mv $arg $location ;;
esac
else
mv $arg $location
fi
done
실행권한 $ chmod 755 ~/.gnome2/nautilus-scripts/*
노틸러스를 재시작   $ killall nautilus
진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크
2007/11/10 05:25 2007/11/10 05:25
Trackback Address :: http://blog.jinbo.net/bundo/trackback/4
Name
Password
Homepage
Secret