From dc9d595a3efab7772e244691d7baa8deedcc1aa0 Mon Sep 17 00:00:00 2001 From: Christian Fritz Date: Sun, 29 Jun 2025 16:28:40 -0700 Subject: [PATCH 1/2] Fix formatting in README --- README.md | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 01ec958..53326bc 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,11 @@ OR 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 +```bash +ln -s $PWD/generic-monitor@gnome-shell-extensions/ ~/.local/share/gnome-shell/extensions/ + +gnome-extensions enable generic-monitor@gnome-shell-extensions +``` Restart GNOME @@ -24,6 +27,7 @@ DBUS protocol All functions read JSON formatted parameters +```js notify(): { "group": "groupname", @@ -64,26 +68,32 @@ All functions read JSON formatted parameters { "item": "@" } +``` DBUS object =========== is defined as : +```js "text" : { "name" : "" // Optional, used with popup nested element , // Optional, used with popup nested element "text" : "Text to be displayed", "style" : "CSS style to be applied", // Optional } +``` is defined as : +```js "icon" : { "path" : "Icon path", "style" : "CSS style to be applied", // Optional } +``` is defined as : +```js "picture" : { "name" : "" // Optional, used with popup nested element , // Optional, used with popup nested element @@ -91,18 +101,21 @@ DBUS object "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 } +``` and/or ] } - +``` Signals description =================== Signals can be : +```js "on-click" : ["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"] @@ -110,6 +123,7 @@ Signals can be : "on-enter" : ["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"] +``` Targets : @@ -118,7 +132,7 @@ Targets : * open-popup : Open 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 - + Signal names emit when action "signal" is specified : @@ -146,9 +160,13 @@ 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-click":"toggle-popup","text":{"text":"Hello","style":"color:green"},"popup":{"items":[{"picture":{"path":"/tmp/cat.jpg"}}]}}]}' +```bash +# 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"}}]}}]}' - gdbus call --session --dest org.gnome.Shell --object-path /com/soutade/GenericMonitor --method com.soutade.GenericMonitor.deleteGroups '{"groups":["new"]}' +# Delete group +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 @@ -158,12 +176,15 @@ 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] +```bash +dbus-run-session -- gnome-shell --nested [--wayland] +``` To see log & errors : - journalctl /usr/bin/gnome-shell - +```bash +journalctl /usr/bin/gnome-shell +``` Licence ------- -- 2.39.5 From 66370031272e58caef791c0f916314acbf0e32bf Mon Sep 17 00:00:00 2001 From: Christian-Fritz Date: Fri, 4 Jul 2025 22:16:01 +0200 Subject: [PATCH 2/2] Update README.md Fixed some typos --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 53326bc..86fc151 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ All functions read JSON formatted parameters DBUS object =========== - is defined as : + is defined as: ```js "text" : { "name" : "" // Optional, used with popup nested element @@ -84,7 +84,7 @@ DBUS object } ``` - is defined as : + is defined as: ```js "icon" : { "path" : "Icon path", @@ -92,7 +92,7 @@ DBUS object } ``` - is defined as : + is defined as: ```js "picture" : { "name" : "" // Optional, used with popup nested element @@ -103,7 +103,7 @@ DBUS object } ``` - is defined as: ```js "popup" : { "items": [ and/or ] @@ -134,7 +134,7 @@ Targets : * 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 * onDblClick @@ -145,11 +145,11 @@ Signal names emit when action "signal" is specified : * onScrollUp * onScrollDown -Each signal is sent with one parameter : "@" +Each signal is sent with one parameter: "@" For popup nested elements, parameter is "@@" 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 * onDeactivate @@ -158,7 +158,7 @@ Other signals are available when extension is activated/deactivated : Example ------- -You can test it with command line : +You can test it with command line: ```bash # Create new group and add items @@ -180,7 +180,7 @@ After doing code update, you can test it within a nested window. In other cases dbus-run-session -- gnome-shell --nested [--wayland] ``` -To see log & errors : +To see log & errors: ```bash journalctl /usr/bin/gnome-shell -- 2.39.5