I like to have a lot of (Python, shell) scripts without filename extension (.py, .sh), to make it easier to run them from a terminal or a run dialog, and because the extension isn't really needed, at least normally. The problem is, Thunar finds that the files are plain text documents and doesn't recognize them as scripts. As such, the default action is to open them in a text editor, and I can't change their executable permissions from within Thunar. The Python scripts has the first line as follows: #!/usr/bin/env python And the shell scripts have either: #!/bin/sh or: #!/bin/bash The PyXDG function xdg.Mime.get_type(filepath) does return the correct MIME types of the files. Reproducible: Always Steps to Reproduce: I am using Xfce and Thunar SVN.
You are using shared-mime-info <= 0.16, which doesn't include the mmap()able mime cache. Thunar includes two implementations, one for the mime cache, and one for systems with shared-mime-info <= 0.16 (which doesn't yet include support for detecting the mime type from the file content). *** This bug has been marked as a duplicate of 1106 ***
I do indeed have shared-mime-info 0.16 installed; it seems to be the latest stable version [1]. Thanks for directing me to bug 1106. [1]: http://freedesktop.org/wiki/Software_2fshared_2dmime_2dinfo (but I strongly suspect that you already know that website ;) )