You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using it in my waybar, but I am having a problem. I would like to be able to kill waybar and still have uair running in the background, and when I start waybar, I would like to be able to connect to the running uair.
In waybar, if I use the following exec line: exec = "uair";
then when I kill waybar, uair also is killed. Makes sense.
However, I tried this: exec = "pgrep -x uair > /dev/null && uairctl listen || nohup uair &";
which I thought would do it, but not quite. When I kill waybar, uair is still running. That's great. I can see output from the terminal using uairctl listen. However, when I restart waybar, I see the output from uairctl listen for about a second, then it disappears from waybar.
The text was updated successfully, but these errors were encountered:
I would suggest you to use the line exec = "uairctl listen"; in your polybar config and then create a user service for the 'main' uair instance using your init system. If you're using systemd you may use this service file.
Alternatively, you can start the main instance when your window manager starts, but then the process is unsupervised and you can't start or stop it using your init system.
The real reason why this happens is because uairctl listen prepends null terminators to every string except the first one. This can be observed by piping it into a file. uair does not do this, which is why your script works for the first time when starting waybar.
Here is the output of uairctl listen:
And here the output of just uair:
(The unicode characters at the end are because of my uair config.)
Waybar is written in C++ and so it thinks all those strings are empty, except for the first one, and it prints nothing.
The real reason why this happens is because uairctl listen prepends null terminators to every string except the first one. This can be observed by piping it into a file. uair does not do this, which is why your script works for the first time when starting waybar.
Good catch! Will release a fix.
metent
changed the title
problems making uair persistent when killing/starting waybar
uairctl listen prepends null terminators to every string except the first one
Nov 11, 2024
This is a great tool!
I am using it in my waybar, but I am having a problem. I would like to be able to kill waybar and still have uair running in the background, and when I start waybar, I would like to be able to connect to the running uair.
In waybar, if I use the following
exec
line:exec = "uair";
then when I kill waybar, uair also is killed. Makes sense.
However, I tried this:
exec = "pgrep -x uair > /dev/null && uairctl listen || nohup uair &";
which I thought would do it, but not quite. When I kill waybar, uair is still running. That's great. I can see output from the terminal using
uairctl listen
. However, when I restart waybar, I see the output fromuairctl listen
for about a second, then it disappears from waybar.The text was updated successfully, but these errors were encountered: