-
Notifications
You must be signed in to change notification settings - Fork 4
/
README
141 lines (103 loc) · 4.92 KB
/
README
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
Generic Monitor XFce4 panel plugin (GenMon)
===========================================
1 - Description
-----------
The GenMon plugin cyclically spawns the indicated script/program, captures its output and displays the result into the panel.
2 - Installation
------------
Do the usual stuff:
- gunzip
- tar xf
- ./configure --prefix=<XFce4InstallationDir> (e.g. /usr/local)
- make
- make install (as root)
You should then end up with:
libgenmon.so
libgenmon.la
installed in <XFce4InstallationDir>/lib/xfce4/panel/plugins/
and
genmon.desktop
installed in <XFce4InstallationDir>/share/xfce4/panel/plugins/
xfce4-genmon-plugin.mo
installed in <XFce4InstallationDir>/share/locale/XX/LC_MESSAGES/
where XX represents the languages supported by genmon plugin
You are encouraged to delete the installed libgenmon.la
3 - Testing
-------
Use GenMon for invoking the provided "datetime" shell script.
Then the current date/time should be continuously updated in your panel.
If the plugin displays XXX it means that the spawn of the command has failed.
4 - Extra
-----
A simple Perl script, disktemp, that retrieves the temperature of a disk
using the smartmontools is provided.
To install it, as root you may do:
- cp disktemp /usr/local/bin
- cd /usr/local/bin
- chown root:root disktemp
- chmod a+rx disktemp
- chmod u+s disktemp
Then run (you need to have smartd/smarctl installed on your system)
- disktemp <disk> (e.g. /dev/hda)
If this works, you should be able to use GenMon for continually monitoring
your disk temperature.
5 - New Features
-----------
Genmon settings are now stored in the xfconf database. This wil lalso allow for
saving and restoring of genmon settings using the xfce4-panel-profiles tool.
The new version of genmon plugin can also display an icon (which can be a
clickable icon), a tooltip, a text and a bar.
To display these items, the script called by genmon should return a simple
XML string.
The XML tags which can be used are :
<txt>Text to display</txt>
<img>Path to the image to display</img>
<click>The command to be executed when clicking on the image</click>
<tool>Tooltip text</tool>
<bar>Pourcentage to display in the bar</bar>
<icon>Name of an icon from your current icon theme to display</icon>
<iconclick>The command to be executed when clicking on the icon</iconclick>
<css>The css tags to be applied to the widget</css>
If None of the tags are detected in the result of the command, the plugin
returns to its original behaviour (displaying the result of the command).
No tag is mandatory: for instance, you can display a tooltip without and image...
The text between the <txt> and </txt>, and the <tool> and </tool> tags can use pango markup for style and color.
Here's a simple example of a plugin displaying the Temp of the CPU in the panel
(with an image) and the Freq in a Tooltip:
#!/bin/bash
echo "<img>/usr/share/icons/Bluecurve/16x16/apps/gnome-monitor.png</img>"
declare -i cpuFreq
cpuFreq=$(cat /proc/cpuinfo | grep "cpu MHz" | sed 's/\ \ */ /g' | cut -f3 -d" " | cut -f1 -d".")
if [ $cpuFreq -ge 1000 ]
then
cpu=$(echo $cpuFreq | cut -c1).$(echo $cpuFreq | cut -c2)GHz
else
cpu=${cpuFreq}MHz
fi
echo "<txt>"$(cat /proc/acpi/thermal_zone/THM/temperature | sed 's/\ \ */ /g' | cut -f2 -d" ")" C</txt>"
echo "<tool>Freq: "$cpu"</tool>"
PS: Depending on your configuration, you should change the image path.
You can find more scripts in scripts/mon*.
The xfce4-genmon-plugin now supports xfce4-panel plugin-event functionality. Currently it only supports the
"refresh" action which resets the timer and causes the associated command to execute again. You can use this
command remotely or at the end of a script to force the panel plugin to refresh.
To refresh the plugin, issue the command:
xfce4-panel --plugin-event=genmon-X:refresh:bool:true
where "genmon-X" is the widget name of the particular genmon instance. To get this name, go to the panel
properties screen and on the Items tab, hover your mouse over the genmon plugin to get it's internal name.
GTK3 CSS styling capabilites have been enhanced. Please refer to the 'CSS Styling.txt' document for more information.
To close the configuration dialog without saving any changes (and not firing off the timer) click on the X in the titlebar window
The <icon></icon> and <iconclick></iconclick> elements are useful for displaying an icon from the current icon theme.
In addition, it supports the following functionality:
- the icon image will change with icon theme changes
- it supports xfce4-panel's new Adjust Icon Size Automatically functionality
- it supports light/dark symbolic icon auto-colour changes
To change the color of the progress bar you can use the CSS tag like so:
echo "<css>progressbar.genmon_progressbar progress { background-color: #fc9b0a }</css>"
6 - Bugs
----
If you find a bug, fix it, then tell me how you did it :-)
Enjoy!
Roger Seguin
Julien Devemy <[email protected]>