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-05-02 11:22:22 +1200
commit91b78cb1f60430a9f2e87c27af26c883f95de754 (patch)
tree23814bc764a8a1fa5d910974c5b6b3639411e5bd /trayfreq_set
parent139ee2e0ef4eb42fe0f17e7bf1bfedd7812d27a5 (diff)
downloadparamano-91b78cb1f60430a9f2e87c27af26c883f95de754.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);