daily pastebin goal
71%
SHARE
TWEET

xfce genmon governor switcher

a guest Dec 19th, 2014 207 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. >>>notifiers/perf/_xfce4-genmon-plugin.txt :
  2. /* If the command starts with ~ expand it */
  3. /* If the command fails, display XXX */
  4.  
  5. /* Test if the result is an Image or a Text */
  6. <img>path to image</img>
  7.  
  8.         /* Test if the result has a clickable Image (button) */
  9.         <click>path to command</click>
  10.  
  11. /* Test if the result is a Text */
  12. <txt> text </txt>
  13.  
  14. /* Test if the result is a Bar */
  15. <bar>0-100</bar>
  16.  
  17. /* Test if a ToolTip is given */
  18. <tool>tooltip</tool>
  19.  
  20.  
  21.  
  22. >>>notifiers/perf/check :
  23. #!/bin/bash
  24.  
  25. xpath=/home/user/notifiers/perf
  26. #ipath=/home/user/.icons/AwOken/extra/cpufreq-applet
  27. ipath=${xpath}
  28. ko=${ipath}/cpufreq-100.png
  29. ok=${ipath}/cpufreq-50.png
  30.  
  31. # get current governor
  32. # old cpufreq
  33. #g_cur="$(cpufreq-info -p | awk '{print $3}' | xargs echo -n)"
  34.  
  35. g_cur="$(cpupower -c 0 frequency-info -p | tail -n1 | awk '{print $3}' | xargs echo -n)"
  36.  
  37. if [ "conservative" == "${g_cur}" ]; then
  38.     echo "<tool>"${g_cur}"</tool><img>"${ok}"</img><click>"${xpath}"/set-performance</click>"
  39. else
  40.     echo "<tool>"${g_cur}"</tool><img>"${ko}"</img><click>"${xpath}"/set-conservative</click>"
  41. fi
  42.  
  43.  
  44.  
  45. >>>notifiers/perf/set-conservative :
  46. #!/bin/bash
  47. sudo cpupower -c all frequency-set -g conservative
  48.  
  49. # old cpufreq
  50. #for c in {0..2};do
  51. #    sudo cpufreq-set -c$c -g conservative
  52. #done
  53.  
  54.  
  55.  
  56. >>>notifiers/perf/set-performance :
  57. #!/bin/bash
  58. sudo cpupower -c all frequency-set -g performance
  59.  
  60. # old cpufreq
  61. #for c in {0..2};do
  62. #    sudo cpufreq-set -c$c -g performance
  63. #done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top