Merge lp:~lynx333/cairo-dock-plug-ins-extras/HDDtemperature into lp:~cairo-dock-team/cairo-dock-plug-ins-extras/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
Reviewer Review Type Date Requested Status
Matthieu Baerts Approve
Review via email: mp+75489@code.launchpad.net

Description of the change

This applet implements HDD temperature monitoring

To post a comment you must log in.
Revision history for this message
Matthieu Baerts (matttbe) wrote :

Hello Reali$t and thank you for this merge proposal!

But... there is no change between your branch and the main branch :)
Don't hesitate to have a look to this wiki page: http://www.glx-dock.org/ww_page.php?p=Help%20us%20with%20BZR&lang=en#8-The%20use%20of%20bazaar

So if you want to add a file or directory, launch this command:
  cd cairo-dock-plug-ins-extras
  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 ;)

review: Needs Fixing
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://bazaar.launchpad.net/~lynx333/cairo-dock-plug-ins-extras/HDDtemperature/files/head:/HDDtemperature/

Regards

Revision history for this message
Matthieu Baerts (matttbe) wrote :

Thank you for sharing this new applet ;)

review: Approve
201. By Reali$t

HDDtemp: 'no refresh' bug fixed

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

Subscribers

People subscribed via source and target branches

to all changes: