[IDEA/My project] Global macro recorder

I’m currently working on system-wide macro recorder. It will be integrated into apps and window managers/compositors. It’s not common approach, because many macro recorder are integrated with app or with system. My macro recorder will be integrated with app to allow making it context-aware, so user select text and can select what he/she wanna trying to do (for example);

  1. Select only second line of text
  2. Select 50-70 character
  3. Select 50 character to end of line
  4. Etc.

Application (not system) will be responsible to talk with my macro recorder and tell it, which event are proceed, so application could asks user about context. Also, user may select windows to work with macro manager and it should be visible while play macro or not. Application tells macro recorder, what tags (strings) window have, identify window. When macro is recorder, apps inform my daemon, which version of application is required, so my daemon could asks application to emulate exactly version.

Application should register one’s description and description of parameters + security parameters. When user order to play macro and macro isn’t trust, macro daemon show, which application it will ran + description of each application. Macro daemon also allow user to set security parameters of each application before running macro. Start security parameter will be “Pass event after n seconds” or “Deny event after n seconds”. If macro daemon start macro in secure mode, it inform application about it, passes security parameter to it. That’s application responsibility to handle it’s own security parameter and depending on switched on security parameter, show warnings.
For example - application with button remove all under / will display warning, drawing red border around button, when macro request to click this button and asking user to process. If user select pass all events after 10 seconds, all files under / will be removed, when user don’t click application popup before that time.

I have some trouble with my daemon/client library. Especially I have trouble with X backend - i trying to set XProperty to WM area of window, but I cannot read this property in xprop, so I don’t known it’s set correctly. I must also making mutter/kwin working with my macro recording session daemon,

1 Like

My current problem is: I added X Atom to a Window (non-client area), but that atom was probably removed. I added atom after calling
gtk_widget_show_all (window)

I need a code, that obtain X window ID for client area probably. Currently I’m trying this way:
//gdkwin = gtk_widget_get_window(GTK_WIDGET(mwnd));
//gdkwin = gtk_widget_get_root_window(GTK_WIDGET(mwnd));
gdkwin = gtk_widget_get_parent_window(GTK_WIDGET(mwnd));
*wnd_id = (intptr_t) GDK_WINDOW_XID(gdkwin);

But I got:
//gdkwin = gtk_widget_get_window(GTK_WIDGET(mwnd));
//gdkwin = gtk_widget_get_root_window(GTK_WIDGET(mwnd));
gdkwin = gtk_widget_get_parent_window(GTK_WIDGET(mwnd));
*wnd_id = (intptr_t) GDK_WINDOW_XID(gdkwin);

As a side note, I don’t think this would really work under Wayland…

I know in Wayland there’s no global window id, but compositor must talk with application and probably there could exist local window id. If it’s true, compositor will send via DBus to macro recorder PID number + local window id to obtain window tags and do other tasks. If there doesn’t exist local window id, I (or somebody else) could wrote wayland protocol extension.

Augghhhh… Example I give won’t work under wayland - probably application must check it’s running under wayland or under X11. Is there way to do that? How? Or maybe Is there another way?

I think this is probably off topic for community? Although it does seem we don’t really have a place for you to talk about this, and that is unfortunate.

Yeah, there’s other categories that will open up at some point. I’ll move the topic when that happens.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.