diff options
author | David <dbphillipsnz@gmail.com> | 2014-05-02 11:42:13 +1200 |
---|---|---|
committer | David <dbphillipsnz@gmail.com> | 2014-05-02 11:42:13 +1200 |
commit | b5d850670d406da072db4b5f77f76c1860aa4734 (patch) | |
tree | 3cd5ae35cc08c76f8fa56cc43eb5ee04dc60fc7a /trayfreq_set | |
parent | cfcf72f4173d37c4d4fd0d1d5802b3d689501424 (diff) | |
parent | 4bb267e8e416c95fddc59d3c954afc37d9a3f67a (diff) | |
download | paramano-b5d850670d406da072db4b5f77f76c1860aa4734.tar.xz |
Merge branch 'sudo-fix'
Diffstat (limited to 'trayfreq_set')
-rw-r--r-- | trayfreq_set/trayfreq_set_interface.c | 15 | ||||
-rw-r--r-- | trayfreq_set/trayfreq_set_interface.h | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/trayfreq_set/trayfreq_set_interface.c b/trayfreq_set/trayfreq_set_interface.c index 490d50c..3e26112 100644 --- a/trayfreq_set/trayfreq_set_interface.c +++ b/trayfreq_set/trayfreq_set_interface.c @@ -18,20 +18,29 @@ #include "trayfreq_set_interface.h" -#include <gtk/gtk.h> #include <stdio.h> #include <stdlib.h> void si_gov(char* gov, int core) { char cmd[256]; - sprintf(cmd, "/usr/bin/trayfreq-set -g %s -c %i",gov,core); + if (_DEFAULT_USE_SUDO) + { + sprintf(cmd, "sudo trayfreq-set -g %s -c %i",gov,core); + } else { + sprintf(cmd, "trayfreq-set -g %s -c %i",gov,core); + } system(cmd); } void si_freq(int freq, int core) { char cmd[256]; - sprintf(cmd, "/usr/bin/trayfreq-set -f %i -c %i",freq,core); + if (_DEFAULT_USE_SUDO) + { + sprintf(cmd, "sudo trayfreq-set -f %i -c %i",freq,core); + } else { + sprintf(cmd, "trayfreq-set -f %i -c %i",freq,core); + } system(cmd); } diff --git a/trayfreq_set/trayfreq_set_interface.h b/trayfreq_set/trayfreq_set_interface.h index bdbf652..c5681e4 100644 --- a/trayfreq_set/trayfreq_set_interface.h +++ b/trayfreq_set/trayfreq_set_interface.h @@ -19,6 +19,8 @@ #ifndef TRAYFREQ_SET_INTERFACE_H #define TRAYFREQ_SET_INTERFACE_H +#include "../defaults.h" + void si_gov(char* gov, int core); void si_freq(int freq, int core); |