I have a .desktop file to start Youtube-Viewer which is an application that runs in terminal.

The command to use is something like youtube-viewer --video-player=mplayer.

It works when I fire that in a terminal, but I want to add it in a .desktop file (and put that in usr/share/applications or ~/.share/applications). In Linux Mint, which I use in parallel, a such desktop file works:

[Desktop Entry]
Exec=bash -c 'youtube-viewer --video-player=mplayer'

But that does not work as it should in elementary OS, it just does nothing.

What am I missing here?


I don't know why the line Exec=bash -c 'youtube-viewer --video-player=mplayer' isn't working, but what works is Exec=pantheon-terminal -e 'youtube-viewer --video-player=mplayer'.


A script like


bash -c 'youtube-viewer --video-player=mplayer'

doesn't work.

But this works:


pantheon-terminal -e 'youtube-viewer --video-player=mplayer'
  • please comment your (down)vote – user170 Mar 29 '16 at 19:18

Both options work for me.

Have you checked whether you can run the first option bash -c 'youtube-viewer --video-player=mplayer' on a Terminal?

| improve this answer | |
  • that command works in terminal. But bash -c is not needed there, as the idea is just to run youtube-viewer --video-player=mplayer in terminal. I just checked again tough and that desktop file doesn't work, until I replace bash -c with pantheon-terminal -e – user170 Mar 25 '16 at 15:08
  • 1
    My idea was that something might be wrong with bash, that's why I asked if you can run the bash command. – coderMess Mar 25 '16 at 15:09
  • see UPDATE2 please – user170 Mar 25 '16 at 15:14
  • Both options work for me. Have you tried removing that part altogether and write Exec=youtube-viewer --video-player=mplayer? – coderMess Mar 25 '16 at 15:17
  • yes, but that couldn't work, because that application has no window and needs the terminal window to run. What works is Exec=path/to/script-working-in-UPDATE2 but that is the same as Exec=pantheon-terminal -e 'youtube-viewer --video-player=mplayer' – user170 Mar 25 '16 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy