Sunday, December 23, 2012

spacefm batch rename

Finally got the Batch Rename plugin working in SpaceFM.

There's a list of user-contributed SpaceFM plugins at this page, and helpful information about installing the plugins in the SpaceFM User's Manual.

When you go to download the tarball for the Batch Rename plugin, note that at the top of this page, it says "requires rntools." So you also have to download the rntools tarball.

To install the Batch Rename plugin in SpaceFM: Plugins > Install > File > select the Batch Rename plugin > click "OK" > enter the root password.

In Debian Wheezy, I created the ~/bin directory, and extracted the rntools tarball to it. You have to make sure rntools is executable, and that it's in your $PATH. In my ~/.profile file, I noticed the following lines at the end:

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

So, that takes care of making sure that ~/bin is in my $PATH. I think you have to start a new session for it to take effect after creating ~/bin, though.

After all that, you can go to SpaceFM, select some files, and test the plugin out. Plugins > Batch Rename. That starts the script, and you'll see something like this:



I chose option #5.



The result:

steve[~/test]$ ls
testing1  testing2  testing3

Works well enough.


During the course of all this, I found a post at the Arch Linux forums, by "Paramvir," that provides info on using Thunar's Bulk Rename tool in SpaceFM. This is nice for Xfce users:

Here is a Bulk Rename Tip

If you use Thunar - it has an excellent bulk rename tool Thunar -B

To use it in SpaceFM - use the Tools menu - you can right click and get the New command and enter the name Bulk Rename. You get presented with the dialog for entering the command - enter Thunar -B %F and you are done.

Select a bunch of files to rename and then use the new Tools - Bulk Rename command and voila - you have the files inside the bulk rename program.

Originally had used thunar script Bulkrename but it gives a problem with names with spaces. Using Thunar -B does the same job but handles spaces in names.


I followed those steps and ended up with "Bulk Rename" under my Tools menu:



To test, I selected the files, then Tools > Bulk Rename.



And, of course, the result:

steve[~/test]$ ls
test1  test2  test3


Using Thunar's Bulk Rename tool in SpaceFM looks nicer than using the Batch Rename plugin, but I guess either one works fine. Whatever works.

No comments: