Merge lp:~lynx333/cairo-dock-plug-ins-extras/HDDtemperature into lp:~cairo-dock-team/cairo-dock-plug-ins-extras/third-party
- HDDtemperature
- Merge into third-party
Proposed by
Reali$t
Status: | Merged |
---|---|
Approved by: | Matthieu Baerts |
Approved revision: | 200 |
Merged at revision: | 201 |
Proposed branch: | lp:~lynx333/cairo-dock-plug-ins-extras/HDDtemperature |
Merge into: | lp:~cairo-dock-team/cairo-dock-plug-ins-extras/third-party |
Diff against target: |
365 lines (+335/-0) 5 files modified
HDDtemperature/HDDtemperature (+21/-0) HDDtemperature/HDDtemperature.conf (+114/-0) HDDtemperature/HDDtemperature.sh (+140/-0) HDDtemperature/README (+43/-0) HDDtemperature/auto-load.conf (+17/-0) |
To merge this branch: | bzr merge lp:~lynx333/cairo-dock-plug-ins-extras/HDDtemperature |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthieu Baerts | Approve | ||
Review via email: mp+75489@code.launchpad.net |
Commit message
Description of the change
This applet implements HDD temperature monitoring
To post a comment you must log in.
Revision history for this message
Reali$t (lynx333) wrote : | # |
> But... there is no change between your branch and the main branch :)
Hello, Matthieu,
I apologize for the inconvenience, it's my first trial of using Launchpad :)
Many thanks for your detailed instructions, I hope everything is ok now
http://
Regards
Revision history for this message
Matthieu Baerts (matttbe) wrote : | # |
Thank you for sharing this new applet ;)
review:
Approve
Revision history for this message
Matthieu Baerts (matttbe) wrote : | # |
Hello
If there is any new revisions after the merge of your branch, can you re-submit this merge proposal? There is a "Resubmit proposal" button on this page or you can start a new one ;)
I guess I can add your rev 201 on the main branch. Thank you
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'HDDtemperature' | |||
2 | === added file 'HDDtemperature/HDDtemperature' | |||
3 | --- HDDtemperature/HDDtemperature 1970-01-01 00:00:00 +0000 | |||
4 | +++ HDDtemperature/HDDtemperature 2011-09-16 16:54:24 +0000 | |||
5 | @@ -0,0 +1,21 @@ | |||
6 | 1 | #!/usr/bin/python | ||
7 | 2 | |||
8 | 3 | # This is a part of the external demo applet for Cairo-Dock | ||
9 | 4 | # Copyright : (C) 2010-2011 by Nochka85, Fabounet and atttbe | ||
10 | 5 | # E-mail : fabounet@glx-dock.org | ||
11 | 6 | # | ||
12 | 7 | # This program is free software; you can redistribute it and/or | ||
13 | 8 | # modify it under the terms of the GNU General Public License | ||
14 | 9 | # as published by the Free Software Foundation; either version 2 | ||
15 | 10 | # of the License, or (at your option) any later version. | ||
16 | 11 | # | ||
17 | 12 | # This program is distributed in the hope that it will be useful, | ||
18 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | 14 | # ERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | 15 | # GNU General Public License for more details. | ||
21 | 16 | # http://www.gnu.org/licenses/licenses.html#GPL | ||
22 | 17 | |||
23 | 18 | from CDBashApplet import CDBashApplet | ||
24 | 19 | |||
25 | 20 | if __name__ == '__main__': | ||
26 | 21 | CDBashApplet().run() | ||
27 | 0 | 22 | ||
28 | === added file 'HDDtemperature/HDDtemperature.conf' | |||
29 | --- HDDtemperature/HDDtemperature.conf 1970-01-01 00:00:00 +0000 | |||
30 | +++ HDDtemperature/HDDtemperature.conf 2011-09-16 16:54:24 +0000 | |||
31 | @@ -0,0 +1,114 @@ | |||
32 | 1 | #!en;0.0.1 | ||
33 | 2 | |||
34 | 3 | #[gtk-about] | ||
35 | 4 | [Icon] | ||
36 | 5 | #j+[0;128] Desired icon size for this applet | ||
37 | 6 | #{Set to 0 to use the default applet size} | ||
38 | 7 | icon size = 0;0 | ||
39 | 8 | |||
40 | 9 | #s Name of the icon as it will appear in its label in the dock : | ||
41 | 10 | name = HDD temperature | ||
42 | 11 | |||
43 | 12 | #S+ Image's filename : | ||
44 | 13 | #{Let empty to use the default one.} | ||
45 | 14 | icon = | ||
46 | 15 | |||
47 | 16 | #d Name of the dock it belongs to: | ||
48 | 17 | dock name = | ||
49 | 18 | |||
50 | 19 | order= | ||
51 | 20 | |||
52 | 21 | #F[Applet's Handbook] | ||
53 | 22 | frame_hand= | ||
54 | 23 | #A | ||
55 | 24 | handbook=HDDtemperature | ||
56 | 25 | |||
57 | 26 | #[gtk-convert] | ||
58 | 27 | [Desklet] | ||
59 | 28 | |||
60 | 29 | #j+[48;512] Desklet's dimension (width x height) : | ||
61 | 30 | #{Depending on your WindowManager, you can resize it with ALT + middle_click or ALT + left_click for exemple.} | ||
62 | 31 | size = 96;96 | ||
63 | 32 | |||
64 | 33 | #i[-2048;2048] Desklet's position (x ; y) : | ||
65 | 34 | #{Depending on your WindowManager, you can move it with ALT + left_click} | ||
66 | 35 | x position=0 | ||
67 | 36 | #i[-2048;2048] ... | ||
68 | 37 | y position=0 | ||
69 | 38 | |||
70 | 39 | #b Is detached from the dock ? | ||
71 | 40 | initially detached=false | ||
72 | 41 | #l[Normal;Keep above;Keep below;On Widget Layer;Reserve space] Accessibility : | ||
73 | 42 | #{for CompizFusion's "widget layer", set behaviour in Compiz to: (class=Cairo-dock & type=utility)} | ||
74 | 43 | accessibility=0 | ||
75 | 44 | #b Should be visible on all desktops ? | ||
76 | 45 | sticky=true | ||
77 | 46 | |||
78 | 47 | #b Lock position ? | ||
79 | 48 | #{If locked, the desklet can't be moved by simply dragging it with the left mouse button. Of course you can still move it with ALT + left_click.} | ||
80 | 49 | locked = false | ||
81 | 50 | |||
82 | 51 | #I[-180;180] Rotation : | ||
83 | 52 | #{in degrees.} | ||
84 | 53 | rotation = 0 | ||
85 | 54 | |||
86 | 55 | use size= | ||
87 | 56 | |||
88 | 57 | #F[Decorations;gtk-orientation-portrait] | ||
89 | 58 | frame_deco= | ||
90 | 59 | |||
91 | 60 | #o+ Choose a decoration theme for this desklet : | ||
92 | 61 | #{Choose the 'personnal' one to define your own decorations below.} | ||
93 | 62 | decorations = default | ||
94 | 63 | |||
95 | 64 | #v | ||
96 | 65 | sep_deco = | ||
97 | 66 | |||
98 | 67 | #S+ Background image : | ||
99 | 68 | #{It's an image that will be displayed below the drawings, like a frame for exemple. Let empty to not use any.} | ||
100 | 69 | bg desklet = | ||
101 | 70 | #e+[0;1] Background tansparency : | ||
102 | 71 | bg alpha = 1 | ||
103 | 72 | #i+[0;256] Left offset : | ||
104 | 73 | #{in pixels. Use this to adjust the left position of the drawings.} | ||
105 | 74 | left offset = 0 | ||
106 | 75 | #i+[0;256] Top offset : | ||
107 | 76 | #{in pixels. Use this to adjust the top position of the drawings.} | ||
108 | 77 | top offset = 0 | ||
109 | 78 | #i+[0;256] Right offset : | ||
110 | 79 | #{in pixels. Use this to adjust the right position of the drawings.} | ||
111 | 80 | right offset = 0 | ||
112 | 81 | #i+[0;256] Bottom offset : | ||
113 | 82 | #{in pixels. Use this to adjust the bottom position of the drawings.} | ||
114 | 83 | bottom offset = 0 | ||
115 | 84 | #S+ Foreground image : | ||
116 | 85 | #{It's an image that will be displayed above the drawings, like a reflect for exemple. Let empty to not use any.} | ||
117 | 86 | fg desklet = | ||
118 | 87 | #e+[0;1] Foreground tansparency : | ||
119 | 88 | fg alpha = 1 | ||
120 | 89 | |||
121 | 90 | #[gtk-preferences] | ||
122 | 91 | [Configuration] | ||
123 | 92 | |||
124 | 93 | #s One or more device drive path to monitor: | ||
125 | 94 | para_hdds = /dev/sda /dev/sdb /dev/sdc /dev/sdd | ||
126 | 95 | |||
127 | 96 | #b Show maximum temperature on icon? | ||
128 | 97 | para_show = true | ||
129 | 98 | |||
130 | 99 | #i[1;15] Time interval for checking (minutes): | ||
131 | 100 | para_time = 3 | ||
132 | 101 | |||
133 | 102 | #i[20;180] Alert temperature value (°C by default) | ||
134 | 103 | #{It should conform to units used by hddtemp daemon} | ||
135 | 104 | para_alert = 55 | ||
136 | 105 | |||
137 | 106 | #i[0;900] Pop up bubble duration (in seconds) | ||
138 | 107 | #{0 for permanent show} | ||
139 | 108 | para_dur = 5 | ||
140 | 109 | |||
141 | 110 | #i[1024;65535] Port number to listen to hddtemp daemon (7634 by default) | ||
142 | 111 | para_port = 7634 | ||
143 | 112 | |||
144 | 113 | #s Separator between fields used by hddtemp daemon ( | by default) | ||
145 | 114 | para_sep = | | ||
146 | 0 | 115 | ||
147 | === added file 'HDDtemperature/HDDtemperature.sh' | |||
148 | --- HDDtemperature/HDDtemperature.sh 1970-01-01 00:00:00 +0000 | |||
149 | +++ HDDtemperature/HDDtemperature.sh 2011-09-16 16:54:24 +0000 | |||
150 | @@ -0,0 +1,140 @@ | |||
151 | 1 | #!/bin/bash | ||
152 | 2 | |||
153 | 3 | # This is a part of the external applets for Cairo-Dock | ||
154 | 4 | # | ||
155 | 5 | # Copyright : (C) 2010-2011 by Nochka85 | ||
156 | 6 | # modified by matttbe for the new API | ||
157 | 7 | # modified by Fabounet for the new interface | ||
158 | 8 | # E-mail : nochka85@glx-dock.org | ||
159 | 9 | # | ||
160 | 10 | # | ||
161 | 11 | # This program is free software; you can redistribute it and/or | ||
162 | 12 | # modify it under the terms of the GNU General Public License | ||
163 | 13 | # as published by the Free Software Foundation; either version 2 | ||
164 | 14 | # of the License, or (at your option) any later version. | ||
165 | 15 | # | ||
166 | 16 | # This program is distributed in the hope that it will be useful, | ||
167 | 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
168 | 18 | # ERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
169 | 19 | # GNU General Public License for more details. | ||
170 | 20 | # http://www.gnu.org/licenses/licenses.html#GPL | ||
171 | 21 | |||
172 | 22 | ### This is a part of the external applet HDDtemperature for cairo-dock | ||
173 | 23 | ### Author : Reali$t | ||
174 | 24 | ### Rev : 14 sep 2011 | ||
175 | 25 | |||
176 | 26 | . /usr/share/cairo-dock/plug-ins/Dbus/CDBashApplet.sh $* | ||
177 | 27 | |||
178 | 28 | ############################################################################################################# | ||
179 | 29 | |||
180 | 30 | is_daemon() | ||
181 | 31 | { | ||
182 | 32 | if [ -z `pidof hddtemp` ]; then | ||
183 | 33 | call ShowDialog "string:\"'hddtemp' daemon is not running!\r Type in terminal to run it:\r service hddtemp start\"" "int32:0" | ||
184 | 34 | call SetQuickInfo "string:" | ||
185 | 35 | return 1 | ||
186 | 36 | fi | ||
187 | 37 | } | ||
188 | 38 | |||
189 | 39 | ############################################################################################################# | ||
190 | 40 | |||
191 | 41 | on_click() | ||
192 | 42 | { | ||
193 | 43 | |||
194 | 44 | is_daemon | ||
195 | 45 | ret_val=$? | ||
196 | 46 | if [ "$ret_val" -ne "0" ]; then | ||
197 | 47 | exit | ||
198 | 48 | fi | ||
199 | 49 | |||
200 | 50 | DURATION=`get_conf_param "para_dur"` | ||
201 | 51 | |||
202 | 52 | FULL_INFO=`cat store | tr '\n' "\r "` | ||
203 | 53 | |||
204 | 54 | call ShowDialog "string:'$FULL_INFO'" "int32:$DURATION" | ||
205 | 55 | } | ||
206 | 56 | |||
207 | 57 | ############################################################################################################# | ||
208 | 58 | |||
209 | 59 | begin() | ||
210 | 60 | { | ||
211 | 61 | is_daemon | ||
212 | 62 | ret_val=$? | ||
213 | 63 | if [ "$ret_val" -ne "0" ]; then | ||
214 | 64 | exit | ||
215 | 65 | fi | ||
216 | 66 | |||
217 | 67 | HDDS=`get_conf_param "para_hdds"` | ||
218 | 68 | SHOW_ICON=`get_conf_param "para_show"` | ||
219 | 69 | TIME_INT=`get_conf_param "para_time"` | ||
220 | 70 | ALERT_LEVEL=`get_conf_param "para_alert"` | ||
221 | 71 | HDDT_port=`get_conf_param "para_port"` | ||
222 | 72 | SEPARATOR=`get_conf_param "para_sep"` | ||
223 | 73 | SEPARATOR=${SEPARATOR:0:1} | ||
224 | 74 | |||
225 | 75 | HDTEMP=$(ncat localhost $HDDT_port | awk -F $SEPARATOR -v HDDS_awk="$HDDS" '{ | ||
226 | 76 | if (NF<5) exit; # 5 fields per device | ||
227 | 77 | T=0 | ||
228 | 78 | for(i=0;(i<=NF-5);i+=5) { | ||
229 | 79 | if (HDDS_awk ~ $(i+2)) { | ||
230 | 80 | string_awk=string_awk $(i+2) " ("$(i+3)"): " $(i+4) "°" $(5) FS | ||
231 | 81 | if (T<$(i+4)) T=$(i+4) # max temperature will be shown | ||
232 | 82 | } | ||
233 | 83 | } | ||
234 | 84 | string_awk=string_awk T | ||
235 | 85 | print string_awk | ||
236 | 86 | }') | ||
237 | 87 | |||
238 | 88 | set -- "$HDTEMP" | ||
239 | 89 | IFS="$SEPARATOR" | ||
240 | 90 | declare -a Array=($*) | ||
241 | 91 | len_Array=${#Array[@]} | ||
242 | 92 | let "len_Array-=1" # numbering from 0 | ||
243 | 93 | unset IFS | ||
244 | 94 | |||
245 | 95 | if [ $SHOW_ICON = "true" ]; then | ||
246 | 96 | call SetQuickInfo "string:'${Array[len_Array]}''°'" | ||
247 | 97 | fi | ||
248 | 98 | |||
249 | 99 | if [ ${Array[len_Array]} -ge $ALERT_LEVEL ]; then | ||
250 | 100 | call Animate "string:fire" "int32:900" | ||
251 | 101 | else | ||
252 | 102 | call Animate "string:fire" "int32:0" | ||
253 | 103 | fi | ||
254 | 104 | |||
255 | 105 | cp /dev/null store | ||
256 | 106 | for i in "${Array[@]:0:$len_Array}"; do # to last-but-one (before temperature) | ||
257 | 107 | echo "$i" >> store | ||
258 | 108 | done | ||
259 | 109 | |||
260 | 110 | echo "dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock | ||
261 | 111 | org.cairodock.CairoDock.ReloadModule string:HDDtemperature" \ | ||
262 | 112 | | at now + $TIME_INT min # refresh in background | ||
263 | 113 | } | ||
264 | 114 | |||
265 | 115 | ############################################################################################################# | ||
266 | 116 | |||
267 | 117 | end() | ||
268 | 118 | { | ||
269 | 119 | rm -f store | ||
270 | 120 | } | ||
271 | 121 | |||
272 | 122 | ############################################################################################################# | ||
273 | 123 | |||
274 | 124 | reload() | ||
275 | 125 | { | ||
276 | 126 | |||
277 | 127 | SHOW_ICON=`get_conf_param "para_show"` | ||
278 | 128 | |||
279 | 129 | if [ $SHOW_ICON = "false" ]; then | ||
280 | 130 | call SetQuickInfo "string:" | ||
281 | 131 | fi | ||
282 | 132 | |||
283 | 133 | begin | ||
284 | 134 | } | ||
285 | 135 | |||
286 | 136 | ############################################################################################################# | ||
287 | 137 | |||
288 | 138 | run $* | ||
289 | 139 | |||
290 | 140 | exit 0 | ||
291 | 0 | 141 | ||
292 | === added file 'HDDtemperature/README' | |||
293 | --- HDDtemperature/README 1970-01-01 00:00:00 +0000 | |||
294 | +++ HDDtemperature/README 2011-09-16 16:54:24 +0000 | |||
295 | @@ -0,0 +1,43 @@ | |||
296 | 1 | HDDtemperature applet for Cairo-Dock shows maximal temperature of your hard disk drives | ||
297 | 2 | getting values from 'hddtemp' daemon (see: man hddtemp ) | ||
298 | 3 | |||
299 | 4 | Author : Reali$t helped by Matttbe and Nochka85's demo script | ||
300 | 5 | E-mail : lynx333[at]mail333.com | ||
301 | 6 | Rev : 14.09.2011 | ||
302 | 7 | |||
303 | 8 | |||
304 | 9 | INSTALLATION: | ||
305 | 10 | ------------- | ||
306 | 11 | |||
307 | 12 | 1) The name of this applet is "HDDtemperature"; it is placed in a folder "~/.config/cairo-dock/third-party" | ||
308 | 13 | |||
309 | 14 | So, files in "~/.config/cairo-dock/third-party/HDDtemperature" directory are: | ||
310 | 15 | |||
311 | 16 | "auto-load.conf" : the file describing the applet | ||
312 | 17 | "icon" : the default icon of the applet | ||
313 | 18 | "HDDtemperature" : the python script, without extension | ||
314 | 19 | "HDDtemperature.sh" : the script in bash, actually applet's code | ||
315 | 20 | "HDDtemperature.conf" : the config file of the applet | ||
316 | 21 | "preview" : a preview of the applet | ||
317 | 22 | |||
318 | 23 | |||
319 | 24 | 2) Make the files "HDDtemperature" and "HDDtemperature.sh" executable: | ||
320 | 25 | |||
321 | 26 | chmod a+x ~/.config/cairo-dock/third-party/HDDtemperature/HDDtemperature | ||
322 | 27 | |||
323 | 28 | chmod a+x ~/.config/cairo-dock/third-party/HDDtemperature/HDDtemperature.sh | ||
324 | 29 | |||
325 | 30 | |||
326 | 31 | 3) Check whether 'hddtemp' daemon is running: | ||
327 | 32 | |||
328 | 33 | ps -f -C hddtemp | ||
329 | 34 | |||
330 | 35 | If no, start it: | ||
331 | 36 | |||
332 | 37 | service hddtemp start | ||
333 | 38 | |||
334 | 39 | (Read more about 'hddtemp' utility in its manual) | ||
335 | 40 | |||
336 | 41 | |||
337 | 42 | 4) Turn the applet on and customize it (if you wish) in the "System" section of "Configure" menu of Cairo-Dock. | ||
338 | 43 | |||
339 | 0 | 44 | ||
340 | === added file 'HDDtemperature/auto-load.conf' | |||
341 | --- HDDtemperature/auto-load.conf 1970-01-01 00:00:00 +0000 | |||
342 | +++ HDDtemperature/auto-load.conf 2011-09-16 16:54:24 +0000 | |||
343 | @@ -0,0 +1,17 @@ | |||
344 | 1 | [Register] | ||
345 | 2 | |||
346 | 3 | # Author of the applet | ||
347 | 4 | author = Reali$t | ||
348 | 5 | |||
349 | 6 | # A short description of the applet and how to use it. | ||
350 | 7 | description = This applet shows maximal temperature of your hard disk drives \n getting values from 'hddtemp' daemon (see: man hddtemp). \n Left-click shows more information about HD drives. | ||
351 | 8 | |||
352 | 9 | # Category of the applet : 2 = files, 3 = internet, 4 = Desktop, 5 = accessory, 6 = system, 7 = fun | ||
353 | 10 | category = 6 | ||
354 | 11 | |||
355 | 12 | # Version of the applet; change it everytime you change something in the config file. Don't forget to update the version both in this file and in the config file. | ||
356 | 13 | version = 0.0.1 | ||
357 | 14 | |||
358 | 15 | # Default icon to use if no icon has been defined by the user. If not specified, or if the file is not found, the "icon" file will be used. | ||
359 | 16 | icon = icon | ||
360 | 17 | |||
361 | 0 | 18 | ||
362 | === added file 'HDDtemperature/icon' | |||
363 | 1 | Binary files HDDtemperature/icon 1970-01-01 00:00:00 +0000 and HDDtemperature/icon 2011-09-16 16:54:24 +0000 differ | 19 | Binary files HDDtemperature/icon 1970-01-01 00:00:00 +0000 and HDDtemperature/icon 2011-09-16 16:54:24 +0000 differ |
364 | === added file 'HDDtemperature/preview' | |||
365 | 2 | Binary files HDDtemperature/preview 1970-01-01 00:00:00 +0000 and HDDtemperature/preview 2011-09-16 16:54:24 +0000 differ | 20 | Binary files HDDtemperature/preview 1970-01-01 00:00:00 +0000 and HDDtemperature/preview 2011-09-16 16:54:24 +0000 differ |
Hello Reali$t and thank you for this merge proposal!
But... there is no change between your branch and the main branch :) www.glx- dock.org/ ww_page. php?p=Help% 20us%20with% 20BZR&lang= en#8-The% 20use%20of% 20bazaar
Don't hesitate to have a look to this wiki page: http://
So if you want to add a file or directory, launch this command: plug-ins- extras
cd cairo-dock-
bzr add SOMETHING
If you want to check if you've added all files and edit the right files:
bzr status
bzr cdiff
If you want to "commit" (create a new revision)
bzr commit -m "My applet: Doing something"
If you want to "push" (upload your branch to a server)
bzr push lp:~lynx333/cairo-dock-plug-ins-extras/HDDtemperature
Please post a new comment after that ;)