aboutsummaryrefslogtreecommitdiff
path: root/trayfreq_set
diff options
context:
space:
mode:
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);