libfm-qt
libfm-qt copied to clipboard
Add "Copy Location" context menu action
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.
I'm afraid I disagree, on account of the following reasons:
- We don't clutter the code of a library because of a use case related to terminals.
- PCManFM-Qt already has a "Copy Full Path" action in its Tools menu, and it has a shortcut.
- 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…
Ok... So I can add a custom action to the context menu?
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
And I can't move this existing action to context menu right?
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).