Open csmarosi opened 8 years ago
Looks good! Related to #34.
Hi i want to merge this but I'm worried about the sleep times:
sleep $windowLength
sleep .5 #make sure that all `xinput test` finished
since $windowLength
is 9, wouldn't this make the total sleep time ~9.5 seconds and offset all the measurements?
@karpathy I guess you are right. I think it would be safe to drop the sleep .5
.
It's not clear to me what two sleeps in a row accomplish. Alternatively the first one could be set to 8.5? I don't think I fully understand the intent here.
I did not actually test whether I need the two sleep, but the reasoning:
timeout $windowLength xinput test $id > $fileName &
timeout
There could be some race condition, so I sleep a little bit more (.5s) to wait for the files. I just wanted to make this explicit with the 2 consecutive sleeps. I have little experience, how bash works/handles these. In PR #36 there is the jobs shell built-in, which seems like the tool I should have been used.
BTW, yes with this 1/17th of the keystrokes are lost :) Feel free to steal/merge it with #36 if I don't have the time for that.
Updated (learned some bash). My original intention was this, but did not know about wait
timeout
in combination with wait
seems like the best fit when potentially reading from multiple input devices. Do you want to combine our to PR into one?
Your PR has additional features (and I'm lazy to check/test them), so would leave the credit :). You can take these ideas (or fork my branch), if you would like. Also note that this PR changes how the window title is determined, which should be tested under other WMs.
First, thanks for the great project!
To use it with my window manager (xmonad) and under Docker (so I can remove the network access, check also (In)Security) I needed some changes (in sort: using only X11-tools).
I have some strong feelings against this pull request, as I wanted something more elegant. It comes with the 'works for me (TM)' warranty; in particular I don't have any lock screen/screensaver.
Whether you merge it or no, I hope someone can profit form this PR.