Skip to content

Instantly share code, notes, and snippets.

@biggles5107
Created April 27, 2016 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biggles5107/a276297adcf151ef8f07fd7ced7c73d4 to your computer and use it in GitHub Desktop.
Save biggles5107/a276297adcf151ef8f07fd7ced7c73d4 to your computer and use it in GitHub Desktop.
Script for CommandRunner applet
#!/bin/bash
# get dem informations
CPU_TEMP=`sensors|grep temp3|cut -c16-17`°C
CPU_FREQ=`cpupower frequency-info|grep 'current CPU'|grep GHz|cut -c26-33`
GPU_TEMP=`nvidia-smi|egrep '[[:digit:]][[:digit:]]C'|cut -c9-10`°C
# generate our cool XML file
cat <<EOF
<xml>
<appsettings>
<tooltip>sensors info</tooltip>
<clickaction>gnome-terminal -e 'watch -n 1 sensors'</clickaction>
</appsettings>
<item>
<type>box</type>
<attr>
<style>padding: 2px;</style>
<vertical>1</vertical>
</attr>
<item>
<type>text</type>
<value>CPU</value>
<attr>
<style>font-size: 5pt;</style>
</attr>
</item>
<item>
<type>text</type>
<value>${CPU_TEMP}</value>
<attr>
<style>font-size: 8pt;</style>
</attr>
</item>
</item>
<item>
<type>box</type>
<attr>
<style>padding: 2px;</style>
<vertical>1</vertical>
</attr>
<item>
<type>text</type>
<value>CPU_FREQ</value>
<attr>
<style>font-size: 5pt;</style>
</attr>
</item>
<item>
<type>text</type>
<value>${CPU_FREQ}</value>
<attr>
<style>font-size: 8pt;</style>
</attr>
</item>
</item>
<item>
<type>box</type>
<attr>
<style>padding: 2px;</style>
<vertical>1</vertical>
</attr>
<item>
<type>text</type>
<value>GPU</value>
<attr>
<style>font-size: 5pt;</style>
</attr>
</item>
<item>
<type>text</type>
<value>${GPU_TEMP}</value>
<attr>
<style>font-size: 8pt;</style>
</attr>
</item>
</item>
</xml>
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment