Gnome SHELL Generic Monitor

Gnome SHELL Generic Monitor Git Source Tree

Root/README.md

1Introduction
2------------
3
4This 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.
5
6
7Installation
8------------
9
10Create a symbolic link from your _.local_ directory and enable extension
11
12 ln -s $PWD/generic-monitor@gnome-shell-extensions/ ~/.local/share/gnome-shell/extensions/
13 gnome-extensions enable generic-monitor@gnome-shell-extensions
14
15Restart GNOME
16
17
18DBUS protocol
19-------------
20
21All functions read JSON formatted parameters
22
23 notify():
24 {
25 "group": "groupname",
26 "items": [
27 {
28 "name" : "",
29 "box" : ["left"|"center"|"right"], // Optional : center by default
30 "text" : <text_object>, // Optional
31 "icon" : <icon_object>, // Optional
32 "popup" : <popup_object>, // Optional
33 <signals_description>, // Optional
34 }, ...
35 ]
36 }
37 }
38
39 deleteItems():
40 {
41 "items": ["<itemName>@<groupName>", ...]
42 }
43
44 deleteGroups():
45 {
46 "groups": ["<groupName>", ...]
47 }
48
49 openPopup():
50 {
51 "item": "<itemName>@<groupName>"
52 }
53
54 closePopup():
55 {
56 "item": "<itemName>@<groupName>"
57 }
58
59 togglePopup():
60 {
61 "item": "<itemName>@<groupName>"
62 }
63
64
65DBUS object
66===========
67
68<text_object> is defined as :
69 "text" : {
70 "text" : "Text to be displayed",
71 "style" : "CSS style to be applied", // Optional
72 }
73
74<icon_object> is defined as :
75 "icon" : {
76 "path" : "Icon path",
77 "style" : "CSS style to be applied", // Optional
78 }
79
80<picture_object> is defined as :
81 "picture" : {
82 "path" : "Icon path",
83 "width" : XXX, // Optional : Force width in pixels, can be -1 for defaut value
84 "height" : XXX, // Optional : Force height in pixels, can be -1 for defaut value
85 }
86
87<popup_object is defuned as :
88 "popup" : {
89 "items": [<text_objects> and/or <picture_objects>]
90 }
91
92
93Signals description
94===================
95
96Signals can be :
97
98 "on-click" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
99 "on-dblclick" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
100 "on-rightclick" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
101 "on-rightdblclick" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
102 "on-enter" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
103 "on-leave" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
104 "on-scroll" : ["signal"|"delete"|"open-popup"|"close-popup"|"toggle-popup"]
105
106Targets :
107
108 * signal : emit a signal to desktop application
109 * delete : Delete item
110 * open-popup : Open the popup if there is one
111 * close-popup : Close the popup if there is one
112 * toggle-popup : Toggle (open/close) the popup if there is one
113
114
115Signal names emit when action "signal" is specified :
116
117 * onClick
118 * onDblClick
119 * onRightClick
120 * onRightDblClick
121 * onEnter
122 * onLeave
123 * onScrollUp
124 * onScrollDown
125
126Each signal is sent with one parameter : "<itemName>@<groupName>"
127
128Other signals are available when extension is activated/deactivated :
129
130 * onActivate
131 * onDeactivate
132
133
134Example
135-------
136
137You can test it with command line :
138
139 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/cat2.jpg"}}]}}]}'
140
141 gdbus call --session --dest org.gnome.Shell --object-path /com/soutade/GenericMonitor --method com.soutade.GenericMonitor.deleteGroups '{"groups":["new"]}'
142
143Python examples is available
144
145
146Development
147-----------
148
149After doing code update, you can test it within a nested window. In other cases you have to restart GNOME.
150
151 dbus-run-session -- gnome-shell --nested [--wayland]
152
153To see log & errors :
154
155 journalctl /usr/bin/gnome-shell
156
157
158Licence
159-------
160
161GNU GPL 3

Archive Download this file

Branches

Tags