Go to file
Grégory Soutadé 506660f1da Update examples:
* Move examples in examples directory
       * Create separate DBUSItem class
       * Add timer example
2020-05-04 10:35:52 +02:00
examples Update examples: 2020-05-04 10:35:52 +02:00
COPYING Initial commit 2020-03-30 10:45:26 +02:00
dbus.xml Add onClick feature 2020-05-04 10:35:52 +02:00
extension.js Add onClick feature 2020-05-04 10:35:52 +02:00
metadata.json Add onClick feature 2020-05-04 10:35:52 +02:00
README.md Add onClick feature 2020-05-04 10:35:52 +02:00
stylesheet.css Initial commit 2020-03-30 10:45:26 +02: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", // style and icon-style are optional // item can have text and/or icon // item can have click action "signal" or "delete" "items": [ { "name":"", "text":"", "style":"", "icon-style":"", "icon":"", "on-click":"", }, ... ] } }

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

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","text":"Hello","style":"color:green"}]}' 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