Quite a lot of the documentation that I write for work involves using icons as part of the images that I create. It is quite a pain having to open an icon in an application just to resize it, change its colour or make it transparent. I always say, if you have to do something more than three times, script it. So I wrote a few Nautilus scripts for working with icons.
Nautilus scripts are little programs that add new options to the contextual menu of Nautilus file manager. This menu is displayed when you right click on a file or folder name in the file manager. The scripts are written inBash, so they should work on any Ubuntu distribution that uses Nautilus file manager. Of course, you can write your own scripts in whatever you like,Bash, PHP, Ruby, etc. I just use Bash.
Here is what the scripts do:
- change icon colours
- trim excess transparent or white space around an icon
- resize an icon
- make PNG icons transparent
- clean up all the files that various manipulations produce
I consider these scripts to be dedicated to the Public Domain, so they have neither license, responsibilities nor expectations. If you would like to send improvements, by all means do so, I would like that, but you don’t have to do so.
To use these scripts, download them, then copy them into the nautilus scripts directory:
and unzip them.
They should harmless, but there are no checks built in at all. In particular, I would not use the cleanup script except on folders where only icons are kept! Here is what one of the scripts looks like.
# Made by Derek Keats Converts black icon to white using inversion, or inverts any other colour
# This script is dedicated to the Public Domain. You may
# do what you wish with it.
for line in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
convert $filename -negate $outfile
Here are some commands to grab stuff from the command line.
mv Icon-manipulation.zip ~/.local/share/nautilus/scripts/
That’s it, if you right click on one or more icons in a folder, you should be able to execute these scripts from the Scripts popup menu. If you don’t see the commands, you will have to go into each directory and mark the files executable. You can do this using Nautilus file manager, or from the command by
chmod +x *
Download and install manually
Use the link below to grab the scripts:
Icon manipulation scripts