Go to file
2020-11-05 15:38:50 +01:00
examples Rework examples with a class that encapsulate all generic monitor stuff 2020-05-07 08:42:34 +02:00
COPYING Update Licence from GPL v2 to GPL v3. Remove unused stylesheet 2020-05-07 08:50:42 +02:00
dbus.xml Add onActivate and onDeactivate signals 2020-05-07 08:42:34 +02:00
extension.js Remove useless old code 2020-11-05 15:38:50 +01:00
metadata.json Update metadata with GNOME Shell version 3.36 2020-05-07 08:44:56 +02:00
README.md Manage events 2020-11-05 15:36:14 +01:00

Introduction

This GNOME Shell Extension aims to display information to center box. Using DBUS protocol, any application can add or remove text and icons in the upper bar, right after date & clock.

Installation

Create a symbolic link from your .local directory and enable extension

ln -s $PWD/generic-monitor@gnome-shell-extensions/ ~/.local/share/gnome-shell/extensions/ gnome-extensions enable generic-monitor@gnome-shell-extensions

Restart GNOME

DBUS protocol

All functions read JSON formatted parameters

notify(): { "group": "groupname", // item can have text and/or icon, other are optional // click action can be : "signal" or "delete" // box property can be : "left", "center" or "right" "items": [ { "name":"", "text":"", "style":"", "icon-style":"", "icon":"", "on-click":"", "box":"", }, ... ] } }

deleteItems(): { "items": ["@", ...] }

deleteGroups(): { "groups": ["", ...] }

When text/icon is clicked and on-click parameter is set to "signal", extension emit one of the following signals :

  • onClick
  • onRightClick
  • onDblClick
  • onRightDblClick

Other signals are available when extension is activated/deactivated :

  • onActivate
  • onDeactivate

Example

You can test it with command line :

gdbus call --session --dest org.gnome.Shell --object-path /com/soutade/GenericMonitor --method com.soutade.GenericMonitor.notify '{"group":"new","items":[{"name":"first","on-enter":"open-popup","on-leave":"close-popup","text":"Hello","style":"color:green","popup":{"items":[{"picture":{"path":"/tmp/cat2.jpg"}}]}}]}'

gdbus call --session --dest org.gnome.Shell --object-path /com/soutade/GenericMonitor --method com.soutade.GenericMonitor.deleteGroups '{"groups":["new"]}'

Python example is available

Development

After doing code update, you can test it within a nested window. In other cases you have to restart GNOME.

dbus-run-session -- gnome-shell --nested [--wayland]

To see log & errors :

journalctl /usr/bin/gnome-shell

Licence

GNU GPL 3