I'm a Gnome user and I'm trying KDE 5. When I was using Nautilus (Gnome), I had a bunch of shell script actions that worked on a list of selected file paths given by the variable $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
.
Reading this answer, I am aware that Dolphin actions provide the code %F: A list of files. Use for apps that can open several local files at once. Each file is passed as a separate argument to the executable program
.
The problem is that Each file is passed as a separate argument to the executable program, while my scripts are designed to work with the variable $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS.
Ideally, I would like to reuse my old scripts. Is it possible to convert the Dolphin's %F
list and set it as the variable $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
for my scripts?
You can get access to all the arguments passed to a script using
$@
in bash, this means technically you can create a wrapper script that first prepares a fake environment variable like this:Of course you can also simply modify your script to use
$@
like this if you want instead of the original nautilus variable:Also note in your
.desktop
file for ServiceMenus you'll want to do something like:Notice that
%F
doesn't have quotes around it.