Despite putting effort into getting the "Future" class (contains about 70 lines of code and uses GLib.spawn_async_with_pipes) to properly retrieve stderr I've really wanted to clean up this class.
Also, I want to avoid the double call to "updateDisplay". Every cycle of refreshing the menu requires (depending on preferences chosen) instantiating the "Future" class twice: once to get the output of the sensors command, and again for the hddtemp command. The callback in each case calling "updateDisplay".
Apart from avoiding an unnecessary menu destroy and build, maybe removing the double update will help in the long existing problem with the menu refresh triggering while an item is hovered over (but that, literally, is another issue)
with the goal of replacing the "Future" class and applying a consistent approach to sub-processes in
the extension proper where we want to use asynchronous methods for executing commands (to not block gnome-shell), and
the preferences which although running in a separate process (and therefore doesn't block gnome-shell) can still use the asynchronous methods for the extension.
taking a step towards splitting up the utilities module "dumping ground" into discrete parts
see if the async/await pattern can help in making async calls whilst maintaining the feel of synchronous methods. I might name some methods to include an "async" suffix to re-inforce this, although you might claim that calling them via "await" might make that redundant.
use the promise wrapper feature to auto-magically hook in the callback of the "finish" method to the original async GIO method
Despite putting effort into getting the "Future" class (contains about 70 lines of code and uses GLib.spawn_async_with_pipes) to properly retrieve stderr I've really wanted to clean up this class.
Also, I want to avoid the double call to "updateDisplay". Every cycle of refreshing the menu requires (depending on preferences chosen) instantiating the "Future" class twice: once to get the output of the sensors command, and again for the hddtemp command. The callback in each case calling "updateDisplay".
Apart from avoiding an unnecessary menu destroy and build, maybe removing the double update will help in the long existing problem with the menu refresh triggering while an item is hovered over (but that, literally, is another issue)
I will follow this guide:
https://gjs.guide/guides/gio/subprocesses.html
with the goal of replacing the "Future" class and applying a consistent approach to sub-processes in