aboutsummaryrefslogtreecommitdiff
path: root/trayfreq_set
diff options
context:
space:
mode:
authorDavid <dbphillipsnz@gmail.com>2014-04-27 14:24:39 +1200
committerDavid <dbphillipsnz@gmail.com>2014-04-27 14:24:39 +1200
commitc1203952f64c61b2451dc9107810ba450c3ea675 (patch)
tree65d097fd47c1516d38a0a181626de5864719f977 /trayfreq_set
parent7d4d27d341717cc51653fb7646aa49c2cb7dc657 (diff)
downloadparamano-c1203952f64c61b2451dc9107810ba450c3ea675.tar.xz
Added sudo to cmd line for trayfreq-set
Diffstat (limited to 'trayfreq_set')
-rw-r--r--trayfreq_set/trayfreq_set_interface.c19
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
+}