Topic: manually switching to night mode?

Hi there,

I would like to switch my chumby to nightly mode by a script.  Is there a command that can do this?

Ctop

Re: manually switching to night mode?

Try this:

#!/bin/sh
stop_control_panel
echo 1 > /tmp/nightmode
start_control_panel

This exploits a feature of the Control Panel that restores Night Mode if it crashes and restarts for some reason in the middle of the night.

3 (edited by ctop 2008-05-06 01:57:16)

Re: manually switching to night mode?

Great! Thanks,

Ctop

Update:

I have tried it now, that I can connect to my Chumby again. 

As far as I can see, this does not change the mode -- if the Chumby is already in nightmode, this script will restore the controlpanel in nightmode, but if not, it will restart in normal mode. 
What I want to achieve is switching to nightmode whatever the current mode is.

Ctop

Re: manually switching to night mode?

Hmmm, I just tried it and it seemed to work for me.

By putting the '1' in /tmp/nightmode, the Control Panel should start up in Night mode, no matter what mode it was previously in.

Re: manually switching to night mode?

Duane,

This seems to be a tricky one.  Your script does not seem to work reliably if the dimlevel is 2 (screen off).  After a lot of experimenting, I ended up with this script:

#!/bin/sh
stop_control_panel
sleep 2
echo 0 > /proc/sys/sense1/dimlevel
sleep 1
echo 1 > /proc/sys/sense1/dimlevel
echo 1 > /tmp/nightmode
start_control_panel

By switching the screen on for a moment and then to level 1 it does indeed end up in nightmode at the end.  I will see if this fulfills my requirements.

Thanks for your help, anyway,

Ctop