I was not able to change the default app in raspbian (lxde and pcmanfm) when right clicking and using the corresponding menu entries and the checkbox.

The lists that contain the default associations as described here: https://lkubaski.wordpress.com/2012/10/29/understanding-file-associations-in-lxde-and-pcmanfm/ were missing in my raspbian installation.

I want omxplayer to open inside a terminal upon opening a video file

1 Answer 1


You can find the config in ~/.config/mimeapps.list

This how it looks for me after editing it:

[Default Applications]

[Added Associations]

The .desktop file has to be in ~/.local/share/applications/userapp-omxplayer.desktop:

[Desktop Entry]
Exec=lxterminal -e omxplayer -b %f

It is important that the terminal is open, because once you start omxplayer without a terminal you won't be able to close it easily.

For me, using Terminal=false caused the terminal not to be focused, so I needed to switch to it first (alt + tab) to use keyboard shortcuts. That's why I'm using lxterminal -e. Make sure to use a terminal emulator that is installed on your system, it should also work with any other one that can accept commands as argument.

You can now double-click .mp4 video files and a terminal will open up that will spawn omxplayer.

The %f term is the placeholder for the filename.

-b will cause the screen around the video to go black.

  • 1
    "once you start omxplayer without a terminal you won't be able to close it" That's a bit of jumping to conclusions right there, don't you think? There's plenty of methods to kill it, just not as easily as when the terminal is enabled.
    – Mast
    Dec 9, 2017 at 14:19
  • I have just corrected that
    – sezanzeb
    Dec 24, 2017 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.