python script fr nemo to copy or link selected files to other pane

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Post Reply
sagetumbleweed
Level 1
Level 1
Posts: 1
Joined: Fri Jan 19, 2024 10:58 pm

python script fr nemo to copy or link selected files to other pane

Post by sagetumbleweed »

In 2 panel mode, one can simply drag a file from one panel and into the other.
It will either be moved, or copied depending on whether the 2 panes are on the same disk.
That's not what I want.
I had python scripts for Nemo that moved, copied, and linked selected files to the open folder in the other panel. (Lost 4 drives in a storm).
It would be trivial except I don't know what the other panel is called.
The current panel's folder would be NAUTILUS_SCRIPT_CURRENT_URI
What would be the other panel's URI?

Thanks
~steve~
Shiva
Level 3
Level 3
Posts: 141
Joined: Thu Jul 07, 2022 11:25 am

Re: python script fr nemo to copy or link selected files to other pane

Post by Shiva »

sagetumbleweed wrote: Fri Jan 19, 2024 11:18 pm In 2 panel mode, one can simply drag a file from one panel and into the other.
It will either be moved, or copied depending on whether the 2 panes are on the same disk.
That's not what I want.
I had python scripts for Nemo that moved, copied, and linked selected files to the open folder in the other panel. (Lost 4 drives in a storm).
It would be trivial except I don't know what the other panel is called.
The current panel's folder would be NAUTILUS_SCRIPT_CURRENT_URI
What would be the other panel's URI?

Thanks
~steve~
Hello,
From /usr/share/nemo/script-info.md :

Code: Select all

In all cases, the following environment variables will be
set by Nemo, which the scripts may use:
- NEMO_SCRIPT_SELECTED_FILE_PATHS: newline-delimited paths for selected files (only if local)
- NEMO_SCRIPT_SELECTED_URIS: newline-delimited URIs for selected files
- NEMO_SCRIPT_CURRENT_URI: URI for current location
- NEMO_SCRIPT_WINDOW_GEOMETRY: position and size of current window
- NEMO_SCRIPT_NEXT_PANE_SELECTED_FILE_PATHS: newline-delimited paths for selected files in the inactive pane of a split-view window (only if local)
- NEMO_SCRIPT_NEXT_PANE_SELECTED_URIS: newline-delimited URIs for selected files in the inactive pane of a split-view window
- NEMO_SCRIPT_NEXT_PANE_CURRENT_URI: URI for current location in the inactive pane of a split-view window
Hope that's what you're looking for.
Post Reply

Return to “Scripts & Bash”