OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: svs57 on January 26, 2007, 05:20:58 am

Title: Screen Off, Suspend Off? (r121)
Post by: svs57 on January 26, 2007, 05:20:58 am
How can set screen off while i play music?
I do
xset dpms 0 0 0
xset q show
  Standby: 0    Suspend: 0    Off: 0
  DPMS is Enabled
But Z suspend after about 4 min.
If I do
xset -dpms
script /etc/sysconfig/clamshell/closed.d/100x11scr
switch dpms to enable with command:
xset dpms force suspend

Why Z suspend if dpms set to "0 0 0"?
The only way I see set xset -dpms
But in this case I can't switch screen off
Title: Screen Off, Suspend Off? (r121)
Post by: pelrun on January 26, 2007, 06:46:33 am
Hehe - this looks like the opposite problem to one from a while back, being unable to get the screen to stay on.  Luckily, the answer to that problem is the answer to yours.

There are two X features that do blanking; one is DPMS, and the other is the screensaver. Both are controlled by xset! So to disable suspend and blank the screen, try this:

Code: [Select]
xset -dpms
xset s activate

"xset dpms 0 0 0" should imply "xset -dpms"; I consider the fact that it doesn't is a bug.
Title: Screen Off, Suspend Off? (r121)
Post by: svs57 on January 26, 2007, 07:01:27 am
Quote
Hehe - this looks like the opposite problem to one from a while back, being unable to get the screen to stay on.  Luckily, the answer to that problem is the answer to yours.

There are two X features that do blanking; one is DPMS, and the other is the screensaver. Both are controlled by xset! So to disable suspend and blank the screen, try this:

Code: [Select]
xset -dpms
xset s activate

"xset dpms 0 0 0" should imply "xset -dpms"; I consider the fact that it doesn't is a bug.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=152517\"][{POST_SNAPBACK}][/a][/div]
Screen doesn't turn off if I set
xset -dpms
xset s activate
It turn off only  if
xset +dpms
xset s activate
But in this case Z suspend
Title: Screen Off, Suspend Off? (r121)
Post by: louigi600 on January 26, 2007, 07:17:00 am
I have a dirty workaround: light&power setup to turn off screen after 1 minute but never suspend (o minutes).
I have tested this and have seen that when the battery is critically low the device still suspends.
When on external power this is no problem ... but if you forget the Z on while using batterys you may reach a point where you will only be able to turn it back on when you have some external power.

I find this an acceptable compromise while waiting for a fix.
Title: Screen Off, Suspend Off? (r121)
Post by: svs57 on January 26, 2007, 07:44:32 am
Quote
I have a dirty workaround: light&power setup to turn off screen after 1 minute but never suspend (o minutes).
I have tested this and have seen that when the battery is critically low the device still suspends.
When on external power this is no problem ... but if you forget the Z on while using batterys you may reach a point where you will only be able to turn it back on when you have some external power.

I find this an acceptable compromise while waiting for a fix.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=152520\"][{POST_SNAPBACK}][/a][/div]
Of cause I know that I can change via light&power setup.
To much action to start music.
I'll try find something easy way.
May be change /etc/sysconfig/clamshell/closed.d/100x11scr
to check weather xmms work or create script for xmms to start.
Title: Screen Off, Suspend Off? (r121)
Post by: svs57 on January 26, 2007, 07:58:47 am
/etc/sysconfig/clamshell/closed.d/100x11scr
closed() {
        c=`ps ax|grep xmms|grep -v grep|wc -l`
        if [ $c -ge 1 ]; then
         /usr/X11R6/bin/xset -dpms
         /usr/X11R6/bin/xset s 1
         /usr/X11R6/bin/xset s activate
        else
           /usr/X11R6/bin/xset dpms force suspend
        fi
    return 0
}

After xmms stop:

b="AC"
apm|grep On-line &>/dev/null
if [ $? == 1 ]; then
b="BATTERY"
fi
xset dpms `grep $b /home/root/Choices/lightnpower.cfg | awk -- '{gsub(".*screenoff=\"","",$3);gsub(".*su
spend=\"","",$4);print $3*60," 0 ",$4*60}'`
xset s `grep $b /home/root/Choices/lightnpower.cfg | awk -- '{gsub(".*screenoff=\"","",$3);;print $3*60}
'`
Title: Screen Off, Suspend Off? (r121)
Post by: Drake01 on January 26, 2007, 07:30:39 pm
Quote
Of cause I know that I can change via light&power setup.
To much action to start music.
I'll try find something easy way.
May be change /etc/sysconfig/clamshell/closed.d/100x11scr
to check weather xmms work or create script for xmms to start.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=152526\"][{POST_SNAPBACK}][/a][/div]
I agree.  I wanted to write a simple script so that I could easily switch to a couple pre-defined settings without having to start light&power (which just takes too long to start up).  

I looked at the light&power script.  I don't know python, but I thought I understood what the script was doing.  I never did get my own (bash) script to work consistently.