diff --git a/share/jive/applets/BlankScreen/BlankScreenApplet.lua b/share/jive/applets/BlankScreen/BlankScreenApplet.lua index 4fd3d35..9e66324 100644 --- a/share/jive/applets/BlankScreen/BlankScreenApplet.lua +++ b/share/jive/applets/BlankScreen/BlankScreenApplet.lua @@ -41,7 +41,14 @@ oo.class(_M, Applet) function closeScreensaver(self) - -- nothing to do here, brightness is refreshed via window event handler in init() + -- Only wake up screen if screensaver has been disabled. + -- Note : Stops some events waking up the screen eg control from web interface + if appletManager:callService("isScreensaverActive") then + self:_setBrightness("off") + else + self:_setBrightness("on") + end + end function openScreensaver(self, menuItem) @@ -122,6 +129,38 @@ end function _setBrightness(self, brightness) appletManager:callService("setBrightness", brightness) + if (brightness == "off") then + appletManager:callService("jogglerBacklight","disableAuto") + local startT + local transitionDuration = 2000 + local animationCount = 0 + local maxBrightness = 100 + local minBrightness = 0 + local discreteBrightnessLevels = maxBrightness - minBrightness + local timePerLevel = transitionDuration / discreteBrightnessLevels + local currentBrightness = appletManager:callService("jogglerBacklight","get") + currentBrightness = currentBrightness or 0 + while ((currentBrightness) > minBrightness) do + if animationCount == 0 then + --getting start time on first loop avoids initial delay that can occur + startT = Framework:getTicks() + end + + local elapsed = Framework:getTicks() - startT + remaining = timePerLevel - elapsed + animationCount = animationCount + 1 + + if remaining <= 0 then + animationCount = 0 + currentBrightness = currentBrightness - 1 + appletManager:callService("jogglerBacklight","quickSet",currentBrightness) + end + + end + appletManager:callService("jogglerBacklight","enablePowerSaving",1) + elseif (brightness == "on") then -- brightness on + appletManager:callService("jogglerBacklight","reset") + end end --[[ diff --git a/share/jive/applets/JogglerBacklight/JogglerBacklightApplet.lua b/share/jive/applets/JogglerBacklight/JogglerBacklightApplet.lua index e6ce023..fc87e73 100644 --- a/share/jive/applets/JogglerBacklight/JogglerBacklightApplet.lua +++ b/share/jive/applets/JogglerBacklight/JogglerBacklightApplet.lua @@ -16,9 +16,13 @@ This applet adjusts the backlight level on an O2 Joggler. -- stuff we use local ipairs, pairs, tostring, tonumber = ipairs, pairs, tostring, tonumber +local type = type +local string = string local os = require("os") local oo = require("loop.simple") +local io = require("io") +local math = require("math") local Applet = require("jive.Applet") local Timer = require("jive.ui.Timer") @@ -34,16 +38,145 @@ local string = require("string") local table = require("jive.utils.table") local debug = require("jive.utils.debug") local Player = require("jive.slim.Player") - local appletManager = appletManager +local debug = require("jive.utils.debug") + local jnt = jnt local jiveMain = jiveMain - module(..., Framework.constants) oo.class(_M, Applet) +--map "service name" -> function +local serviceMap = { } + +--JogglerBacklight service handler +function jogglerBacklight(self,service, ...) + log:debug("jogglerBacklight service handler") + if service == "init" then + initJogglerBacklight(self,...) + else + for i,j in pairs(serviceMap) do + if i == service then + return j(self,...) + end + end + end + +end + +function initJogglerBacklight(self,...) + log:debug("JogglerBacklight init") + initJogglerBacklightServiceMap() + os.execute("sqp_JogglerBacklight.sh 888") + if self:getSettings() and self:getSettings()["backlight"] then + resetJogglerBacklight(self) + end +end + +function initJogglerBacklightServiceMap() + serviceMap = { + getStored = getStoredJogglerBacklight, + set = setJogglerBacklight, + reset = resetJogglerBacklight, + enablePowerSaving = enablePowerSaveJogglerBacklight, + disablePowerSaving = disablePowerSaveJogglerBacklight, + isStandby = isStandbyJogglerBacklight, + get = getJogglerBacklight, + disableAuto = disableAutoJogglerBacklight, + quickSet = quickSetJogglerBacklight, + } +end +-- @param store true to persist setting, otherwise false +-- @param wait true to wait for return, otherwise false +function setJogglerBacklight(self,value,store,wait) + local cmd + if wait then + cmd = string.format("sqp_JogglerBacklight.sh %d", value) + else + cmd = string.format("sqp_JogglerBacklight.sh %d &", value) + end + log:debug(cmd) + os.execute(cmd) + if store then + self:getSettings()["backlight"] = value + self:storeSettings() + end +end + +function quickSetJogglerBacklight(self,value) + local backlight, native = getJogglerBacklightPath() + --log:debug("setting backlight as: " .. value or 0) + if not native then + value = math.floor(value / 3) + end + log:debug("echo " .. value .. " > " .. backlight) + os.execute("echo " .. value .. " > " .. backlight) +end + +function disableAutoJogglerBacklight(self) + local level = getJogglerBacklight(self) or 0 + setJogglerBacklight(self,level,false,true) +end + +function getJogglerBacklightPath() + local backlight = "/sys/class/backlight/openframe-bl/brightness" + local native = false + --FIXME: crude file exists test + if (os.execute("cat /proc/blctrl > /dev/null 2>&1") == 0) then + backlight = "/proc/blctrl" + native = true + end + return backlight, native +end + +function getStoredJogglerBacklight(self) + log:debug("in function getStored") + local rtn = self:getSettings()["backlight"] + log:debug("returning " .. rtn or "nil") + return rtn +end + +function getJogglerBacklight(self) + log:debug("in function get") + --os.execute("sqp_JogglerBacklight.sh 888") + local backlight, native = getJogglerBacklightPath() + local f = io.popen("cat " .. backlight) + local currentBrightness = f:read("*n") or 0 + f:close() + if not native then + currentBrightness = currentBrightness * 3 + end + log:debug("returning " .. currentBrightness or "nil") + return currentBrightness +end + +function isStandbyJogglerBacklight(self) + if (os.execute("xset -q | grep 'Standby: 1'") == 0) then + return true + end + + return false +end + +function enablePowerSaveJogglerBacklight(self, timeout) + timeout = timeout or 5 + cmd = string.format("xset -display :0.0 dpms %d 0 0",timeout) + os.execute(cmd) +end + +function disablePowerSaveJogglerBacklight(self) + os.execute("xset -display :0.0 dpms 0 0 0") + os.execute("xset -display :0.0 dpms force on") + os.execute("xset -display :0.0 s reset") +end + +function resetJogglerBacklight(self) + local backlightLevel = getStoredJogglerBacklight(self) + setJogglerBacklight(self,backlightLevel) + disablePowerSaveJogglerBacklight(self) +end function backlightSetting(self, menuItem) @@ -62,8 +195,7 @@ function backlightSetting(self, menuItem) "radio", group, function() - os.execute("sqp_JogglerBacklight.sh 999 &") - self:getSettings()["backlight"] = 999 + setJogglerBacklight(self,999,true) end, (backlight == 999) ), @@ -75,8 +207,7 @@ function backlightSetting(self, menuItem) "radio", group, function() - os.execute("sqp_JogglerBacklight.sh 100 &") - self:getSettings()["backlight"] = 100 + setJogglerBacklight(self,100,true) end, (backlight == 100) ), @@ -88,8 +219,7 @@ function backlightSetting(self, menuItem) "radio", group, function() - os.execute("sqp_JogglerBacklight.sh 80 &") - self:getSettings()["backlight"] = 80 + setJogglerBacklight(self,80,true) end, (backlight == 80) ), @@ -101,8 +231,7 @@ function backlightSetting(self, menuItem) "radio", group, function() - os.execute("sqp_JogglerBacklight.sh 60 &") - self:getSettings()["backlight"] = 60 + setJogglerBacklight(self,60,true) end, (backlight == 60) ), @@ -114,8 +243,7 @@ function backlightSetting(self, menuItem) "radio", group, function() - os.execute("sqp_JogglerBacklight.sh 40 &") - self:getSettings()["backlight"] = 40 + setJogglerBacklight(self,40,true) end, (backlight == 40) ), @@ -127,8 +255,7 @@ function backlightSetting(self, menuItem) "radio", group, function() - os.execute("sqp_JogglerBacklight.sh 20 &") - self:getSettings()["backlight"] = 20 + setJogglerBacklight(self,20, true) end, (backlight == 20) ), @@ -140,8 +267,7 @@ function backlightSetting(self, menuItem) "radio", group, function() - os.execute("sqp_JogglerBacklight.sh 10 &") - self:getSettings()["backlight"] = 10 + setJogglerBacklight(self,10, true) end, (backlight == 10) ), @@ -153,15 +279,15 @@ function backlightSetting(self, menuItem) "radio", group, function() - os.execute("sqp_JogglerBacklight.sh 5 &") - self:getSettings()["backlight"] = 5 + setJogglerBacklight(self,5, true) end, (backlight == 5) ), }, })) - window:addListener(EVENT_WINDOW_POP, function() self:storeSettings() end) + -- reinit otherwise servicemap is wiped out + window:addListener(EVENT_WINDOW_POP, function() appletManager:callService("jogglerBacklight","init") end) self:tieAndShowWindow(window) return window diff --git a/share/jive/applets/JogglerBacklight/JogglerBacklightMeta.lua b/share/jive/applets/JogglerBacklight/JogglerBacklightMeta.lua index dd3de7d..61a3de2 100644 --- a/share/jive/applets/JogglerBacklight/JogglerBacklightMeta.lua +++ b/share/jive/applets/JogglerBacklight/JogglerBacklightMeta.lua @@ -14,13 +14,13 @@ See L for a description of standard applet meta functions. =cut --]] - local os = require("os") local oo = require("loop.simple") local AppletMeta = require("jive.AppletMeta") local appletManager = appletManager local jiveMain = jiveMain +local print = print module(...) oo.class(_M, AppletMeta) @@ -39,14 +39,15 @@ end function registerApplet(meta) - - os.execute("sqp_JogglerBacklight.sh 888") + meta:registerService("jogglerBacklight") jiveMain:addItem(meta:menuItem('appletJogglerBacklight', 'screenSettings', "BACKLIGHT", function(applet, ...) applet:backlightSetting(...) end, nil, nil, "hm_settingsBrightness")) - os.execute("[ ! -f $HOME/.squeezeplay/userpath/settings/JogglerBacklight.lua ] || sqp_JogglerBacklight.sh `cat $HOME/.squeezeplay/userpath/settings/JogglerBacklight.lua | awk -F\= {'print $3'} | awk -F\, {'print $1'}` &") end - +function configureApplet(self) + appletManager:callService("jogglerBacklight", "init") +end + --[[ diff --git a/share/jive/applets/JogglerStandby/JogglerStandbyApplet.lua b/share/jive/applets/JogglerStandby/JogglerStandbyApplet.lua deleted file mode 100644 index 4e5834b..0000000 --- a/share/jive/applets/JogglerStandby/JogglerStandbyApplet.lua +++ /dev/null @@ -1,205 +0,0 @@ - ---[[ -=head1 NAME - -applets.JogglerStandby.JogglerStandbyApplet - -=head1 DESCRIPTION - -JogglerStandby v1.01 (10th April 2012) - -This applet sets the display standby time on O2 Jogglers running the native operating system. - -=head1 FUNCTIONS - -Applet related methods are described in L. -JogglerStandbyApplet overrides the following methods: - -=cut ---]] - - --- stuff we use -local ipairs, pairs, tostring, tonumber = ipairs, pairs, tostring, tonumber - -local os = require("os") -local oo = require("loop.simple") - -local Applet = require("jive.Applet") -local Timer = require("jive.ui.Timer") -local Framework = require("jive.ui.Framework") -local Window = require("jive.ui.Window") -local RadioGroup = require("jive.ui.RadioGroup") -local RadioButton = require("jive.ui.RadioButton") -local Label = require("jive.ui.Label") -local SimpleMenu = require("jive.ui.SimpleMenu") -local System = require("jive.System") -local Textarea = require("jive.ui.Textarea") -local string = require("string") -local table = require("jive.utils.table") -local debug = require("jive.utils.debug") -local Player = require("jive.slim.Player") - -local appletManager = appletManager - -local jnt = jnt -local jiveMain = jiveMain - - -module(..., Framework.constants) -oo.class(_M, Applet) - - - -function standbySetting(self, menuItem) - - local group = RadioGroup() - - local standby = self:getSettings()["standby"] - - local window = Window("text_list", menuItem.text, 'DISPLAYSTANDBY') - window:addWidget(SimpleMenu("menu", - { - { - text = self:string("SEC5"), - style = 'item_choice', - check = RadioButton( - "radio", - group, - function() - os.execute("xset -display :0.0 dpms 5 0 0") - self:getSettings()["standby"] = 5 - end, - (standby == 5) - ), - }, - { - text = self:string("SEC10"), - style = 'item_choice', - check = RadioButton( - "radio", - group, - function() - os.execute("xset -display :0.0 dpms 10 0 0") - self:getSettings()["standby"] = 10 - end, - (standby == 10) - ), - }, - { - text = self:string("SEC30"), - style = 'item_choice', - check = RadioButton( - "radio", - group, - function() - os.execute("xset -display :0.0 dpms 30 0 0") - self:getSettings()["standby"] = 30 - end, - (standby == 30) - ), - }, - { - text = self:string("MIN1"), - style = 'item_choice', - check = RadioButton( - "radio", - group, - function() - os.execute("xset -display :0.0 dpms 60 0 0") - self:getSettings()["standby"] = 60 - end, - (standby == 60) - ), - }, - { - text = self:string("MIN5"), - style = 'item_choice', - check = RadioButton( - "radio", - group, - function() - os.execute("xset -display :0.0 dpms 300 0 0") - self:getSettings()["standby"] = 300 - end, - (standby == 300) - ), - }, - { - text = self:string("MIN10"), - style = 'item_choice', - check = RadioButton( - "radio", - group, - function() - os.execute("xset -display :0.0 dpms 600 0 0") - self:getSettings()["standby"] = 600 - end, - (standby == 600) - ), - }, - { - text = self:string("MIN30"), - style = 'item_choice', - check = RadioButton( - "radio", - group, - function() - os.execute("xset -display :0.0 dpms 1800 0 0") - self:getSettings()["standby"] = 1800 - end, - (standby == 1800) - ), - }, - { - text = self:string("MIN60"), - style = 'item_choice', - check = RadioButton( - "radio", - group, - function() - os.execute("xset -display :0.0 dpms 3600 0 0") - self:getSettings()["standby"] = 3600 - end, - (standby == 3600) - ), - }, - { - text = self:string("ON"), - style = 'item_choice', - check = RadioButton( - "radio", - group, - function() - os.execute("xset -display :0.0 dpms 0 0 0") - self:getSettings()["standby"] = 0 - end, - (standby == 0) - ), - }, - })) - - window:addListener(EVENT_WINDOW_POP, function() self:storeSettings() end) - - self:tieAndShowWindow(window) - return window -end - - - ---[[ - -=head1 LICENSE - -Created by Andy Davison -birdslikewires.co.uk - -This file is made available under the following Creative Commons licence: - -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0). - -Please see http://creativecommons.org/licenses/by-sa/3.0/ for details. - -=cut ---]] - diff --git a/share/jive/applets/JogglerStandby/JogglerStandbyMeta.lua b/share/jive/applets/JogglerStandby/JogglerStandbyMeta.lua deleted file mode 100644 index 2993d3d..0000000 --- a/share/jive/applets/JogglerStandby/JogglerStandbyMeta.lua +++ /dev/null @@ -1,64 +0,0 @@ ---[[ -=head1 NAME - -applets.JogglerStandby.JogglerStandbyMeta - JogglerStandby meta-info - -=head1 DESCRIPTION - -See L. - -=head1 FUNCTIONS - -See L for a description of standard applet meta functions. - -=cut ---]] - - -local os = require("os") -local oo = require("loop.simple") -local AppletMeta = require("jive.AppletMeta") -local appletManager = appletManager -local jiveMain = jiveMain - - -module(...) -oo.class(_M, AppletMeta) - - -function jiveVersion(meta) - return 1, 1 -end - - -function defaultSettings(meta) - return { - standby = 0, - } -end - - -function registerApplet(meta) - - jiveMain:addItem(meta:menuItem('appletJogglerStandby', 'screenSettings', "DISPLAYSTANDBY", function(applet, ...) applet:standbySetting(...) end, nil, nil, "player_squeezeplay")) - os.execute("[ ! -f $HOME/.squeezeplay/userpath/settings/JogglerStandby.lua ] || xset -display :0.0 dpms `cat $HOME/.squeezeplay/userpath/settings/JogglerStandby.lua | awk -F\= {'print $3'} | awk -F\, {'print $1'}` 0 0") - -end - - - ---[[ - -=head1 LICENSE - -Created by Andy Davison -birdslikewires.co.uk - -This file is made available under the following Creative Commons licence: - -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0). - -Please see http://creativecommons.org/licenses/by-sa/3.0/ for details. - -=cut ---]] diff --git a/share/jive/applets/JogglerStandby/strings.txt b/share/jive/applets/JogglerStandby/strings.txt deleted file mode 100644 index 73c62c0..0000000 --- a/share/jive/applets/JogglerStandby/strings.txt +++ /dev/null @@ -1,153 +0,0 @@ -# -# The two letter codes are defined by ISO 639-1 -# http://en.wikipedia.org/wiki/List_of_ISO_639_codes - -DISPLAYSTANDBY - CS Display Standby - DA Display Standby - DE Display Standby Optionen - EN Display Standby - ES Display Standby - FI Display Standby - FR Display Standby - IT Display Standby - NL Display Standby - NO Display Standby - PL Display Standby - RU Display Standby - SV Display Standby - -ON - CS Disable standby - DA Disable standby - DE Display dauerhaft an lassen - EN Disable standby - ES Disable standby - FI Disable standby - FR Disable standby - IT Disable standby - NL Disable standby - NO Disable standby - PL Disable standby - RU Disable standby - SV Disable standby - -SEC5 - CS After 5 seconds of inactivity - DA After 5 seconds of inactivity - DE Display nach 5 Sekunden ausschalten - EN After 5 seconds of inactivity - ES After 5 seconds of inactivity - FI After 5 seconds of inactivity - FR After 5 seconds of inactivity - IT After 5 seconds of inactivity - NL After 5 seconds of inactivity - NO After 5 seconds of inactivity - PL After 5 seconds of inactivity - RU After 5 seconds of inactivity - SV After 5 seconds of inactivity - -SEC10 - CS After 10 seconds of inactivity - DA After 10 seconds of inactivity - DE Display nach 10 Sekunden ausschalten - EN After 10 seconds of inactivity - ES After 10 seconds of inactivity - FI After 10 seconds of inactivity - FR After 10 seconds of inactivity - IT After 10 seconds of inactivity - NL After 10 seconds of inactivity - NO After 10 seconds of inactivity - PL After 10 seconds of inactivity - RU After 10 seconds of inactivity - SV After 10 seconds of inactivity - -SEC30 - CS After 30 seconds of inactivity - DA After 30 seconds of inactivity - DE Display nach 10 Sekunden ausschalten - EN After 30 seconds of inactivity - ES After 30 seconds of inactivity - FI After 30 seconds of inactivity - FR After 30 seconds of inactivity - IT After 30 seconds of inactivity - NL After 30 seconds of inactivity - NO After 30 seconds of inactivity - PL After 30 seconds of inactivity - RU After 30 seconds of inactivity - SV After 30 seconds of inactivity - -MIN1 - CS After 1 minute of inactivity - DA After 1 minute of inactivity - DE Display nach 1 Minute ausschalten - EN After 1 minute of inactivity - ES After 1 minute of inactivity - FI After 1 minute of inactivity - FR After 1 minute of inactivity - IT After 1 minute of inactivity - NL After 1 minute of inactivity - NO After 1 minute of inactivity - PL After 1 minute of inactivity - RU After 1 minute of inactivity - SV After 1 minute of inactivity - -MIN5 - CS After 5 minutes of inactivity - DA After 5 minutes of inactivity - DE Display nach 5 Minuten ausschalten - EN After 5 minutes of inactivity - ES After 5 minutes of inactivity - FI After 5 minutes of inactivity - FR After 5 minutes of inactivity - IT After 5 minutes of inactivity - NL After 5 minutes of inactivity - NO After 5 minutes of inactivity - PL After 5 minutes of inactivity - RU After 5 minutes of inactivity - SV After 5 minutes of inactivity - -MIN10 - CS After 10 minutes of inactivity - DA After 10 minutes of inactivity - DE Display nach 10 Minuten ausschalten - EN After 10 minutes of inactivity - ES After 10 minutes of inactivity - FI After 10 minutes of inactivity - FR After 10 minutes of inactivity - IT After 10 minutes of inactivity - NL After 10 minutes of inactivity - NO After 10 minutes of inactivity - PL After 10 minutes of inactivity - RU After 10 minutes of inactivity - SV After 10 minutes of inactivity - -MIN30 - CS After 30 minutes of inactivity - DA After 30 minutes of inactivity - DE Display nach 30 Minuten ausschalten - EN After 30 minutes of inactivity - ES After 30 minutes of inactivity - FI After 30 minutes of inactivity - FR After 30 minutes of inactivity - IT After 30 minutes of inactivity - NL After 30 minutes of inactivity - NO After 30 minutes of inactivity - PL After 30 minutes of inactivity - RU After 30 minutes of inactivity - SV After 30 minutes of inactivity - -MIN60 - CS After 60 minutes of inactivity - DA After 60 minutes of inactivity - DE Display nach 60 Minuten ausschalten - EN After 60 minutes of inactivity - ES After 60 minutes of inactivity - FI After 60 minutes of inactivity - FR After 60 minutes of inactivity - IT After 60 minutes of inactivity - NL After 60 minutes of inactivity - NO After 60 minutes of inactivity - PL After 60 minutes of inactivity - RU After 60 minutes of inactivity - SV After 60 minutes of inactivity diff --git a/share/jive/applets/ScreenSavers/ScreenSaversApplet.lua b/share/jive/applets/ScreenSavers/ScreenSaversApplet.lua index b54d64a..f7a41e7 100644 --- a/share/jive/applets/ScreenSavers/ScreenSaversApplet.lua +++ b/share/jive/applets/ScreenSavers/ScreenSaversApplet.lua @@ -301,6 +301,7 @@ end --service method function activateScreensaver(self, isServerRequest) + appletManager:callService("jogglerBacklight", "enablePowerSaving") self:_activate(nil, _, isServerRequest) end @@ -596,6 +597,8 @@ end --service method function deactivateScreensaver(self) + + appletManager:callService("jogglerBacklight","reset") -- close all screensaver windows -0 do oldActive swap to avoid deleting iterated values when there is more than one window local oldActive = self.active diff --git a/share/jive/jive/JiveMain.lua b/share/jive/jive/JiveMain.lua index 3b20fab..a7e79f1 100644 --- a/share/jive/jive/JiveMain.lua +++ b/share/jive/jive/JiveMain.lua @@ -191,6 +191,9 @@ end function JiveMain:setSoftPowerState(softPowerState, isServerRequest) if _softPowerState == softPowerState then --already in the desired state, leave (can happen for instance when notify_playerPower comes back after a local power change) + if (_softPowerState == "on") then + appletManager:callService("jogglerBacklight", "reset") + end return end @@ -198,8 +201,6 @@ function JiveMain:setSoftPowerState(softPowerState, isServerRequest) local currentPlayer = appletManager:callService("getCurrentPlayer") if _softPowerState == "off" then log:info("Turn soft power off") - -- JOGGLER - power down display, after a short delay, when power state changes. - os.execute("xset -display :0.0 dpms 8 0 0") if currentPlayer and (currentPlayer:isConnected() or currentPlayer:isLocal()) then currentPlayer:setPower(false, nil, isServerRequest) end @@ -207,10 +208,6 @@ function JiveMain:setSoftPowerState(softPowerState, isServerRequest) appletManager:callService("activateScreensaver", isServerRequest) elseif _softPowerState == "on" then log:info("Turn soft power on") - -- JOGGLER - power on display immediately when power state changes. - os.execute("xset -display :0.0 dpms 0 0 0") - os.execute("xset -display :0.0 dpms force on") - os.execute("xset -display :0.0 s reset") --todo: Define what should happen for a non-jive remote player. Currently if a server is down, locally a SS will engage, but when the server -- comes back up the server is considered the master power might soft power SP back on if currentPlayer and (currentPlayer:isConnected() or currentPlayer:isLocal()) then @@ -234,8 +231,6 @@ function JiveMain:togglePower() JiveMain:setSoftPowerState("on") elseif powerState == "on" then JiveMain:setSoftPowerState("off") - -- JOGGLER - power down display when power toggle is pressed. - os.execute("xset -display :0.0 dpms force off") else log:error("unknown current soft power state: ", powerState) end