Wayland, GNOME Shell and arbtt

Joachim Breitner mail at joachim-breitner.de
Thu Dec 21 13:53:02 CET 2017


Hi,

Am Mittwoch, den 20.12.2017, 22:28 +0100 schrieb Tomasz Miąsko:
> I am quite fond of arbtt, but have moved on to Wayland, where much stronger
> emphasis on security prevents arbtt-capture from gathering necessary window
> information. Not all is lost as GNOME Shell supports writing custom extensions
> which do have direct access to window manager. That is how an idea for
> extension was born, one that records window information in arbtt data format.
> 
> If any of you happen to use GNOME Shell (with Wayland) and would like to
> continue using arbtt, you can find the extension here:
> https://github.com/tmiasko/arbtt-capture

wow, great!

Would you like to write a section about this tool in the arbtt user
manual?
http://arbtt.nomeata.de/doc/users_guide/index.html
Source at
https://github.com/nomeata/arbtt/blob/master/doc/arbtt.xml


> Furthermore, after working with arbtt data format, I have some comments and
> suggestion, in case you were to release a new version at some point:
> 
> While working with current format, from within Haskell library environment, is
> relatively convenient, from the outside it is like reading hieroglyphs on a
> spacecraft from the outer space. Dates potentially arbitrary far in the future
> (or in the past), stored as the number of days since 1858-11-17. Time stored
> with an arbitrary precision. Instead, a single integer representing UNIX time
> would be more than welcomed (potentially 64-bit number with higher millisecond
> resolution if so desired).
> 
> Strings are serialized as 32-bit integer describing the number of Unicode code
> points (Haskell list length), followed by those code points, each encoded in
> UTF-8. Given that code point encoding in UTF-8 is variable in length, you can't
> read back the whole string at once. Writing the total number of bytes instead
> of the number of code points would be more convenient.
> 
> Instance of StringReferencingBinary for Text leaves two indexes unused,
> i.e., 254 and 255. Though, it does look quite intentional:
> 
> instance StringReferencingBinary Text where
>         ls_put strs s = case elemIndex s strs of
>                 Just i | 0 <= i && i  < 255 - 2 ->
>                         put (fromIntegral (succ i) :: Word8)
>                 _ ->    put (0 :: Word8) >> put s
> 
> ListOfStringable instance for CaptureData includes window titles and program
> names, but excludes desktop name (thus, it is not referenced back).

Phew, I have not looked at that code in a long time.

The missing reference for desktop name is definitely a bug (and an
annoying one). 

In general, I am not sure if it is a good idea to have other tools
meddle with the (ill-specified and strange) format. How about we add a
tool to the arbtt suite that takes the JSON-representation of the one
data log entry and appends it to the log. Basically the inverse of
arbtt-dump, which currently produces

$ arbtt-dump -l 1 -t JSON | json_pp
[
   {
      "date" : "2017-12-21T12:51:02.712148853Z",
      "rate" : 60000,
      "windows" : [
         {
            "active" : false,
            "program" : "arbtt – Evolution",
            "title" : "evolution"
         },
         {
            "active" : true,
            "program" : "Re: Wayland, GNOME Shell and arbtt",
            "title" : "evolution"
         },
         {
            "title" : "Navigator",
            "program" : "arbtt-capture/timeLog.js at master · tmiasko/arbtt-capture - Mozilla Firefox",
            "active" : false
         },
         {
            "title" : "gnome-terminal-server",
            "program" : "jojo at kirk:~/projekte/programming/arbtt",
            "active" : false
         }
      ],
      "inactive" : 13,
      "desktop" : "1"
   }
]


Cheers,
Joachim


-- 
Joachim Breitner
  mail at joachim-breitner.de
  http://www.joachim-breitner.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.nomeata.de/pipermail/arbtt/attachments/20171221/07b125e2/attachment.asc>


More information about the arbtt mailing list