Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

View File

@ -13,11 +13,8 @@ OR
Create a symbolic link from your _.local_ directory and enable extension Create a symbolic link from your _.local_ directory and enable extension
```bash ln -s $PWD/generic-monitor@gnome-shell-extensions/ ~/.local/share/gnome-shell/extensions/
ln -s $PWD/generic-monitor@gnome-shell-extensions/ ~/.local/share/gnome-shell/extensions/ gnome-extensions enable generic-monitor@gnome-shell-extensions
gnome-extensions enable generic-monitor@gnome-shell-extensions
```
Restart GNOME Restart GNOME
@ -27,7 +24,6 @@ DBUS protocol
All functions read JSON formatted parameters All functions read JSON formatted parameters
```js
notify(): notify():
{ {
"group": "groupname", "group": "groupname",
@ -68,32 +64,26 @@ All functions read JSON formatted parameters
{ {
"item": "<itemName>@<groupName>" "item": "<itemName>@<groupName>"
} }
```
DBUS object DBUS object
=========== ===========
<text_object> is defined as: <text_object> is defined as :
```js
"text" : { "text" : {
"name" : "" // Optional, used with popup nested element "name" : "" // Optional, used with popup nested element
<signals_description>, // Optional, used with popup nested element <signals_description>, // Optional, used with popup nested element
"text" : "Text to be displayed", "text" : "Text to be displayed",
"style" : "CSS style to be applied", // Optional "style" : "CSS style to be applied", // Optional
} }
```
<icon_object> is defined as: <icon_object> is defined as :
```js
"icon" : { "icon" : {
"path" : "Icon path", "path" : "Icon path",
"style" : "CSS style to be applied", // Optional "style" : "CSS style to be applied", // Optional
} }
```
<picture_object> is defined as: <picture_object> is defined as :
```js
"picture" : { "picture" : {
"name" : "" // Optional, used with popup nested element "name" : "" // Optional, used with popup nested element
<signals_description>, // Optional, used with popup nested element <signals_description>, // Optional, used with popup nested element
@ -101,21 +91,18 @@ DBUS object
"width" : XXX, // Optional : Force width in pixels, can be -1 for defaut value "width" : XXX, // Optional : Force width in pixels, can be -1 for defaut value
"height" : XXX, // Optional : Force height in pixels, can be -1 for defaut value "height" : XXX, // Optional : Force height in pixels, can be -1 for defaut value
} }
```
<popup_object> is defined as: <popup_object is defuned as :
```js
"popup" : { "popup" : {
"items": [<text_objects> and/or <picture_objects>] "items": [<text_objects> and/or <picture_objects>]
} }
```
Signals description Signals description
=================== ===================
Signals can be : Signals can be :
```js
"on-click" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"] "on-click" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
"on-dblclick" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"] "on-dblclick" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
"on-rightclick" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"] "on-rightclick" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
@ -123,7 +110,6 @@ Signals can be :
"on-enter" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"] "on-enter" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
"on-leave" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"] "on-leave" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
"on-scroll" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"] "on-scroll" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
```
Targets : Targets :
@ -132,9 +118,9 @@ Targets :
* open-popup : Open the popup if there is one * open-popup : Open the popup if there is one
* close-popup : Close the popup if there is one * close-popup : Close the popup if there is one
* toggle-popup : Toggle (open/close) the popup if there is one * toggle-popup : Toggle (open/close) the popup if there is one
Signal names emit when action "signal" is specified :
Signal names emit when action "signal" is specified:
* onClick * onClick
* onDblClick * onDblClick
@ -145,11 +131,11 @@ Signal names emit when action "signal" is specified:
* onScrollUp * onScrollUp
* onScrollDown * onScrollDown
Each signal is sent with one parameter: "<itemName>@<groupName>" Each signal is sent with one parameter : "<itemName>@<groupName>"
For popup nested elements, parameter is "<nestedName>@<itemName>@<groupName>" For popup nested elements, parameter is "<nestedName>@<itemName>@<groupName>"
where nestedName can be empty if not defined by user where nestedName can be empty if not defined by user
Other signals are available when extension is activated/deactivated: Other signals are available when extension is activated/deactivated :
* onActivate * onActivate
* onDeactivate * onDeactivate
@ -158,15 +144,11 @@ Other signals are available when extension is activated/deactivated:
Example Example
------- -------
You can test it with command line: You can test it with command line :
```bash gdbus call --session --dest org.gnome.Shell --object-path /com/soutade/GenericMonitor --method com.soutade.GenericMonitor.notify '{"group":"new","items":[{"name":"first","on-click":"toggle-popup","text":{"text":"Hello","style":"color:green"},"popup":{"items":[{"picture":{"path":"/tmp/cat.jpg"}}]}}]}'
# Create new group and add items
gdbus call --session --dest org.gnome.Shell --object-path /com/soutade/GenericMonitor --method com.soutade.GenericMonitor.notify '{"group":"new","items":[{"name":"first","on-click":"toggle-popup","text":{"text":"Hello","style":"color:green"},"popup":{"items":[{"picture":{"path":"/tmp/cat.jpg"}}]}}]}'
# Delete group gdbus call --session --dest org.gnome.Shell --object-path /com/soutade/GenericMonitor --method com.soutade.GenericMonitor.deleteGroups '{"groups":["new"]}'
gdbus call --session --dest org.gnome.Shell --object-path /com/soutade/GenericMonitor --method com.soutade.GenericMonitor.deleteGroups '{"groups":["new"]}'
```
Python examples are available @ https://indefero.soutade.fr/p/genericmonitor/source/tree/master/examples Python examples are available @ https://indefero.soutade.fr/p/genericmonitor/source/tree/master/examples
@ -176,15 +158,12 @@ Development
After doing code update, you can test it within a nested window. In other cases you have to restart GNOME. After doing code update, you can test it within a nested window. In other cases you have to restart GNOME.
```bash dbus-run-session -- gnome-shell --nested [--wayland]
dbus-run-session -- gnome-shell --nested [--wayland]
```
To see log & errors: To see log & errors :
journalctl /usr/bin/gnome-shell
```bash
journalctl /usr/bin/gnome-shell
```
Licence Licence
------- -------