aboutsummaryrefslogtreecommitdiff
path: root/libLumina
diff options
context:
space:
mode:
Diffstat (limited to 'libLumina')
-rw-r--r--libLumina/LuminaOS-Linux.cpp10
-rw-r--r--libLumina/libLumina.pro20
2 files changed, 19 insertions, 11 deletions
diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp
index bdd16fac..acece864 100644
--- a/libLumina/LuminaOS-Linux.cpp
+++ b/libLumina/LuminaOS-Linux.cpp
@@ -20,7 +20,7 @@ QString LOS::SysPrefix(){ return "/usr/"; } //Prefix for system
//OS-specific application shortcuts (*.desktop files)
QString LOS::ControlPanelShortcut(){ return ""; } //system control panel
QString LOS::AppStoreShortcut(){ return ""; } //graphical app/pkg manager
-QString LOS::QtConfigShortcut(){ return "/usr/bin/qtconfig-qt4"; } //qtconfig binary (NOT *.desktop file)
+QString LOS::QtConfigShortcut(){ return LOS::AppPrefix() + "/bin/qtconfig-qt4"; } //qtconfig binary (NOT *.desktop file)
// ==== ExternalDevicePaths() ====
QStringList LOS::ExternalDevicePaths(){
@@ -122,12 +122,12 @@ void LOS::changeAudioVolume(int percentdiff){
//Check if a graphical audio mixer is installed
bool LOS::hasMixerUtility(){
- return QFile::exists("/usr/bin/pavucontrol");
+ return QFile::exists(LOS::AppPrefix() + "bin/pavucontrol");
}
//Launch the graphical audio mixer utility
void LOS::startMixerUtility(){
- QProcess::startDetached("/usr/bin/pavucontrol");
+ QProcess::startDetached(LOS::AppPrefix() + "bin/pavucontrol");
}
//Check for user system permission (shutdown/restart)
@@ -150,7 +150,7 @@ bool LOS::hasBattery(){
QString my_status = LUtils::getCmdOutput("acpi -b").join("");
bool no_battery = my_status.contains("No support");
if (no_battery) return false;
- return true;
+ return true;
}
//Battery Charge Level
@@ -173,7 +173,7 @@ int LOS::batteryCharge(){ //Returns: percent charge (0-100), anything outside th
// these include "Unknown, Full and No support.
// However, it seems just one status is returned when running
// on battery and that is "Discharging". So if the value we get
-// is NOT Discharging then we assume the batter yis charging.
+// is NOT Discharging then we assume the battery is charging.
bool LOS::batteryIsCharging(){
QString my_status = LUtils::getCmdOutput("acpi -b").join("");
bool discharging = my_status.contains("Discharging");
diff --git a/libLumina/libLumina.pro b/libLumina/libLumina.pro
index 45a310b7..72fa6f6c 100644
--- a/libLumina/libLumina.pro
+++ b/libLumina/libLumina.pro
@@ -2,7 +2,15 @@
QT += core
TARGET=LuminaUtils
-target.path = /usr/local/lib
+
+isEmpty(PREFIX) {
+ PREFIX = /usr/local
+}
+
+isEmpty(LIBPREFIX) {
+ LIBPREFIX = $$PREFIX/lib
+}
+target.path = $$LIBPREFIX
DESTDIR= $$_PRO_FILE_PWD_/
@@ -17,7 +25,7 @@ HEADERS += LuminaXDG.h \
SOURCES += LuminaXDG.cpp \
LuminaUtils.cpp \
- LuminaX11.cpp \
+ LuminaX11.cpp \
LuminaOS-FreeBSD.cpp \
LuminaOS-DragonFly.cpp \
LuminaOS-OpenBSD.cpp \
@@ -25,16 +33,16 @@ SOURCES += LuminaXDG.cpp \
LuminaOS-kFreeBSD.cpp
# new OS support can be added here
-INCLUDEPATH += /usr/local/include
+INCLUDEPATH += $$PREFIX/include
LIBS += -lX11 -lXrender -lXcomposite
-include.path=/usr/local/include/
+include.path=$$PREFIX/include/
include.files=LuminaXDG.h \
LuminaUtils.h \
LuminaX11.h \
LuminaOS.h
-INSTALLS += target include
+INSTALLS += target include
-QMAKE_LIBDIR = /usr/local/lib/qt4 /usr/local/lib
+QMAKE_LIBDIR = $$LIBPREFIX/qt4 $$LIBPREFIX
bgstack15