I'm trying to make a submenu entry on a .desktop application file that launches a youtube address with mpv. The youtube url is copied from the clipboard. Inside gnome-terminal this works fine:
xclip -o | xargs mpv
But if I make a .desktop action like this:
[Desktop Action mpv]
Name=mpv clipboard
Comment=Play the url on the clipboard with mpv
Exec=xclip -o | xargs mpv
It doesn't work. I have tried putting gnome-terminal -x before it, but it still doesn't work. How can it be done?
A pipeline is a shell feature, and .desktop launching does not involve a shell. You can use something like:
Or (depending on what's in the clipboard):
Or put the command in an executable script file somewhere and use
Exec=/path/to/script
.