Wednesday, December 26, 2012

How to disable screen blanking on gnome-shell

When watching movies on gnome shell with VLC, the screen blanks out time to time. First it was from the timeout defined in brightness setting panel. But when i disable the screen off setting some how it started to happen with a 10 min timeout again. So when i googled i found out about the below shell extension.
https://extensions.gnome.org/extension/241/yet-another-inhibit-suspend-extension-user-menu/

But this didn't solved the problem as well. But this extension will stop gnome shell from being idle, which will avoid locking your screen. So now it was time to dig more into this problem. After going through various forums i found out that the xserver has a power management mode and a screensaver which will actually turn off the display to save power. And for my surprise this had a default timeout of 10 mints :).

So i did a small modification to the above extension (which i will submit as a patch to the original developer later after some testing), which will execute the javascript statement on disabling screen locking :

Util.spawn(['xset', 's', 'off']);

And on enabling screen locking :

Util.spawn(['xset', 's', 'on']);

What the above "xset s" does is enabling and disabling the screensaver of xserver.

So at least now i have a solution for VLC when watching movies. Hope that this support will added into VLC core soon so that we don't need to have a extra extension installed.


No comments: