-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcinnamon-applets
57 lines (49 loc) · 3.31 KB
/
cinnamon-applets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Things to try:
https://wiki.gnome.org/Projects/GnomeShell/LookingGlass
alt-F2 -> lg<Enter>
Q: how to print debugging traces from cinnamon applets? e.g. in ~/.local/share/cinnamon/applets/workspace-grid@hernejj/GridStyle.js
A:
1. tail -f ~/.cinnamon/glass.log
(per https://stackoverflow.com/questions/14025722/how-to-debug-cinnamon-applet#answer-28512708 )
That shows stuff that you print from the javascript using:
global.log("FOO");
2. tail -f ~/.xsession-errors
That shows some warnings from the javascript, e.g.:
Cjs-Message: JS WARNING: [/usr/local/google/home/donhatch/.local/share/cinnamon/applets/workspace-grid@hernejj/BarIndicatorStyle.js 96]: anonymous function does not always return a value
Cjs-Message: JS WARNING: [/usr/local/google/home/donhatch/.local/share/cinnamon/applets/workspace-grid@hernejj/GridStyle.js 81]: anonymous function does not always return a value
3. If you restart cinnamon using `cinnamon --replace &`, then those messages will appear on that terminal instead.
Q: easiest way to restart cinnamon?
A: alt-F2, r, Enter.
(however, it will still be running from the same terminal where
it was started, somehow.)
Q: easiest way to reload an applet?
PA: This way sucks, but:
Remove from panel and Add to panel, using System Settings -> Preferences -> Applets
Unfortunately, sometimes the old keeps running. To clean out olds,
restart cinnamon.
A: per https://gist.github.com/hyOzd/35e913db620b3ba086fb :
# replace the EXTENSION_UUID with your extension/applet/desklet name
# replace the APPLET with other types if you are not working with an applet
dbus-send --session --dest=org.Cinnamon.LookingGlass --type=method_call /org/Cinnamon/LookingGlass org.Cinnamon.LookingGlass.ReloadExtension string:'EXTENSION_UUID' string:'APPLET'
e.g.
dbus-send --session --dest=org.Cinnamon.LookingGlass --type=method_call /org/Cinnamon/LookingGlass org.Cinnamon.LookingGlass.ReloadExtension string:'workspace-switcher-hacked@donhatch' string:'APPLET'
Nice! (still has problem that sometimes old keeps running though,
requiring restarting cinnamon)
Q: where is the javascript source for workspace-grid@hernjj and [email protected]?
A:
~/.local/share/cinnamon/applets/workspace-grid@hernejj/
/usr/share/cinnamon/applets/[email protected]
So, to work on it, I would think:
cp -a /usr/share/cinnamon/applets/[email protected] ~/.local/share/cinnamon/applets/workspace-switcher-hacked/
Q: how to get the system to recognize a new applet that I've added to ~/.local/share/cinnamon/applets/ ?
PA: Don't know the real way, but a hacky way
is to just install any applet from `Available applets (online)`.
That will refresh the list.
Q: but when I do that and Add the thing, it turns red without any indication
of what went wrong??
A: Some gotchas:
- uuid in metadata.json must match directory name!
- workspace-grid@hernejj has 'workspace-grid@hernejj' hard-coded inside it, you have to change that every place it occurs
except outright log messages. If you don't, each place you mess it up will give an inscrutible error,
e.g. "workspace-grid@hernejj Main Applet Exception: TypeError: xletDir is undefined"
Q: can I exit an applet instead of going off the rails? throwing an Error doesn't seem to.