module/foreign-toplevel: initial support

* ‘content’ is a template; the module returns a list of toplevels,
  each one instantiated using the content template.
* Each toplevel has 6 tags:
  - app-id (string)
  - title (string)
  - maximized (bool)
  - minimized (bool)
  - activated (bool)
  - fullscreen (bool)

To show the application name and title of the currently active window,
one can do:

    - foreign-toplevel:
        content:
          map:
            tag: activated
            values:
              false: {empty: {}}
              true: {string: {text: "{app-id}: {title}"}}
This commit is contained in:
Daniel Eklöf 2021-08-24 19:55:09 +02:00
parent eb94c8cceb
commit 560d7464b4
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 691 additions and 0 deletions

View file

@ -36,6 +36,7 @@ EXTERN_MODULE(alsa);
EXTERN_MODULE(backlight);
EXTERN_MODULE(battery);
EXTERN_MODULE(clock);
EXTERN_MODULE(foreign_toplevel);
EXTERN_MODULE(i3);
EXTERN_MODULE(label);
EXTERN_MODULE(mpd);
@ -111,6 +112,9 @@ init(void)
REGISTER_CORE_MODULE(backlight, backlight);
REGISTER_CORE_MODULE(battery, battery);
REGISTER_CORE_MODULE(clock, clock);
#if defined(HAVE_PLUGIN_foreign_toplevel)
REGISTER_CORE_MODULE(foreign-toplevel, foreign_toplevel);
#endif
REGISTER_CORE_MODULE(i3, i3);
REGISTER_CORE_MODULE(label, label);
REGISTER_CORE_MODULE(mpd, mpd);