Ingo Bürk
2016-06-12 10:53:54 UTC
Hi,
I am using i3blocks and want to write a blocklet for output management.
In order to have the block be responsive, I use signals; and in order to
send those signals, I need to start a background process:
xrandr-notify | while read x; do pkill -RTMIN+4 i3blocks; done
I would like to start this process from the also periodically executed
block script itself (rather than, e.g., my i3 config), but of course it
needs to be in the background. This is where I keep running into a wall:
nothing seems to work. I've tried a variety of "… &", "nohup … &", "( …
) &", "{ … } &", "disown", … in all imaginable combinations.
The problem is that when the script does background, the statusline in
i3bar just freezes up. It has to be an i3bar problem because manually
running i3blocks from the terminal still updates the output correctly.
I'm hoping that maybe someone has a good idea of what's causing i3bar to
freeze up when the executed statusline program spawns another child
process and how I can fix it. Or perhaps it is an i3blocks issue
afterall (though I don't expect it to be for the above reasons)?
For reference, the blocklet script is structured something like this:
if ! pgrep xrandr-notify; then
xrandr-notify | while read x; do pkill -RTMIN+4 i3blocks; done &
fi
echo "lots of logic here"
Any input is welcome. Thanks!
Ingo
I am using i3blocks and want to write a blocklet for output management.
In order to have the block be responsive, I use signals; and in order to
send those signals, I need to start a background process:
xrandr-notify | while read x; do pkill -RTMIN+4 i3blocks; done
I would like to start this process from the also periodically executed
block script itself (rather than, e.g., my i3 config), but of course it
needs to be in the background. This is where I keep running into a wall:
nothing seems to work. I've tried a variety of "… &", "nohup … &", "( …
) &", "{ … } &", "disown", … in all imaginable combinations.
The problem is that when the script does background, the statusline in
i3bar just freezes up. It has to be an i3bar problem because manually
running i3blocks from the terminal still updates the output correctly.
I'm hoping that maybe someone has a good idea of what's causing i3bar to
freeze up when the executed statusline program spawns another child
process and how I can fix it. Or perhaps it is an i3blocks issue
afterall (though I don't expect it to be for the above reasons)?
For reference, the blocklet script is structured something like this:
if ! pgrep xrandr-notify; then
xrandr-notify | while read x; do pkill -RTMIN+4 i3blocks; done &
fi
echo "lots of logic here"
Any input is welcome. Thanks!
Ingo