aboutsummaryrefslogtreecommitdiff
path: root/libLumina
diff options
context:
space:
mode:
Diffstat (limited to 'libLumina')
-rw-r--r--libLumina/LuminaOS-FreeBSD.cpp6
-rw-r--r--libLumina/LuminaOS-Linux.cpp6
-rw-r--r--libLumina/LuminaOS.h1
3 files changed, 7 insertions, 6 deletions
diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp
index 39a82c09..a3dcb91e 100644
--- a/libLumina/LuminaOS-FreeBSD.cpp
+++ b/libLumina/LuminaOS-FreeBSD.cpp
@@ -42,8 +42,8 @@ QStringList LOS::ExternalDevicePaths(){
int LOS::ScreenBrightness(){
//Returns: Screen Brightness as a percentage (0-100, with -1 for errors)
if(screenbrightness==-1){
- if(QFile::exists("/tmp/.lumina-currentxbrightness")){
- int val = LUtils::readFile("/tmp/.lumina-currentxbrightness").join("").simplified().toInt();
+ if(QFile::exists(QDir::homePath()+"/.lumina/.currentxbrightness")){
+ int val = LUtils::readFile(QDir::homePath()+"/.lumina/.currentxbrightness").join("").simplified().toInt();
screenbrightness = val;
}
}
@@ -63,7 +63,7 @@ void LOS::setScreenBrightness(int percent){
//Save the result for later
if(ret!=0){ screenbrightness = -1; }
else{ screenbrightness = percent; }
- LUtils::writeFile("/tmp/.lumina-currentxbrightness", QStringList() << QString::number(screenbrightness), true);
+ LUtils::writeFile(QDir::homePath()+"/.lumina/.currentxbrightness", QStringList() << QString::number(screenbrightness), true);
}
//Read the current volume
diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp
index 60fb35fe..db1d71bd 100644
--- a/libLumina/LuminaOS-Linux.cpp
+++ b/libLumina/LuminaOS-Linux.cpp
@@ -26,8 +26,8 @@ QStringList LOS::ExternalDevicePaths(){
int LOS::ScreenBrightness(){
//Returns: Screen Brightness as a percentage (0-100, with -1 for errors)
if(screenbrightness==-1){
- if(QFile::exists("/tmp/.lumina-currentxbrightness")){
- int val = LUtils::readFile("/tmp/.lumina-currentxbrightness").join("").simplified().toInt();
+ if(QFile::exists(QDir::homePath()+"/.lumina/.currentxbrightness")){
+ int val = LUtils::readFile(QDir::homePath()+"/.lumina/.currentxbrightness").join("").simplified().toInt();
screenbrightness = val;
}
}
@@ -49,7 +49,7 @@ void LOS::setScreenBrightness(int percent){
//Save the result for later
if(ret!=0){ screenbrightness = -1; }
else{ screenbrightness = percent; }
- LUtils::writeFile("/tmp/.lumina-currentxbrightness", QStringList() << QString::number(screenbrightness), true);
+ LUtils::writeFile(QDir::homePath()+"/.lumina/.currentxbrightness", QStringList() << QString::number(screenbrightness), true);
}
diff --git a/libLumina/LuminaOS.h b/libLumina/LuminaOS.h
index 3a76b429..a091a25e 100644
--- a/libLumina/LuminaOS.h
+++ b/libLumina/LuminaOS.h
@@ -15,6 +15,7 @@
#include <QString>
#include <QStringList>
#include <QProcess>
+#include <QDir>
#include "LuminaUtils.h"
bgstack15