-selected-row causing hangs in ruby script #1692
-
I was trying to replicate the way my python script loaded the -dmenu entries instantly In python I would just do In rofi the full thing looks like: require "open3"
lines = "aaa\nbbb\nccc"
cmd = "rofi -dmenu -selected-row 0"
stdin, stdout, stderr, wait_thr = Open3.popen3(cmd)
stdin.puts(lines)
puts stdout.read
puts wait_thr.value.exitstatus Notice how it has -selected-row 0, I added that after trial-error finding that it was the option that caused instant loads, else it would load the items after around 200ms or so after opening rofi, which is normal behavior I guess. The thing is, if I run that code, rofi hangs my computer, I have to change TTY and kill it. If I remove "-selected-row 0" it might have the 200ms delay, but it works and exits normally. I'm not sure what is happening here.
These are the lines that cause the hang it seems. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
To be able to specify a row you want selected at startup rofi needs to read the input first (otherwise the selected row does not exists). For the '200ms' delay, see issue tracker and update your rofi. |
Beta Was this translation helpful? Give feedback.
To be able to specify a row you want selected at startup rofi needs to read the input first (otherwise the selected row does not exists).
E.g. it goes into
sync
mode. Sync mode blocks until your script closes the input, because it needs to know when you are done sending input. Fix your script to close its output once it is done sending.For the '200ms' delay, see issue tracker and update your rofi.