Skip to content

Add Copy Path context menu action to Nautilus#4929

Open
nt1998 wants to merge 4 commits intobasecamp:devfrom
nt1998:add-nautilus-copy-path
Open

Add Copy Path context menu action to Nautilus#4929
nt1998 wants to merge 4 commits intobasecamp:devfrom
nt1998:add-nautilus-copy-path

Conversation

@nt1998
Copy link
Copy Markdown

@nt1998 nt1998 commented Mar 8, 2026

Summary

  • Adds a nautilus-python extension that provides a Copy Path right-click menu item in Nautilus
  • Copies the full path of selected file(s) to clipboard via wl-copy
  • No new package dependencies — nautilus-python and wl-clipboard are already in omarchy-base.packages

Changes

  • config/nautilus/copy-path.py — the nautilus-python MenuProvider extension
  • install/config/nautilus-copy-path.sh — installs the extension to ~/.local/share/nautilus-python/extensions/
  • install/config/all.sh — registers the install script

Adds a nautilus-python extension that provides a "Copy Path" right-click
menu item in Nautilus, copying the full file path(s) to clipboard via
wl-copy. Both nautilus-python and wl-clipboard are already in base packages.
Copilot AI review requested due to automatic review settings March 8, 2026 10:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a "Copy Path" right-click context menu action to the Nautilus file manager. It introduces a nautilus-python extension that copies the full path(s) of selected files to the Wayland clipboard via wl-copy, and registers its installation into the existing config setup flow.

Changes:

  • config/nautilus/copy-path.py — New nautilus-python MenuProvider extension implementing the Copy Path menu item
  • install/config/nautilus-copy-path.sh — New install script that deploys the extension to the appropriate directory
  • install/config/all.sh — Registers the new install script in the config installation sequence

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
config/nautilus/copy-path.py Core extension: registers the menu item and invokes wl-copy with the selected file path(s)
install/config/nautilus-copy-path.sh Creates the extensions directory and copies the Python file into it
install/config/all.sh Adds a run_logged call to execute the new install script during setup

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread config/nautilus/copy-path.py Outdated
Comment thread config/nautilus/copy-path.py Outdated
get_path() returns None for files that do not have a local filesystem path (e.g., files in the Trash, on remote shares, or accessed via virtual URIs). Calling "\n".join(...) on a generator that yields None will produce the literal string "None" in the clipboard, or could cause a TypeError depending on the Python version. You should filter out or handle None values before joining, e.g. by skipping files where get_path() returns None, or by using get_uri() as a fallback.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 8, 2026 10:21
Using subprocess.Popen spawns the process without waiting for it to finish or checking its exit code. While wl-copy typically exits quickly, using subprocess.run instead is more appropriate here: it blocks until the command completes and raises an exception on failure, allowing errors (e.g., wl-copy not found or failing) to surface rather than being silently swallowed. With Popen, there is also a potential for a zombie process since the return code is never collected.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install/config/all.sh
Comment thread config/nautilus/copy-path.py
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