I am trying to add a custom command to Nemo (Linux Mint). I have the following script I've been running via the terminal (by manually changing directories):
ls | cat -n | while read n f; do mv "$f" "$n.jpg"; done
The desire is to take every file in a folder (all images) and mass rename them, in sequential order (1.jpg, 2.jpg, etc.). It's cumbersome to open terminal into each folder and then run the command, etc so I want to add a custom command to Nemo. I have tried the following .nemo_action:
[Nemo Action]
Name=Sequential Rename
Comment=Sequentially Rename All Files In Folder
Exec=ls | cat -n | while read n f; do mv "$f" "$n.jpg"; done
Icon-Name=Terminal
Selection=s
Extensions=dir;
Unfortunately, what has happened is that the command seems to be run in my username's folder, renaming my Documents, Music, Videos, Pictures, and Downloads folders into 1.jpg, 2.jpg, etc.
Does anyone have a solution to this? Ideally, I want to right click on a folder and press this action button to have it run.