Get Running App From GJS Script

The following code works:


const res =

// load library of Mutter project

// load library of gnome-shell project

const Shell =;
const appSys = Shell.AppSystem.get_default();
print(appSys.get_installed().map(x => x.get_name()).join('\n'));

However, if I replace get_installed with get_running, then there are no output. Why?

It’s not working because you are trying to use the internal libraries of GNOME Shell in a stand-alone context.

Libraries like Shell are intended to be used inside the gnome-shell process (e.g. by extensions), and will rarely be any use in other projects.

1 Like

Thank you very much.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.