Created
April 27, 2016 20:36
-
-
Save biggles5107/a276297adcf151ef8f07fd7ced7c73d4 to your computer and use it in GitHub Desktop.
Script for CommandRunner applet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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