aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-11-26 08:11:51 -0500
committerKen Moore <moorekou@gmail.com>2015-11-26 08:11:51 -0500
commit71ee9e674ac851d3387a38180fa145c019f87316 (patch)
tree89f1808db2ca666c58dc4e97620a69707d81d258
parentUpdate LuminaX11.cpp to compile with GCC (found/fixed by Jesse Smith). (diff)
parent- Add support for intel_backlight on FreeBSD (diff)
downloadlumina-71ee9e674ac851d3387a38180fa145c019f87316.tar.gz
lumina-71ee9e674ac851d3387a38180fa145c019f87316.tar.bz2
lumina-71ee9e674ac851d3387a38180fa145c019f87316.zip
Merge pull request #167 from mike-pt/master
- Add support for intel_backlight on FreeBSD
-rw-r--r--libLumina/LuminaOS-FreeBSD.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp
index b5e92e07..2d19970f 100644
--- a/libLumina/LuminaOS-FreeBSD.cpp
+++ b/libLumina/LuminaOS-FreeBSD.cpp
@@ -82,8 +82,17 @@ void LOS::setScreenBrightness(int percent){
else if(percent>100){ percent=100; }
//Run the command(s)
bool success = false;
- // - try hardware setting first (PC-BSD only)
- if(QFile::exists("/usr/local/bin/pc-sysconfig")){
+ // - try hardware setting first (PC-BSD || or intel_backlight)
+ if(QFile::exists("/usr/local/bin/intel_backlight")){
+ qDebug() << "/usr/local/bin/intel_backlight" << "was found!";
+ QString ret = LUtils::getCmdOutput("intel_backlight", QStringList() <<QString::number(percent)
+).join("");
+ success = ret.toLower().contains("set backlight to");
+ qDebug() << "Set hardware brightness:" << percent << success;
+ // Check if percentage = intel_backlight
+ qDebug() << "intel_backlight:" << LUtils::getCmdOutput("intel_backlight");
+ }
+ else if((QFile::exists("/usr/local/bin/pc-sysconfig")) && (!QFile::exists("/usr/local/bin/intel_backlight"))){
QString ret = LUtils::getCmdOutput("pc-sysconfig", QStringList() <<"setscreenbrightness "+QString::number(percent)).join("");
success = ret.toLower().contains("success");
qDebug() << "Set hardware brightness:" << percent << success;
bgstack15