egorgry
Just post some of your usefull scripts in here for all to enjoy.
These are nautilus scripts for gnome users they go in your home under .gnome2/nautilus-scripts
Quote:# This script either opens a gnome terminal in the current directory, # or in the selected directory
base=`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3-`
if [ -z "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
dir=$base
else
while [ ! -z "$1" -a ! -d "$base/$1" ]; do shift; done
dir="$base/$1"
fi
gnome-terminal --working-directory="$dir"
Quote:#!/bin/sh
# show hidden files
#obsoleted by gnome2.8
OLDSTATE=$(gconftool-2 --get "/desktop/gnome/file_views/show_hidden_files")
if [ "$OLDSTATE" == "false" ] ; then
NEWSTATE="True"
else
NEWSTATE="False"
fi
gconftool-2 --set "/desktop/gnome/file_views/show_hidden_files" --type boolean $NEWSTATE
Quote:#scale images to 800x600 and put a 6x6 pixle black border around image
#needs image magick
#need to make file size selectable using zenity
for i in *.jpg *.JPG *.png *.PNG *.jpeg *.JPEG
do
cp $i /home/web/
done
cd /home/web
for i in *.jpg *.JPG *.png *.PNG *.jpeg *.JPEG
do
mogrify -scale 800x600 -border 6x6 -bordercolor black $i
done
zenity --info --text="Your files have been scaled to 800x600 and moved to /home/web"
These are nautilus scripts for gnome users they go in your home under .gnome2/nautilus-scripts
Quote:# This script either opens a gnome terminal in the current directory, # or in the selected directory
base=`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3-`
if [ -z "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
dir=$base
else
while [ ! -z "$1" -a ! -d "$base/$1" ]; do shift; done
dir="$base/$1"
fi
gnome-terminal --working-directory="$dir"
Quote:#!/bin/sh
# show hidden files
#obsoleted by gnome2.8
OLDSTATE=$(gconftool-2 --get "/desktop/gnome/file_views/show_hidden_files")
if [ "$OLDSTATE" == "false" ] ; then
NEWSTATE="True"
else
NEWSTATE="False"
fi
gconftool-2 --set "/desktop/gnome/file_views/show_hidden_files" --type boolean $NEWSTATE
Quote:#scale images to 800x600 and put a 6x6 pixle black border around image
#needs image magick
#need to make file size selectable using zenity
for i in *.jpg *.JPG *.png *.PNG *.jpeg *.JPEG
do
cp $i /home/web/
done
cd /home/web
for i in *.jpg *.JPG *.png *.PNG *.jpeg *.JPEG
do
mogrify -scale 800x600 -border 6x6 -bordercolor black $i
done
zenity --info --text="Your files have been scaled to 800x600 and moved to /home/web"
Participate on our website and join the conversation
This topic is archived. New comments cannot be posted and votes cannot be cast.