From 04d9fb8da6daf1d66db432c22b8aa02dad12741e Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 16 Mar 2016 15:49:22 +0100 Subject: [PATCH] brightness: handle the case where xbacklight doesn't work This happens with modesettings... --- lib/brightness.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/brightness.lua b/lib/brightness.lua index d990e10..f025574 100644 --- a/lib/brightness.lua +++ b/lib/brightness.lua @@ -5,6 +5,7 @@ local naughty = require("naughty") local tonumber = tonumber local string = string local os = os +local dbg = dbg -- A bit odd, but... require("lib/icons") @@ -16,8 +17,7 @@ local nid = nil local function change(what) os.execute("xbacklight -" .. what) local out = awful.util.pread("xbacklight -get") - if not out then return end - + if not out or out == "" then return end out = tonumber(out) local icon = icons.lookup({name = "display-brightness", type = "status"})