/* The first column always contains the window identity as a hexadecimal integer. The second column always contains the desktop number (a -1 is used to identify a sticky window). If the -p option is specified the next column will contain the PID for the window as a decimal integer. If the -G option is specified then four integer columns will follow: x-offset, y-offset, width and height. The next column always contains the client machine name. The remainder of the line contains the window title (possibly with multiple spaces in the title). */ static L linux_parse_wmctrl_lpG_output(S output) { try { ret map_pcall(tlft(output), func(S s) -> wmctrl_Entry { L streaks = takeFirst(8, nonStreaks(f isSpace, characters(s))); LS l = intRangeSubstrings(s, streaks); ret nu(wmctrl_Entry, windowTitle := trimSubstring(s, last(streaks).end), windowIdentity := l.get(0), desktopNumber := parseInt(l.get(1)), pid := parseInt(l.get(2)), bounds := rect(parseInt(l.get(3)), parseInt(l.get(4)), parseInt(l.get(5)), parseInt(l.get(6))), machineName := l.get(7)); }); } on fail { printIndent("wmctrl> " , output); } }