Openbox:Pipemenus:battery

From Openbox

(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
<nowiki>Battery=$(acpi -b | grep "Battery" | sed -nr '/Battery/s/.*(\<[[:digit:]]+%).*/\1/p')
+
<pre>Battery=$(acpi -b | grep "Battery" | sed -nr '/Battery/s/.*(\<[[:digit:]]+%).*/\1/p')
 
Thermal=$(acpi -t | grep "Thermal" | sed -nr "s/.*(\<[[:digit:]]+\.[[:digit:]]) degrees.*/\1°C/p" )
 
Thermal=$(acpi -t | grep "Thermal" | sed -nr "s/.*(\<[[:digit:]]+\.[[:digit:]]) degrees.*/\1°C/p" )
 
echo "<openbox_pipe_menu>"
 
echo "<openbox_pipe_menu>"
Line 6: Line 6:
  
 
echo "</openbox_pipe_menu>"
 
echo "</openbox_pipe_menu>"
</nowiki>
+
</pre>

Latest revision as of 15:57, 20 February 2009

Battery=$(acpi -b | grep "Battery" | sed -nr '/Battery/s/.*(\<[[:digit:]]+%).*/\1/p')
Thermal=$(acpi -t | grep "Thermal" | sed -nr "s/.*(\<[[:digit:]]+\.[[:digit:]]) degrees.*/\1°C/p" )
echo "<openbox_pipe_menu>"
echo "<item label=\"Battery: $Battery\"/>"
echo "<item label=\"Temperature: $Thermal\"/>"

echo "</openbox_pipe_menu>"
Personal tools