Skip to content

Add Copy/Move to context menu actions using Gtk.FileChooserNative - #797

Open
Twilight0 wants to merge 1 commit into
linuxmint:masterfrom
Twilight0:copy-move-to-action
Open

Add Copy/Move to context menu actions using Gtk.FileChooserNative#797
Twilight0 wants to merge 1 commit into
linuxmint:masterfrom
Twilight0:copy-move-to-action

Conversation

@Twilight0

Copy link
Copy Markdown

This PR introduces a standalone project adding two essential context menu actions to Nemo: Copy to... and Move to.... These actions allow users to copy or move selected files and folders to a destination chosen via the system's native folder picker.

Features

  • Multi-Selection Support: Fully works for multiple selected files or folders of any mime type.
  • Modern Desktop Integration: Uses Gtk.FileChooserNative to trigger the file picking dialog. This ensures native look-and-feel matching the active Cinnamon theme and provides compatibility with modern app sandboxing (e.g. Flatpaks using XDG Desktop Portals).
  • Location Persistence: Automatically remembers and persists the last destination folder selected for each action (saved separately in ~/.config/dory/last_copy_location.txt and last_move_location.txt). If the folder is not found or is missing, it safely falls back to the user's Home directory.
  • Non-Blocking Operation: Long running operations (e.g. copying large directories) run in a background thread to prevent UI freezing. A responsive progress dialog with a spinner and pulsing bar is displayed.
  • Smart Name-Collision Resolution: If a target file or folder already exists at the destination, the action automatically appends a numeric counter suffix (e.g., File (1).txt) rather than failing or silently overwriting data.
  • Error Handling: Displays descriptive error dialogs in case of failures (e.g. permission issues or out-of-disk-space warnings).
  • Upstream-Compliant Design: Avoids deprecated or forbidden Nemo/Cinnamon APIs and is fully validated via the upstream repository's validate-spice checks.

File Structure

copy-move-to@twilight0/
├── info.json
├── CHANGELOG.md
├── README.md
├── copy-move-to@twilight0.nemo_action.in
├── move-to@twilight0.nemo_action.in
└── files/
    └── copy-move-to@twilight0/
        ├── copy_move_action.py
        ├── metadata.json
        └── icon.png

How to Test

  1. Copy the copy-move-to@twilight0 directory to ~/.local/share/nemo/actions/.
  2. Right-click any file or folder in Nemo/Dory.
  3. Select Copy to... or Move to... from the context menu.
  4. Select a destination folder using the native file chooser.
  5. Verify the files are correctly moved/copied, and that the last folder is remembered for subsequent actions.

@Twilight0
Twilight0 force-pushed the copy-move-to-action branch from 7b29d23 to 1d70c4b Compare June 25, 2026 17:34
@mtwebster

mtwebster commented Jun 25, 2026

Copy link
Copy Markdown
Member

Nemo already has copy/move-to context menu items.
image

Unless you plan on packaging nemo, or your 'fork', as a Flatpak (a bad idea), the 'modern desktop integration' argument is makes no sense, either. edit: not accurate, sorry.

@Twilight0

Copy link
Copy Markdown
Author

Native option includes an additional step, while this does not. Also this saves last location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants