We could use a more custom approach to the run levels rather than the traditional
1 reserved 2 charging mode 3 command line mode 4 xwindows mode 5 reserved
The default runlevel would *always* be 2, this is a runlevel that would have almost nothing running, just enough to show the battery level and offer flicking the power switch to goto runlevel 4 (it would also show %age and eta)
runlevel 2 would automatically initiate runlevel 4 if either
a) charge is 100% (unless in runlevel2 user has requested shutdown on charge - as nothing of the users is running we could default to this unless the user changes it)
b) the ac supply is not present
runlevel 3 should only be entered if specifically requested by the user (via normal means) should be tested and working with the power management (ie not loose the console after blanking) - there are no end of uses for this run level for the "power" user
if the user reboots with a full battery but no AC power runlevel 2 should just automatically initiate runlevel 4 without the user being aware this is happening...
oh and if you want to know what runlevel you're in use the runlevel command! :D
I'd reckon that the runlevel 2 application should directly use the framebuffer, it should absolutely not be and xwindows application, it need only run in "low power" mode and should do screen blanking and completely shutdown the display subsystem then the lid is closed. I'd suggest a slow dim flashing that gradually becomes solid dim
I'd could probably be persuaded to volunteer to write this is no one else does...
On 01/05/11 02:23, Michael Mrozek wrote:
As mentioned in my previous eMail, I'd love to include a more consumer-friendly charging.
A lot of new users are confused that the unit doesn't switch off when being charged, I even had one guy who sent it back for RMA (without asking if that's normal)...
Therefore, I'd love to improe that.
Basically, we can't switch off the unit while it's charging, but we could make a similar behaviour.
The ideal behaviour would be the following:
In case the unit is switched off and connected to AC: Start booting but don't boot into the full OS but show a screen that the unit is charging (along with percentage, approx. time left, etc.) Power LED should be switched off. Flick the switch to continue booting.
In case the unit is switched on, connected to AC and user shuts down: It should log out, display the charging screen and behave the same as above.
In case the unit is switched on, connected to AC and user reboots: It should reboot without showing the charging screen.
To accomplish that, the following needs to be checked:
Can we find out if the unit has been powered on by the power switch OR by connecting the AC?
How do we know if the user reboots or shuts down? I think reboot and shutdown trigger different runlevels, right?
Someone needs to code the program that displays the battery level and charging info :)
Where do we put the program into the boot process? Is it possible to interrupt the bootprocess and continue it later? If not, I think it should be possible to load it instead of XFCE4 or MiniMenu. That could be included in the X-Startup-Script. That's probably the best area to include it, as this script starts BEFORE a GUI is run and as soon as you quit the GUI, it continues, so both the startup and reboot / shutdown could be triggered here. And if the user flips the power switch, the program would just have to set the normal GUI to load and quit to continue booting.
What do you think?
I would take care of the implementation of that small charging program into the script and make sure shutdown, reboot and starting the normal GUI would work, but I'd need someone to code that GUI and help me how to find out how the unit has been booted up.
Also, how do you find out the runlevel you're in? :)