Looking For / Help With : Ability to blank or dim screen
#1
Rainbow 
So here's the scenario. I like to have some TV going while I fall asleep - but I only want to listen to it, I don't need it on screen. Unfortunately, I have an all-in-one PC, so I can't turn the display off separately.

What I'm looking for is a way to blank or heavily dim the screen - probably at the press of a button on my remote. The absolute ideal would be to send the display to sleep (so I don't get the backlight bleed). As far as blanking goes - I know it's possible to simply adjust the screen offset so it pushes the video offscreen.

I'm not against writing a plugin to do this - but I've never developed a plugin for Kodi.

a) Is there already a plugin that can do this or something similar?
b) Is there perhaps a generalized scripting plugin that could do something like adjust the v-offset on the push of a button? Or turn off the display sleep inhibitor?
c) If not, where would I start on developing a plugin to do this?

Hopefully someone can point me in the right direction! TIA.
Reply
#2
The choice of available screensavers vary depending on a platform, but I believe that there's "Dim" and/or "Black" screensavers on almost every platform. You can create a custom keymap and bind ActivateSreensaver command to a key of your choice.
Reply
#3
And that will work, even while the media is still playing?
Reply
#4
(2017-10-20, 13:12)unclespode Wrote: And that will work, even while the media is still playing?
Why not try it?  It should take all of 2 minutes.
Reply
#5
(2017-10-20, 13:21)trogggy Wrote:
(2017-10-20, 13:12)unclespode Wrote: And that will work, even while the media is still playing?
Why not try it?  It should take all of 2 minutes.

A good point Big Grin
Reply
#6
It probably won't work while videoplayer is active. Depending on the platform, you could just use some dpms command in the OS to put the display to sleep.

e.g. on linux the following works:
xset dpms force suspend

this can be run externally or via kodi from a mapped button
Reply
#7
So a fiddled around with a fair few things, most of which didn't work, or almost worked but not enough.

The best I've got so far is to map the internal function ToggleDPMS to a button on my remote. This will turn the display off entirely and the playlist will keep playing.

The problem, however, is getting back to a working Kodi.

- Press a key and the screen will come back on, but be frozen and unresponsive (but you can hear the audio)
- Press the DPMS button again, and it will come back, frozen, but after a short time will usually start playing again.
- In conjunction with the Sleep Timer plugin (stops playback after 120 minutes in my case), the next morning if I go to use the device - I have to actually terminate Kodi as it's impossible to get it to render again.

I thought my best bet was going to be using System.Exec to launch the screensaver or a DPMS activator - but anything launched this way causes Kodi to minimise and then playback stops. Could really do with an option to either stop the minimizing behaviour, or to keep playback going.

Another thought that occurred, looking at other requests is that it would be good to have the ability to access video settings like Brightness, VerticalOffset, etc. It would also be handy to have a way of using multiple values - such as:

Toggle(setting, values)

For example.

Toggle(VerticalOffset, 0, 20, 40)

So pressing a button again will move through the options.

This would solve mine, and a few other people's problems I found which researching.
Reply
#8
BTW, another possibility would be to create a custom program addon that creates a blank Window instance:


Code:
from xbmcgui import Window

win = Window()
win.doModal()


A blank Window is just a black screen with no elements. To close it you need to press Esc or Backspace.
Reply
#9
(2017-10-25, 10:23)Roman_V_M Wrote: BTW, another possibility would be to create a custom program addon that creates a blank Window instance:


Code:
from xbmcgui import Window

win = Window()
win.doModal()


A blank Window is just a black screen with no elements. To close it you need to press Esc or Backspace.

Is there a plugin boilerplate available so I can whip this up?
Reply
#10
(2017-11-01, 16:41)unclespode Wrote:
(2017-10-25, 10:23)Roman_V_M Wrote: BTW, another possibility would be to create a custom program addon that creates a blank Window instance:


Code:
from xbmcgui import Window

win = Window()
win.doModal()


A blank Window is just a black screen with no elements. To close it you need to press Esc or Backspace.

Is there a plugin boilerplate available so I can whip this up?

The code above is a minimal working example. As for proper addon structure, you can use addon generator from a sticky topic in this section or edit some other program addon.
Reply

Logout Mark Read Team Forum Stats Members Help
Looking For / Help With : Ability to blank or dim screen0