aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaOS-FreeBSD.cpp
diff options
context:
space:
mode:
authormike-pt <miguelmclara@gmail.com>2015-11-26 02:14:52 +0000
committermike-pt <miguelmclara@gmail.com>2015-11-26 02:14:52 +0000
commit2de21f829795fca1b54309b4a3a4d4d6a52ce5aa (patch)
tree89f1808db2ca666c58dc4e97620a69707d81d258 /libLumina/LuminaOS-FreeBSD.cpp
parentUpdate LuminaX11.cpp to compile with GCC (found/fixed by Jesse Smith). (diff)
downloadlumina-2de21f829795fca1b54309b4a3a4d4d6a52ce5aa.tar.gz
lumina-2de21f829795fca1b54309b4a3a4d4d6a52ce5aa.tar.bz2
lumina-2de21f829795fca1b54309b4a3a4d4d6a52ce5aa.zip
- Add support for intel_backlight on FreeBSD
Diffstat (limited to 'libLumina/LuminaOS-FreeBSD.cpp')
-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