Running function asynchronously in gjs



I am currently spawning a shell command from my Gnome extension synchronously with Util.spawn(). The command updates icon emblems, and may run hundreds of times consecutively inside a for() loop. The command is:

Util.spawn_async(['gvfs-set-attribute', MYPATH, '-t', 'stringv', 'metadata::emblems', EMBLEM]);

The repeating spawning, perhaps unsurprisingly, locks up the entire Gnome desktop.

Is there a way I can run a command asynchronously in Gnome _javascript_?

 - Per



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]