This small add on adds a context menu entry in KDE Dolphin that lets you copy the content of any file directly into the clipboard. Right click a file and choose "Copy file content to clipboard". The content will be placed in the clipboard as bytes or text.
The project contains:
copy-file-content.desktopinstall.sh
Both files are placed in this repository.
You need one of the following tools:
wl-clipboard(Wayland)xclip(X11)
The install script checks for these tools and stops if none are available.
Run the install script:
./install.shWhat the script does:
- Checks for
wl-copyorxclip - Creates the directory
~/.local/share/kio/servicemenusif needed - Copies the desktop file into that directory
- Makes the desktop file executable
After installation, restart all Dolphin windows.
- Open Dolphin
- Right click any file
- Choose "Copy file content to clipboard"
The content of the file is now in your clipboard.
Remove the installed service menu file:
rm ~/.local/share/kio/servicemenus/copy-file-content.desktopRestart Dolphin afterward.
- The entry appears for all file types
- The script uses a simple shell command that pipes file content into either
wl-copyorxclip
If you want improvements or more features, feel free to open an issue or send a pull request.