libfm-qt icon indicating copy to clipboard operation
libfm-qt copied to clipboard

Add "Copy Location" context menu action

Open gfgit opened this issue 2 years ago • 5 comments

Hello, I've made a small patch which adds "Copy Location" to file context menu when only one item is selected. I find it super useful when using terminal a lot, to paste file path in the command line. Previously when copying files and pasting them inside terminal, it would paste an URI beginning with file:/// which would break command line tools expecting a normal file path and thus has to be manually removed.

If edit-copy-path icon is not present, it automatically falls back to edit-copy icon.

gfgit avatar Nov 30 '23 17:11 gfgit

I'm afraid I disagree, on account of the following reasons:

  1. We don't clutter the code of a library because of a use case related to terminals.
  2. PCManFM-Qt already has a "Copy Full Path" action in its Tools menu, and it has a shortcut.
  3. Even if PCManFM-Qt didn't have that action, the user could add a custom action, or he could simply drag and drop file(s) into the terminal…

tsujan avatar Nov 30 '23 18:11 tsujan

Ok... So I can add a custom action to the context menu?

gfgit avatar Nov 30 '23 18:11 gfgit

So I can add a custom action to the context menu?

In this case, only if you want to duplicate the functionality of "Copy Full Path".

In general, custom actions are for extending context menus in whatever way a user may like. See https://github.com/lxqt/pcmanfm-qt/wiki/custom_actions

tsujan avatar Nov 30 '23 18:11 tsujan

And I can't move this existing action to context menu right?

gfgit avatar Nov 30 '23 18:11 gfgit

And I can't move this existing action to context menu right?

In PCManFM-Qt, that action is intentionally put in the Tools menu for not cluttering the context menu. You could duplicate it or generalize it to the case of multiple files, etc.

You might hear the word "cluttering" from me a lot. It has two meanings: (1) Don't add unnecessary codes (especially codes which duplicate functionalities); and (2) Don't clutter GUIs (as they are in KDE).

tsujan avatar Nov 30 '23 19:11 tsujan