Код:
#!/bin/sh
#
# This script unrars to a directory specified in gdialog and
# redirects stdout to a log file.
#
# Distributed under the terms of GNU GPL version 2 or later
#
# Copyright (C) Keith Conger
#
# Install in your ~/Nautilus/scripts directory.
# You need to be running Nautilus 1.0.3 +
UNRAR_PATH=/usr/bin #Path to unrar binary.
gdialog --title "passwd" --inputbox "" 2>/tmp/pass.log
$UNRAR_PATH/unrar t -p`cat /tmp/pass.log` -kb "$1" 2>>/tmp/"$1".log
if [ -s /tmp/"$1".log ]
then
gdialog --separate-output --title "unrar error log" --textbox /tmp/"$1".log 50 70 2>&1
else gdialog --separate-output --title "unrar log" --msgbox "Archive OK"
fi
rm /tmp/"$1".log /tmp/pass.log
Небольшое примечание:
1. Измените путь к винрару если он не соответсвует вашему (просмотреть путь можно набрав в консоли which unrar)
2. Скопируйте код выше в ~/.gnome2/nautilus-scripts/
3. Скрипт должен быть исполняемым
Комментариев нет:
Отправить комментарий