You are not logged in.
I have got a lot of bash scripts without an extension but with magic word:
#!/bin/bash.
Mousepad can not detect their filetype as Script - sh unless I add extension sh and I have to change filetype manually.
But mime-type is correctly detected
$ file --mime-type some_script_name
some_script_name: text/x-shellscript
I found file /usr/share/gtksourceview-3.0/language-specs/sh.lang and there are interesting lines:
<property name="mimetypes">text/x-shellscript;application/x-shellscript;text/x-sh</property>
<property name="globs">*.sh;*bashrc;.profile;.bash_profile</property>
- so mime-types look OK.
I added *; to the beginning of the line with globs:
<property name="mimetypes">text/x-shellscript;application/x-shellscript;text/x-sh</property>
<property name="globs">*;*.sh;*bashrc;.profile;.bash_profile</property>
but now Mousepad opens even regular files with mime-type text/plain as scripts.
Removing the globs line did not help - after that scripts are not detected at all.
So it seems that Mousepad ignores mime-types and uses globs only.
Is there any way how to force Mousepad to open scripts according to mime-type of files?
Or it is a GTK source view bug?
(BTW: I would not mind if Mousepad ignored globs completely and used mime-type only.)
Offline
This is fixed since Mousepad 0.5.0, current version is 0.5.7.
If your distribution does not offer a way to update Mousepad to a 0.5.x version, you can install it via Flatpak: https://flathub.org/apps/details/org.xfce.mousepad
Offline
OK, thank you very much for info and help.
I downloaded this version (for Ubuntu Hirsute 21.04)
https://launchpad.net/ubuntu/impish/amd … 3-0ubuntu1
and it works on Xubuntu Focal 20.04 too.
The only disadvantage is its new icon, but I can downgrade it...
Last edited by Signy (2021-10-10 14:33:08)
Offline
[ Generated in 0.007 seconds, 7 queries executed - Memory usage: 548.79 KiB (Peak: 597.4 KiB) ]