Add Copy file path to Nautilus right-click context menu#5793
Conversation
Omarchy 3.5.0
Omarchy 3.8.0
Adds a nautilus-python extension that lets users copy absolute file/folder paths to the clipboard via wl-copy. Shows 'Copy file path' for single selection and 'Copy file paths' for multi-select.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 30bb098b1f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| mkdir -p "$EXTENSIONS_DIR" | ||
| cp "$OMARCHY_PATH/default/nautilus-python/extensions/localsend.py" "$EXTENSIONS_DIR/" | ||
| cp "$OMARCHY_PATH/default/nautilus-python/extensions/transcode.py" "$EXTENSIONS_DIR/" | ||
| cp "$OMARCHY_PATH/default/nautilus-python/extensions/copy-filepath.py" "$EXTENSIONS_DIR/" |
There was a problem hiding this comment.
Add migration to deploy new Nautilus extension on updates
This commit only adds copy-filepath.py to the install-time copy script, but Omarchy updates apply user config changes through migrations (bin/omarchy-update-perform runs omarchy-migrate, and prior Nautilus extension additions were shipped via migrations such as migrations/1773017819.sh and migrations/1778099894.sh). Without a new migration sourcing install/config/nautilus-python.sh, existing installations that update will not receive the new context-menu action.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR adds a new nautilus-python extension that provides a “Copy file path(s)” context-menu action in Nautilus, copying absolute selected paths to the clipboard via wl-copy.
Changes:
- Add a new Nautilus MenuProvider extension to copy selected file/directory paths to the clipboard.
- Update the nautilus-python install/config script to install the new extension.
- Update RetroArch install/remove scripts to replace
libretro-vice-gitwith multiplelibretro-vice-*packages (note: this is currently not reflected in the PR description).
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| install/config/nautilus-python.sh | Installs the newly added Nautilus extension into the user extensions directory. |
| default/nautilus-python/extensions/copy-filepath.py | Adds the “Copy file path(s)” Nautilus context-menu action and pipes selected absolute paths into wl-copy. |
| bin/omarchy-remove-gaming-retroarch | Updates the RetroArch removal package list by expanding VICE core packages. |
| bin/omarchy-install-gaming-retroarch | Updates the RetroArch install package list by expanding VICE core packages. |
Comments suppressed due to low confidence (1)
default/nautilus-python/extensions/copy-filepath.py:54
Gio.Subprocess.new([...])can raiseGLib.Error(e.g., ifwl-copydisappears from PATH, is not executable, or fails to spawn). Since the PR claims graceful degradation, it would be safer to resolvewl_copy = shutil.which("wl-copy")once and use that full path, and wrap subprocess creation/communication intry/except GLib.Errorto avoid crashing the extension.
proc = Gio.Subprocess.new(
["wl-copy", "--type", "text/plain"],
Gio.SubprocessFlags.STDIN_PIPE
| Gio.SubprocessFlags.STDOUT_SILENCE
| Gio.SubprocessFlags.STDERR_SILENCE,
)
if proc:
proc.communicate(GLib.Bytes.new(text.encode("utf-8")), cancellable=None)
def get_file_items(self, *args):
files = args[0] if len(args) == 1 else args[1]
paths = self._selected_paths(files)
if not paths or not shutil.which("wl-copy"):
return []
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Adds a "Copy file path" / "Copy file paths" option to Nautilus' right-click context menu for files and directories.
wl-copyChanges
default/nautilus-python/extensions/copy-filepath.py— new nautilus-python extensioninstall/config/nautilus-python.sh— install script updated to copy the new extensionTesting
wl-copyis not installed