Lock-Screen and machine off / standby

Create issue
Issue #29 resolved
amenthes created an issue

I would love to detect the debian lock-screen somehow. The problem is, i can't find it in the arbtt-dump. Inactivity nice, but i like the expliciitness and immediacy of "i have locked my screen".

Also, it would be amazing if "no data" or "the machine is turned off" could be exported somehow.

Comments (20)

  1. nomeata repo owner

    Nice idea. I wonder why the lock screen does not appear in the dump – probably because it is more like a dialogue and less like a proper window that appears in the window list (which is what arbtt uses). I don’t immediately see a solution here.

    Also, “no data” should be distinguishable from “arbtt-capture was not running (most likely because the machine was off)”: In the former case, there should be a sample with no running programs.

  2. amenthes reporter

    Ok, then lets not worry about the lock screen for now.

    I think I see what you mean regarding no samples / empty samples. The "Activity" timeline in the following screenshot is based on this rule:

    -- System Activity
    $idle > 300 ==> tag Activity:inactive,
    tag Activity:active,

    I see the Activity:active times (dark blue), Activity:inactive times (light blue) and the gray background is probably when my machine was turned off.

    Bildschirmfoto von 2015-09-20 12-26-08_crop.png

    I think I was a little confused earlier, because I usually don't turn off my computer, but put it in standby. I often have entries in the --intervals list that span many hours, when my machine was actually on standby.

  3. amenthes reporter

    That last thing is even visible in the "activity" screenshot. The last active segment goes past 23:30 and into the next day, it's 12h33m long.

      active | 09/19/15 18:07:17 | 09/20/15 06:40:19 |    12h33m13s
  4. nomeata repo owner

    Ah, I think the problem is not so much data capture, but rather a limitation in the implementation of the intervals report then! It should be smart about when there are samples missing (e.g. if in between two samples, more time than twice the sample rate has passed). Is that it?

  5. amenthes reporter

    I'd go as far as 10 times the sample rate or a configuration to be safe. But in general, i think it might help.

    maybe a handling similar to "inactive" would be good:

    $idle > 300 ==> tag inactive,
    $nosample > 600 ==> tag off,

    I can also report that i'm able to compile arbtt, now (on linux, that is). But it seems i underestimated the conceptual uniqueness of haskell. But with a pointer where to start, i'd even take a stab at it myself!

  6. nomeata repo owner

    maybe a handling similar to "inactive" would be good:

    I don’t think this would work well; the concept that tags are assigned to existing samples (and not the time in between samples) is quite baked in.

    But it should be sufficient to make sure that the interval report simply reports intervals when there are actually samples, and not in the wholes in between.

    But with a pointer where to start, i'd even take a stab at it myself!

    Unfortunately, I don’t think this part of the code is particularly beginner-friendly, with this strange LeftFold processing etc. The relevant bit is https://bitbucket.org/nomeata/arbtt/src/7c710d22c967963b3052c96e972ca753bf72a8fd/src/Stats.hs?at=master&fileviewer=file-view-default#Stats.hs-326 together with the functions being called (runOnIntervals and runOnGroups).

    But if you feel like contributing: Maybe you can provide a small self-contained test case that shows this problem, add it to the testsuite tests/test.hs, so that I can try to implement this feature and easily see if I nailed it or not.

  7. amenthes reporter

    Is there a trick to running the tests? I tried

    runhaskell tests/test.hs 
        Could not find module ‘System.Process.ByteString.Lazy’
        Use -v to see a list of the files searched for.
        Could not find module ‘Categorize’
        Use -v to see a list of the files searched for.
        Could not find module ‘TimeLog’
        Use -v to see a list of the files searched for.
        Could not find module ‘Data’
        Use -v to see a list of the files searched for.

    And i managed to get it down to these four dependencies by randomly installing debian's libghc- packages, but i can't seem to locate these four.

  8. amenthes reporter
    cabal update
    cabal install process-extras
    cabal install tasty
    cabal install tasty-golden
    cabal install tasty-hunit

    did the trick. Test suite is running and the new test is failing as expected!

  9. nomeata repo owner

    Thanks a lot for the test case; it is much more pleasurable programming against such a clear spec!

  10. nomeata repo owner

    Oh, the code is already there. I chose the cut-off limit at twice the sample rate, so allowing for some skew, but still putting in gaps when it is likely that data is missing for some reason.

    I don’t feel strong about this limit; if you have any reason to prefer another factor, tell me about it. (But do not tell me to make it configurable, I’m a fan of avoiding options where there are sane choices that the program can make for you :-))

  11. amenthes reporter

    The new changes look amazing. Here's a comparison before/after. Sadly, the colors are assigned somewhat randomly right now, but you can clearly see the tiny gray gaps between every interval. Also, the dark blue "active" bar went all the way through to the right, when there was clearly no data anymore.

    The lower graphic shows the news interval export. Less gaps, actually tiny slices started appearing. (The tiny blue sliver in the huge orange block at the end of the data was not there before!)

    Bildschirmfoto von »2015-09-22 13-49-48_comparison.png

  12. amenthes reporter

    It appears, bitbucket has no facility to view an image at full size. But you can save it to disk to view the tiny details i'm talking about.

  13. amenthes reporter

    Please, take whatever you need! If you're looking for something different (more detail, larger timeframe etc...) let me know!

    Currently i'm quite swamped, but i'm hoping to release my project by the end of the year.

  14. Log in to comment