diff options
author | David <dbphillipsnz@gmail.com> | 2014-04-27 14:24:39 +1200 |
---|---|---|
committer | David <dbphillipsnz@gmail.com> | 2014-04-27 14:24:39 +1200 |
commit | c1203952f64c61b2451dc9107810ba450c3ea675 (patch) | |
tree | 65d097fd47c1516d38a0a181626de5864719f977 /trayfreq_set | |
parent | 7d4d27d341717cc51653fb7646aa49c2cb7dc657 (diff) | |
download | paramano-c1203952f64c61b2451dc9107810ba450c3ea675.tar.xz |
Added sudo to cmd line for trayfreq-set
Diffstat (limited to 'trayfreq_set')
-rw-r--r-- | trayfreq_set/trayfreq_set_interface.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/trayfreq_set/trayfreq_set_interface.c b/trayfreq_set/trayfreq_set_interface.c index 040513a..6dc6b14 100644 --- a/trayfreq_set/trayfreq_set_interface.c +++ b/trayfreq_set/trayfreq_set_interface.c @@ -24,23 +24,14 @@ void si_gov(char* gov, int core) { - char corestr[4]; - sprintf(corestr, "%i", core); - - char* cmd = g_strconcat("/usr/bin/trayfreq-set -g ", gov, " -c ", corestr, NULL); + char cmd[256]; + sprintf(cmd, "/usr/bin/sudo trayfreq-set -g %s -c %i",gov,core); system(cmd); - g_free(cmd); } void si_freq(int freq, int core) { - char corestr[4]; - char freqstr[13]; - - sprintf(corestr, "%i", core); - sprintf(freqstr, "%i", freq); - - char* cmd = g_strconcat("/usr/bin/trayfreq-set -f ", freqstr, " -c ", corestr, NULL); + char cmd[256]; + sprintf(cmd, "/usr/bin/sudo trayfreq-set -f %i -c %i",freq,core); system(cmd); - g_free(cmd); -}
\ No newline at end of file +} |