Run OMXPlayer from Raspberry Desktop Menu

Being able to double-click media files to run it somehow is so liberating.

Raspberry Pi version of Debian (Raspbian) came up with OMXPlayer as its default media player. We might as well optimise it, so we can watch video or listen to our favourite MP3s while working on it.

First, create the file:

sudo nano /usr/share/applications/omxplayer.desktop

Then add these lines:

[Desktop Entry]
 Type=Application
 Name=OMXPlayer
 Categories=AudioVideo;Player;
 Exec=lxterminal --command "omxplayer -o hdmi %f"
 Terminal=false
 Icon=/usr/share/icons/nuoveXT2/96x96/categories/applications-multimedia.png

Save and exit. If you want your audio port to play sound, instead of through HDMI, please get rid of “-o hdmi” in the Exec line above.

Now you can find the player from the menu (although it does not give you anything but a quick launch and close), and able to play media files by double-clicking them.

Have fun!

 [post_view]

(Visited 4,374 times, 1 visits today)

5 thoughts on “Run OMXPlayer from Raspberry Desktop Menu”

  1. guest says:

    hi i tired the same but it does not running the video file.mine is mp4 format video file.

  2. David says:

    If I double click I then get the option to choose the omxplayer. After that it opens without asking. There seems to be more to be said on the issue, with an option to set an opening command on the first occasion.

    I also had a problem with raspbian file manager giving a permission denied error when I try to copy and paste files. It seems this can be solved by editing files in /usr/share/applications directory
    sudo nano pcmanfm.desktop
    then change “Exec=pcmanfm %U” to “Exec=gksudo pcmanfm %U”
    control O to save, control X to exit.
    I was a bit surprised that it could be as simple as this.

    It might be worth posting this permissions problem as a separate topic, but I don’t know how at the moment, and it is sort of related to this discussion.

    I think with permissions errors in a file manager there should be an automatic option to escalate to root privileges; even the option to open the folder in a super user window seems to have been taken out of the window menu, I am using the 2015-05-05 raspbian image. Perhaps it is some security problem? Yet it is paradoxical because if this was the reason then why doesn’t the above command ask for a password?

  3. Alexandra Tilbrook says:

    Thank you! I have made two versions of the .desktop file, one for audio and another for video. The difference is the “OMXPlayer Video” has the “-b” flag.

    I was stumped on how to do it… Until I landed here.

    Thank you 1024768 times!

    1. Dipto Harendra Pratyaksa says:

      You should have visited LinuxCircle.com 4 years ago, and saved you some headache

      1. Alexandra Tilbrook says:

        Thank you, but I might just say I was pretty much a latecomer to the world of Raspberry Pi… 😉

Comments are closed.