Get default app *.desktop with snaps

Hi,

I’ve got a problem with GS extension New Mail Indicator and Thunderbird snap.

// get the default email client
    _find_default_client() {
        this.app_filename = ByteArray.toString(GLib.spawn_command_line_sync("xdg-mime query default x-scheme-handler/mailto")[1]).slice(0,-1);
        this.app = Shell.AppSystem.get_default().lookup_app(this.app_filename);
        if (this.app) {
            this.app_name = this.app.get_name();
        } else {
            Main.notify("New Mail Indicator: error, no email client found");
        }
    }

My system find this.app_filename=“thunderbird.desktop” but there’s no thunderbird.desktop file so this.app is null.
How can I get the thunderbird snap app GJS object?

this question would be better suited on https://forum.snapcraft.io

1 Like