aboutsummaryrefslogtreecommitdiff
path: root/trayfreq_set
diff options
context:
space:
mode:
authorDavid <dbphillipsnz@gmail.com>2014-05-02 11:22:22 +1200
committerDavid <dbphillipsnz@gmail.com>2014-06-06 20:28:46 +1200
commit8913f121822af36e9e099c1b2d8e64f7dab0d863 (patch)
tree843457828d319e26a12a58eae5e47b113dfc4813 /trayfreq_set
parentfe07b9907dbc5191e7a78c2dde7f5bbed4cfacfa (diff)
downloadparamano-8913f121822af36e9e099c1b2d8e64f7dab0d863.tar.xz
Done
Diffstat (limited to 'trayfreq_set')
-rw-r--r--trayfreq_set/trayfreq_set_interface.c15
-rw-r--r--trayfreq_set/trayfreq_set_interface.h2
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);