GnomeShellGenericMonitor/README.md

99 lines
2.3 KiB
Markdown
Raw Normal View History

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",
2020-05-05 10:04:18 +02:00
// 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"
2020-03-30 10:45:26 +02:00
"items": [
{
"name":"",
"text":"",
"style":"",
"icon-style":"",
"icon":"",
2020-05-04 10:08:39 +02:00
"on-click":"",
2020-05-05 10:04:18 +02:00
"box":"",
2020-03-30 10:45:26 +02:00
}, ...
]
}
}
deleteItems():
{
"items": ["<itemName>@<groupName>", ...]
}
deleteGroups():
{
"groups": ["<groupName>", ...]
}
2020-05-04 10:08:39 +02:00
When text/icon is clicked and on-click parameter is set to "signal",
extension emit one of the following signals :
* onClick
* onRightClick
* onDblClick
* onRightDblClick
* onEnter
* onLeave
2020-11-12 14:16:17 +01:00
* onScrollUp
* onScrollDown
2020-05-04 10:08:39 +02:00
Other signals are available when extension is activated/deactivated :
* onActivate
* onDeactivate
2020-05-04 10:08:39 +02:00
2020-03-30 10:45:26 +02:00
Example
-------
You can test it with command line :
2020-11-05 15:36:14 +01:00
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"}}]}}]}'
2020-03-30 10:45:26 +02:00
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