Author Topic: Screen resolution and backlight  (Read 1625 times)

brightness

  • Guest
Screen resolution and backlight
« on: October 09, 2011, 11:07:04 AM »
Hi,

I am using PCLOS 2011-09 KDE Full version (32bit) on a 64bit desktop pc. I am using liveusb in persistent mode.

1. When the screen turns off as set in Power Management, the backlight is still on. I read somewhere that you could use vbetool dpms off to turn it off, but I have tried and I cant turn it back on (and I did a hard reboot).

Is there a way to run the script automatically and also when the mouse is moved the os automatically execute vbetool dpms on?

2. The screen resolution reverts to 1200x760 every time upon reboot. How can I set the default resolution to AUTO?

Thanks.

brightness

  • Guest
Re: Screen resolution and backlight
« Reply #1 on: October 11, 2011, 03:14:37 AM »
OK, I found that if you INSTALL the os on your usb, the problems are all solved. But when running in LiveUsb (persistence) mode, the problems exist.

Can anyone teach me how to write a script which:

When there is no input for x minutes, execute vbetool dpms off
When there is input again, then vbetool dpms on

The scripts should be executed without the need to input the root password.

Or, the script can be linked to the screensaver.

Thanks in advance.

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10672
  • MLUs Forever!
Re: Screen resolution and backlight
« Reply #2 on: October 11, 2011, 04:44:13 AM »
Have you tried using KDE - Hardware - Power management ... and set up a profile to suit you?
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

brightness

  • Guest
Re: Screen resolution and backlight
« Reply #3 on: October 11, 2011, 04:48:30 AM »
Have you tried using KDE - Hardware - Power management ... and set up a profile to suit you?

Yes I have. The problem is when the screen turns off the backlight is still on. I have searched through the web and many people are complaining about this issue. Some suggest using Perl to monitor screensaver and run vbetool dpms off accordingly using the "if...then...else...fi" command. But they only wrote a script for Ubuntu which, when copied to my system generated many error warnings.

Thanks.

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10672
  • MLUs Forever!
Re: Screen resolution and backlight
« Reply #4 on: October 11, 2011, 04:54:15 AM »
post the script within script brackets ....  # button above text entry window .....  and maybe someone will see how it could be edited for PCLOS
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

brightness

  • Guest
Re: Screen resolution and backlight
« Reply #5 on: October 11, 2011, 05:03:54 AM »
post the script within script brackets ....  # button above text entry window .....  and maybe someone will see how it could be edited for PCLOS


SUGGESTION 1 (http://www.gentoo-wiki.info/HOWTO_Automatically_turn_off_your_monitor)

CODE:

Code: [Select]
#!/usr/bin/perl
# Author: Kevin Blair
use strict;
use warnings;

#time out inseconds after screen saver is up that the monitor goes to sleep
my $suspend=900;
my $cmd = 'dcop kdesktop KScreensaverIface isBlanked';
my $vbestat=1;

while (my $status = `$cmd` ) {
  if ($status =~ /true/ && $vbestat) {
    sleep $suspend;
    $status = `$cmd`;
    if ($status =~ /true/) {
      system('sudo vbetool dpms off');
      $?||$vbestat=0;
     }
  } elsif ($status =~ /false/ && ! $vbestat) {
    system('sudo vbetool dpms on');
    $?||$vbestat=1;
  }
  sleep 2;
}

SUGGESTION 2 (http://www.shallowsky.com/linux/x-screen-blanking.html)

Quote
So what if you really do want your backlight to turn off after a specific interval? There doesn't seem to be a way to get Xorg to do it directly. But you can cheat: Write a script that calls vbetool dpms off. Then set that script to be your screensaver.


I cant find a way to run a script as a screensaver. Also, the should be two scripts, one for turning off and one for turning on.

Thanks.

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10672
  • MLUs Forever!
Re: Screen resolution and backlight
« Reply #6 on: October 11, 2011, 05:13:18 AM »
Run the script from a terminal, and copy and paste what appears there ....  it should show the reason for errors.

The first thing that jumps out at me is the use of  sudo  in the script .....  we don't use sudo by default
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

brightness

  • Guest
Re: Screen resolution and backlight
« Reply #7 on: October 11, 2011, 05:40:31 AM »
The result is:

Code: [Select]
Can't modify logical or (||) in scalar assignment at <script> line 17, near "0;"
Execution of <script> aborted due to compilation errors.

I have tried removing(||) etc, after each attempt it gives other errors.

Thanks.

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10672
  • MLUs Forever!
Re: Screen resolution and backlight
« Reply #8 on: October 11, 2011, 08:38:20 AM »

I would think that both dcop and sudo will need attention ....  but I ain't a Perl programmer  :D

Hopefully someone who is familiar with Perl will come by to help.

Alternatively you could bring this to the Advanced section for help ......
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

brightness

  • Guest
Screen resolution and backlight
« Reply #9 on: October 12, 2011, 01:00:16 AM »
I cant move threads across the forums. So the following is a text-copy of a thread on the Desktop Hardware forum which Just18 suggested me to put into the Advanced forum.

Thanks.

========================   

By: brightness

Screen resolution and backlight
« on: October 09, 2011, 12:07:04 PM »

Hi,

I am using PCLOS 2011-09 KDE Full version (32bit) on a 64bit desktop pc. I am using liveusb in persistent mode.

1. When the screen turns off as set in Power Management, the backlight is still on. I read somewhere that you could use vbetool dpms off to turn it off, but I have tried and I cant turn it back on (and I did a hard reboot).

Is there a way to run the script automatically and also when the mouse is moved the os automatically execute vbetool dpms on?

2. The screen resolution reverts to 1200x760 every time upon reboot. How can I set the default resolution to AUTO?

Thanks.
================================
By: brightness
   
Re: Screen resolution and backlight
« Reply #1 on: Yesterday at 04:14:37 AM »

OK, I found that if you INSTALL the os on your usb, the problems are all solved. But when running in LiveUsb (persistence) mode, the problems exist.

Can anyone teach me how to write a script which:

When there is no input for x minutes, execute vbetool dpms off
When there is input again, then vbetool dpms on

The scripts should be executed without the need to input the root password.

Or, the script can be linked to the screensaver.

Thanks in advance.
====================================

By: Just18

Re: Screen resolution and backlight
« Reply #2 on: Yesterday at 05:44:13 AM »

Have you tried using KDE - Hardware - Power management ... and set up a profile to suit you?

===================
By: brightness

Re: Screen resolution and backlight
« Reply #3 on: Yesterday at 05:48:30 AM »

Quote from: Just18 on Yesterday at 05:44:13 AM
Have you tried using KDE - Hardware - Power management ... and set up a profile to suit you?

Yes I have. The problem is when the screen turns off the backlight is still on. I have searched through the web and many people are complaining about this issue. Some suggest using Perl to monitor screensaver and run vbetool dpms off accordingly using the "if...then...else...fi" command. But they only wrote a script for another distro which, when copied to my system generated many error warnings.

Thanks.
===================================

By: Just18
   
Re: Screen resolution and backlight
« Reply #4 on: Yesterday at 05:54:15 AM »

post the script within script brackets ....  # button above text entry window .....  and maybe someone will see how it could be edited for PCLOS
=============================

By: brightness
   
Re: Screen resolution and backlight
« Reply #5 on: Yesterday at 06:03:54 AM »

Quote from: Just18 on Yesterday at 05:54:15 AM
post the script within script brackets ....  # button above text entry window .....  and maybe someone will see how it could be edited for PCLOS

SUGGESTION 1 (http://www.gentoo-wiki.info/HOWTO_Automatically_turn_off_your_monitor)

CODE:

Code:
#!/usr/bin/perl
# Author: Kevin Blair
use strict;
use warnings;

#time out inseconds after screen saver is up that the monitor goes to sleep
my $suspend=900;
my $cmd = 'dcop kdesktop KScreensaverIface isBlanked';
my $vbestat=1;

while (my $status = `$cmd` ) {
  if ($status =~ /true/ && $vbestat) {
    sleep $suspend;
    $status = `$cmd`;
    if ($status =~ /true/) {
      system('sudo vbetool dpms off');
      $?||$vbestat=0;
     }
  } elsif ($status =~ /false/ && ! $vbestat) {
    system('sudo vbetool dpms on');
    $?||$vbestat=1;
  }
  sleep 2;
}

SUGGESTION 2 (http://www.shallowsky.com/linux/x-screen-blanking.html)

Quote
So what if you really do want your backlight to turn off after a specific interval? There doesn't seem to be a way to get Xorg to do it directly. But you can cheat: Write a script that calls vbetool dpms off. Then set that script to be your screensaver.


I cant find a way to run a script as a screensaver. Also, the should be two scripts, one for turning off and one for turning on.

Thanks.

==================================
By: Just18
   
Re: Screen resolution and backlight
« Reply #6 on: Yesterday at 06:13:18 AM »

Run the script from a terminal, and copy and paste what appears there ....  it should show the reason for errors.

The first thing that jumps out at me is the use of  sudo  in the script .....  we don't use sudo by default
=============================

By: brightness

Re: Screen resolution and backlight
« Reply #7 on: Yesterday at 06:40:31 AM »

The result is:

Code:
Can't modify logical or (||) in scalar assignment at <script> line 17, near "0;"
Execution of <script> aborted due to compilation errors.

I have tried removing(||) etc, after each attempt it gives other errors.

Thanks.
========================

By: Just18
   
Re: Screen resolution and backlight
« Reply #8 on: Yesterday at 09:38:20 AM »
Quote

I would think that both dcop and sudo will need attention ....  but I ain't a Perl programmer 

Hopefully someone who is familiar with Perl will come by to help.

Alternatively you could bring this to the Advanced section for help ......

brightness

  • Guest
Re: Screen resolution and backlight
« Reply #10 on: October 12, 2011, 01:01:55 AM »

I would think that both dcop and sudo will need attention ....  but I ain't a Perl programmer  :D

Hopefully someone who is familiar with Perl will come by to help.

Alternatively you could bring this to the Advanced section for help ......


OK, thanks.

The new thread is here: http://www.pclinuxos.com/forum/index.php/topic,98161.0.html

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Screen resolution and backlight
« Reply #11 on: October 12, 2011, 01:14:56 AM »
Topics merged.