[Gambas-user] Get the default file manager

Gianluigi gradobag at gradobag.it
Sat Feb 17 14:40:58 CET 2024


Il 17/02/24 12:12, Gianluigi ha scritto:
> I forgot,
>
> after the last fix you can also do something like this:
>
> Public Sub Main()
>
>   Dim sApp, s As String
>
>   Shell "xdg-mime query default inode/directory" To sApp  ' Get
> .desktop file name of filemanager launcher.
>   s = Scan(sApp, "*[.- ]*")[0]
>   Print s
>
> End
>
> Regards
> Gianluigi

Hi Martin,
I apologize in the suggestion there is an error, the space after the hyphen.
For multiple strings you need curly brackets:

Public Sub Main()

   Dim sApp, s As String

   Shell "xdg-mime query default inode/directory" To sApp  ' Get
.desktop file name of filemanager launcher.
   s = Scan(sApp, "*{.,-, }*")[0]
   Print s

End

Regards
Gianluigi



More information about the User mailing list