ulogme icon indicating copy to clipboard operation
ulogme copied to clipboard

Make it work under xmonad and Docker

Open csmarosi opened this issue 9 years ago • 8 comments

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.

csmarosi avatar Jan 03 '16 09:01 csmarosi

Looks good! Related to #34.

ypid avatar May 07 '16 22:05 ypid

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 avatar May 08 '16 20:05 karpathy

@karpathy I guess you are right. I think it would be safe to drop the sleep .5.

ypid avatar May 08 '16 21:05 ypid

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.

karpathy avatar May 08 '16 21:05 karpathy

I did not actually test whether I need the two sleep, but the reasoning:

  • I spawn many background tasks with timeout $windowLength xinput test $id > $fileName &
  • these tasks terminated by the 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.

csmarosi avatar May 09 '16 17:05 csmarosi

Updated (learned some bash). My original intention was this, but did not know about wait

csmarosi avatar May 09 '16 19:05 csmarosi

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?

ypid avatar May 09 '16 21:05 ypid

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.

csmarosi avatar May 11 '16 19:05 csmarosi