When I'm using PCManFM, I sometimes do the following. I right-click in an empty place in ~/, and choose Make new... --> Empty File. I type some text in it, like 'blabalballabl', and then I save it, e.g., as test.

Now, I double-click this file. Leafpad won't open the file, but instead PCManFM will say that the file is executable. It then asks if I want to execute the file or not. I don't want this to happen, I just want Leafpad to open the file. Right-clicking the file, then changing the default application to open this type of files doesn't help.

Is there any way to force PCManFM to open files like these with Leafpad by default?

I'm using Lubuntu 11.10 32 bit.

PCManFM asks to execute the file

PCManFM asks to execute the file

Changing the default program to open the file doesn't help.

Changing the default program to open the file doesn't help.

The Leafpad file associations look OK.

mimeapps.list looks OK; text/plain should be opened by Leafpad.

3 Answers 3


Its perhaps worth checking that if you have a mimetype list that its defined correctly:

enter image description here

In the same folder - try removing/renaming any custom leafpad.desktop file just in-case it is due to an error in that definition.

Logout and login for changes to take effect.

  • This didn't help. The only file left in ~/.local/share/applications is mimeapps.list. I removed the mimecache in /usr/share/applications, and I moved the defaults.list in there to another location to be sure, but this didn't help me. ~/.local/share/applications/mimeapps.list contains the right associations, as seen in the screenshot I've added. Thanks for your help. Jan 2, 2012 at 13:01
  • can you pastebin your mimeapps.list - I want to see if I can reproduce it. Did you check if there is a leafpad.desktop file in the same folder?
    – fossfreedom
    Jan 2, 2012 at 13:44
  • There wasn't a leafpad.desktop file in ~/.local/share/applications. I've copied it from /usr/share/applications to ~/.local/share/applications, and now it seems to work. Thanks! Jan 2, 2012 at 16:31
  • Remember to also look at ~/.confg/mimeapps.list, as suggested by askubuntu.com/a/572213 Feb 21, 2016 at 1:41

This is a common problem when the file is executable. As far as I know, there is no fix other than removing its executable flag:

  1. chmod -x [yourfile], or
  2. Right-click > Properties > Permissions > Uncheck "Make the file executable".

However, this fix will probably not work if the file is on a filesystem that does not support POSIX-like file permissions (e.g. NTFS, vfat, network shares, etc...).


I have the solution!: Just add


to the options of the ntfs line of /etc/fstab

  • Right, but doesn't this prevent other executable files from opening? May 28, 2013 at 12:09

Your Answer

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

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