Copy from browser address bar
Created: 2025-08-25 Copyright: CC-BY-SA 4.0 Language: en
I work with php project and I have super symfony toolbar with a lot of useful information. Some part can interact with editor if this editor is big as your operating system...
This symfony toolbar on error trace or other things what gives file url can be configured to open such file. So, I don't want to use phpstorm as ide what could open file by:
phpstorm://copy?file=%%f&line=%%l
but I use vim (neovim) and I wanted at least copy url to clipboard.
After some research I solved this by creating desktop file in ~/.local/share/applications/xclip-url.desktop:
[Desktop Entry] Type=Application Name=Copy from addressbar Exec=xcopy.sh %u StartupNotify=false MimeType=x-scheme-handler/xcopy;
registering mime type by command:
xdg-mime default xcopy-url.desktop x-scheme-handler/xcopy
and creating script:
#!/usr/bin/env bash echo "$@" | sed 's/^xcopy:\/\///' | xclip -selection clipboard
Page counter: 25