This would also ensure that the GTK UI and all code related to GTK is run as a regular user, and only the code that requires root will run as root.
How
The same method used by Popsicle to gain Wayland support could be used here. However, Vala does not support algebraic data types; multi-producer, single-consumers; or lock-free queues, so we may need to either A) expose some kind of API distinst for interacting with it via events on channels, B) recreate similar functionality in Vala with Atomics & Mutexes. I would likely lean more towards A.
Why
How
The same method used by Popsicle to gain Wayland support could be used here. However, Vala does not support algebraic data types; multi-producer, single-consumers; or lock-free queues, so we may need to either A) expose some kind of API distinst for interacting with it via events on channels, B) recreate similar functionality in Vala with Atomics & Mutexes. I would likely lean more towards A.