{"id":76,"date":"2005-01-03T00:01:24","date_gmt":"2005-01-02T22:01:24","guid":{"rendered":""},"modified":"2005-01-03T00:01:24","modified_gmt":"2005-01-02T22:01:24","slug":"gdesklets-ltdell","status":"publish","type":"post","link":"https:\/\/nauj27.com\/blog\/?p=76","title":{"rendered":"GDesklets &#8211; LTDell"},"content":{"rendered":"<p><img loading=\"lazy\" src=\"http:\/\/nauj27.com\/images\/uploads\/ltdell.png\" border=\"0\" alt=\"image\" name=\"image\" width=\"499\" height=\"324\" \/><br \/>\nEl otro dia estaba buscando alguna forma de realzar o mejorar la usabilidad del escritorio del <a href=\"http:\/\/nauj27.com\/comments.php?id=73_0_1_0_C\" title=\"port\u00e1til\">port\u00e1til<\/a> en forma de <a href=\"http:\/\/gdesklets.gnomedesktop.org\/\" title=\"gdesklets\">gdesklets<\/a>. D\u00e1ndome una vuelta por la web encontr\u00e9 <a href=\"http:\/\/gdesklets.gnomedesktop.org\/categories.php?func=gd_show_app&#038;gd_app_id=124\" title=\"un applet\">un applet<\/a> que muestra la temperatura del procesador y la velocidad de los ventiladores.<br \/>\nComo en principio no me funcionaba, se me ocurri\u00f3 echar un vistazo al c\u00f3digo de modo que ya aproveche para hacer algunas modificaciones:<\/p>\n<p style=\"background-color: white; border: black 1px solid\">nauj27@panoramix:~\/.gdesklets\/Displays\/LTDell$ diff -Naur dell.display.orig dell.display<br \/>\n&#8212; dell.display.orig   2004-03-24 14:35:58.000000000 +0100<br \/>\n+++ dell.display        2004-12-23 00:01:50.000000000 +0100<br \/>\n@@ -23,15 +23,17 @@<br \/>\n        &lt;sensor id=\u00bbfont\u00bb module=\u00bbLTVFontSelector,CPU Temp Label Font|Sans bold 8|white|10||CPU Temp Font|Sans 8|white|999||CPU Fan Label Font|Sans bold 8|white|23||CPU Fan Speed Font|Sans 8|white|999||Case Fan Label Font|Sans bold 8|white|36||Case Fan Speed Font|Sans 8|white|999&#8243;\/&gt;<br \/>\n        &lt;sensor id=\u00bbborder\u00bb module=\u00bbLTVBorder,0,15,50,3&#8243;\/&gt;<br \/>\n        &lt;sensor id=\u00bbicon\u00bb module=\u00bbLTVCommand,gnome-system-monitor\u00bb\/&gt;<br \/>\n&#8211;       &lt;group width=\u00bb185&#8243; height=\u00bb50&#8243; bg-uri=\u00bbgfx\/bg\/none.png\u00bb watch=\u00bbheight=border:height, bg-uri=border:background\u00bb\/&gt;<br \/>\n+       &lt;sensor id=\u00bbbfan0&#8243; module=\u00bbLTVCommand,\/home\/nauj27\/bin\/fan0.sh\u00bb\/&gt;<br \/>\n+       &lt;sensor id=\u00bbbfan1&#8243; module=\u00bbLTVCommand,\/home\/nauj27\/bin\/fan1.sh\u00bb\/&gt;<br \/>\n+       &lt;group width=\u00bb200&#8243; height=\u00bb50&#8243; bg-uri=\u00bbgfx\/bg\/none.png\u00bb watch=\u00bbheight=border:height, bg-uri=border:background\u00bb\/&gt;<br \/>\n        &lt;group watch=\u00bby=border:top\u00bb&gt;<br \/>\n                &lt;label id=\u00bblbl0&#8243; x=\u00bb60&#8243; watch=\u00bbfont=font:font0, y=font:offset0, color=font:color0&#8243; value=\u00bbCPU: \u00ab\/&gt;<br \/>\n                &lt;label id=\u00bbtemp\u00bb x=\u00bb140&#8243; anchor=\u00bbne\u00bb watch=\u00bbvalue=temp:value, font=font:font1, y=font:offset0, color=font:color1&#8243; \/&gt;<br \/>\n&#8211;               &lt;label x=\u00bb145&#8243; anchor=\u00bbnw\u00bb watch=\u00bb font=font:font1, y=font:offset0, color=font:color1&#8243; value=\u00bb\u00b0C\u00bb\/&gt;<br \/>\n&#8211;               &lt;label id=\u00bblbl1&#8243; x=\u00bb60&#8243; watch=\u00bbfont=font:font2, y=font:offset2, color=font:color2&#8243; value=\u00bbFAN0: \u00ab\/&gt;<br \/>\n+               &lt;label x=\u00bb145&#8243; anchor=\u00bbnw\u00bb watch=\u00bb font=font:font1, y=font:offset0, color=font:color1&#8243; value=\u00bbC\u00bb\/&gt;<br \/>\n+               &lt;label id=\u00bblbl1&#8243; x=\u00bb60&#8243; watch=\u00bbfont=font:font2, y=font:offset2, color=font:color2&#8243; value=\u00bbFAN0: \u00bb on-doubleclick=\u00bbbfan0:launch\u00bb\/&gt;<br \/>\n                &lt;label id=\u00bbspeed0&#8243; x=\u00bb140&#8243; anchor=\u00bbne\u00bb watch=\u00bbvalue=fan0:value, font=font:font3, y=font:offset2, color=font:color3&#8243; \/&gt;<br \/>\n                &lt;label x=\u00bb145&#8243; anchor=\u00bbnw\u00bb watch=\u00bb font=font:font3, y=font:offset2, color=font:color3&#8243; value=\u00bbRPM\u00bb\/&gt;<br \/>\n&#8211;               &lt;label id=\u00bblbl2&#8243; x=\u00bb60&#8243; watch=\u00bbfont=font:font4, y=font:offset4, color=font:color4&#8243; value=\u00bbFAN1: \u00ab\/&gt;<br \/>\n+               &lt;label id=\u00bblbl2&#8243; x=\u00bb60&#8243; watch=\u00bbfont=font:font4, y=font:offset4, color=font:color4&#8243; value=\u00bbFAN1: \u00bb on-doubleclick=\u00bbbfan1:launch\u00bb\/&gt;<br \/>\n                &lt;label id=\u00bbspeed1&#8243; x=\u00bb140&#8243; anchor=\u00bbne\u00bb watch=\u00bbvalue=fan1:value, font=font:font5, y=font:offset4, color=font:color5&#8243; \/&gt;<br \/>\n                &lt;label x=\u00bb145&#8243; anchor=\u00bbnw\u00bb watch=\u00bb font=font:font5, y=font:offset4, color=font:color5&#8243; value=\u00bbRPM\u00bb\/&gt;<br \/>\n                &lt;image x=\u00bb10&#8243; y=\u00bb5&#8243; uri=\u00bbgfx\/dell-temp.png\u00bb on-doubleclick=\u00bbicon:launch\u00bb \/&gt;<\/p>\n<p>De esta manera se a\u00f1aden dos m\u00f3dulos de LTVCommand para las etiquetas de los ventiladores y los eventos correspondientes. Los guiones en sh son tan simples como pone a continuaci\u00f3n, haciendo uso de <a href=\"http:\/\/people.debian.org\/~dz\/i8k\/\" title=\"i8kutils\">i8kutils<\/a>.<\/p>\n<p  style=\"background-color: white; border: black 1px solid\"><b>fan0.sh<\/b><br \/>\n#!\/bin\/bash<\/p>\n<p>ESTADO=`i8kfan | awk &#8216;{ print $1 }&#8217;`<\/p>\n<p>if [ $ESTADO -eq 0 ]; then<br \/>\n        i8kfan 1 &#8211;<br \/>\nelif [ $ESTADO -eq 1 ]; then<br \/>\n        i8kfan 2 &#8211;<br \/>\nelse<br \/>\n        i8kfan 0 &#8211;<br \/>\nfi<\/p>\n<p  style=\"background-color: white; border: black 1px solid\"><b>fan1.sh<\/b><br \/>\n#!\/bin\/bash<\/p>\n<p>ESTADO=`i8kfan | awk &#8216;{ print $2 }&#8217;`<\/p>\n<p>if [ $ESTADO -eq 0 ]; then<br \/>\n        i8kfan &#8211; 1<br \/>\nelif [ $ESTADO -eq 1 ]; then<br \/>\n        i8kfan &#8211; 2<br \/>\nelse<br \/>\n        i8kfan &#8211; 0<br \/>\nfi<\/p>\n<p>Ahora puedo monitorizar la temperatura de la CPU y activar o desactivar cada uno de los dos ventiladores a mi antojo, aunque es puro capricho ya que el kernel se encarga de esto autom\u00e1gicamente ;-)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hack del LTDell<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/nauj27.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/76"}],"collection":[{"href":"https:\/\/nauj27.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nauj27.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nauj27.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nauj27.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76"}],"version-history":[{"count":0,"href":"https:\/\/nauj27.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/76\/revisions"}],"wp:attachment":[{"href":"https:\/\/nauj27.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nauj27.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nauj27.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}