I am trying to make some widgets using gtk layer shell and lua-lgi in hyprland. I want to have a label that listens to a terminal command and when a new line appears in the command output, the label text automatically updates. I want to do that without running a timer all time.
I tried running the command using gio.subprocess.new and it prints the output in console by using get_stdout_pipe method but I can't use the output from the method in a label.