Sunday, July 7, 2019

copy magnet links to clipboard

create ~/.local/bin/toClip.sh reading

#!/bin/sh
echo -n "$@" | xclip -i
notify-send "$@ in clipboard"

create ~/.local/share/applications/toClipboard.desktop reading

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=gnome-panel-launcher
Name[en_US]=toClipboard
Exec=/home/fabio/.local/bin/toClip.sh %u
Comment[en_US]=Copies to clipboard
Name=toClipboard
Comment=Copies to clipboard
Icon=gnome-panel-launcher

xdg-mime default toClipboard.desktop x-scheme-handler/magnet

sources:

https://askubuntu.com/questions/108925/how-to-tell-chrome-what-to-do-with-a-magnet-link
https://askubuntu.com/questions/64222/how-can-i-create-launchers-on-my-desktop
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html#exec-variables

No comments:

Post a Comment