mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-22 18:03:28 +02:00
brightness: handle the case where xbacklight doesn't work
This happens with modesettings...
This commit is contained in:
parent
f3f3754336
commit
04d9fb8da6
1 changed files with 2 additions and 2 deletions
|
@ -5,6 +5,7 @@ local naughty = require("naughty")
|
||||||
local tonumber = tonumber
|
local tonumber = tonumber
|
||||||
local string = string
|
local string = string
|
||||||
local os = os
|
local os = os
|
||||||
|
local dbg = dbg
|
||||||
|
|
||||||
-- A bit odd, but...
|
-- A bit odd, but...
|
||||||
require("lib/icons")
|
require("lib/icons")
|
||||||
|
@ -16,8 +17,7 @@ local nid = nil
|
||||||
local function change(what)
|
local function change(what)
|
||||||
os.execute("xbacklight -" .. what)
|
os.execute("xbacklight -" .. what)
|
||||||
local out = awful.util.pread("xbacklight -get")
|
local out = awful.util.pread("xbacklight -get")
|
||||||
if not out then return end
|
if not out or out == "" then return end
|
||||||
|
|
||||||
out = tonumber(out)
|
out = tonumber(out)
|
||||||
local icon = icons.lookup({name = "display-brightness",
|
local icon = icons.lookup({name = "display-brightness",
|
||||||
type = "status"})
|
type = "status"})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue