Answer the question
In order to leave comments, you need to log in
Application for keeping track of active windows. How to write?
There was an idea to make for myself a small analogue of https://desktime.com/
I am only familiar with the web, what to watch, read, in order to write a daemon that will monitor active windows / processes?
Interested only under Ubuntu.
Answer the question
In order to leave comments, you need to log in
A list of all windows can be obtained using the xwininfo utility (xwininfo -tree -root), the current active - first, the identifier through
the Window Number will be in the very first line of this form:
_NET_ACTIVE_WINDOW (WINDOW): window id # 0x240000
Then get data about the window itself:
Name applications: _OB_APP_TITLE(UTF8_STRING)
Window title: _NET_WM_VISIBLE_NAME(UTF8_STRING) = "[email protected]: ~"
Accordingly, all that remains is to write a Perl script (or you can try Bash) that parses the output and saves the necessary data to the log or base.
If you really want to write not scripts, but a full-fledged C-application, then I advise you to study this code first .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question