Last active
June 10, 2024 08:43
Revisions
-
webghostx revised this gist
Jun 10, 2024 . 1 changed file with 2 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ In this example, a function will be added to the context menu that allows copyin 1. **Create a `.desktop` file:** Create the directory `$HOME/.local/share/file-manager/actions/` if it doesn't already exist. This name is expected by LXQt and pcmanfm-qt. Create a file named like `copy-path.desktop` within that directory with the following content: ``` [Desktop Entry] @@ -23,13 +23,7 @@ In this example, a function will be added to the context menu that allows copyin Exec=sh -c 'echo -n %f | xclip -selection clipboard' ``` 2. **Install `xclip`:** Install `xclip` if it is not already installed: ``` sudo apt install xclip @@ -38,7 +32,6 @@ In this example, a function will be added to the context menu that allows copyin ### Notes - **Directory structure:** The file must be located in the directory `$HOME/.local/share/file-manager/actions/`. - **Dependencies:** `xclip` or an alternative must be installed (`sudo apt install xclip`). ### References -
webghostx revised this gist
Jun 9, 2024 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -45,3 +45,4 @@ In this example, a function will be added to the context menu that allows copyin - [lxqt/pcmanfm-qt custom Actions](https://github.com/lxqt/pcmanfm-qt/wiki/custom_actions) - [xclip](https://manpages.ubuntu.com/manpages/xenial/man1/xclip.1.html) - [Manjaro Wiki](https://wiki.manjaro.org/index.php/PCmanFM-Qt) -
webghostx created this gist
Jun 9, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ ## Copy File Path from Context Menu in LXQt/pcmanfm-qt In this example, a function will be added to the context menu that allows copying the absolute file path or the path of a directory to the clipboard. The `xclip` package is used for this purpose. Alternatively, the `xsel` package can be used. ### Instructions 1. **Create a `.desktop` file:** Create the directory `$HOME/.local/share/file-manager/actions/` if it doesn't already exist. This name is expected by LXQt and pcmanfm-qt. Create a file named `copy-path.desktop` within that directory with the following content: ``` [Desktop Entry] Type=Action Profiles=profile1 Name=Copy path Name[de]=Pfad kopieren Icon=edit-copy [X-Action-Profile profile1] MimeTypes=all/allfiles;inode/directory; Exec=sh -c 'echo -n %f | xclip -selection clipboard' ``` 2. **Ensure the file is executable:** Run the following command in the terminal to make the file executable: ``` chmod +x $HOME/.local/share/file-manager/actions/copy-path.desktop ``` 3. **Install `xclip`:** Install `xclip` if it is not already installed: ``` sudo apt install xclip ``` ### Notes - **Directory structure:** The file must be located in the directory `$HOME/.local/share/file-manager/actions/`. - **Permissions:** Ensure the file is executable (`chmod +x`). - **Dependencies:** `xclip` or an alternative must be installed (`sudo apt install xclip`). ### References - [lxqt/pcmanfm-qt custom Actions](https://github.com/lxqt/pcmanfm-qt/wiki/custom_actions) - [xclip](https://manpages.ubuntu.com/manpages/xenial/man1/xclip.1.html)