[Gambas-user] Get the default file manager

Bruce Steers bsteers4 at gmail.com
Fri Feb 16 12:45:36 CET 2024


you could use DesktopMime to get the first listed application

Print DesktopMime["text/plain"].GetApplications()[0].Exec

or..
For Each df As DesktopFile In DesktopMime["text/plain"].GetApplications()
  Print df.Name, df.Exec
Next

Prints......

Pluma   pluma %U
Emacs (GUI)     /usr/bin/emacs %F
FeatherPad      featherpad %U
jEdit   jedit %U
LibreOffice Writer      libreoffice --writer %U
Okular  okular %U
Text Editor     gedit %U
Kate    kate -b %U
KWrite  kwrite %U
Mousepad        mousepad %U

Respects
BruceS



On Fri, 16 Feb 2024 at 11:39, System64 Development <64xcode at gmail.com>
wrote:

> Hi,
>
> I was using Desktop.Open(Path) to open the directory of the shrimp
> projects but now this statement opens the ide, I guess because at some
> point I opened a shrimp project from the file manager and the system
> "memorized" this action.
>
> Anyway, how can I get the name of the default application that manages
> the files? in my case it is Thunar because I use XFCE but what is the
> general way?
>
> Best regards.
>
> Martin.
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240216/842081d5/attachment.htm>


More information about the User mailing list