- Status Closed
- Percent Complete
- Task Type Feature Request
- Category Core
- Operating System Release 1 (Zaxxon)
- Severity Medium
- Reported Version Hotfix 5
Attached to Project: OpenPandora Main OS
Opened by T4b - 21.06.2011
Last edited by EvilDragon - 12.11.2011
Opened by T4b - 21.06.2011
Last edited by EvilDragon - 12.11.2011
FS#234 - Changeable behaviour when closing the lid
As it was requested on forum.gp2x.de and I think it's a good idea I've written some scripts to allow the user to change what happens when the lid is opened/closed.
There are 3 Settings:
-The old behaviour (turning off the screen)
-Go into low power mode
-Shutdown
Default behaviour is still the same: Turn the screen off. Maybe we could change this to low power mode? I don't know.
I made a lot of changes to op_lid.sh: http://pastebin.com/GT3qxWSx (diff: http://pastebin.com/Z8GwpDj8 )
I changed line 11 in op_power.sh to: if [ $powerstate -ne 0 ]; then
And wrote a gui for changing the setting using zenity: http://pastebin.com/9JvSTqfQ
(I still can't upload any files, don't know if it's the fault of my browser, that's why I use this paste service)
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
After a longer bit of testing it sometimes awoke from low power mode when it shouldn't and other strange stuff. Somewhere there must be a bug. Will search it tomorrow.
Can't find a bug though, I think the reason is not directly in the parts I changed - I don't know how my code should check if the lid was closed a long time and then, if it was, go directly back into low power mode after waking up.
Is there some code which should bring it into low power mode after it's not been used for a while? This code would maybe wake it up instead because I write 2 into /tmp/powerstate and not 1, so it doesn't wake up from low power mode when opening/closing the lid if it went into it because of the power button.
Hmm, my Pandora just went into low power mode without me closing the lid or pushing the power button.
Now I only need to know where this code is.
Please just revert the changes until I find time to rewrite some stuff so this works (it doesn't at the moment because after some time of inactivity the same script is called as when the lid is closed and there is no way to tell what just happened).
I have to admit I'm just too lazy right now, it wouldn't be that much work.
Maybe at the weekend. Or sooner. Or later.
Done, only need to post it (this will take me at /least/ another few months ^^ ).
At the moment it still behaves a bit strangely because of the screensaver (when it is activated you need to close the lid and open it again to wake the Pandora up), but else it all works fine.
Okay, here is the diff: http://pastebin.com/UtjjpR1F
(I still can't upload anything here)
There is still some stuff which I would like to change (there is some really dirty stuff in it right now), but then I need to change some other stuff than only this scripts and this is a but harder for me (I'll try).
I don't know how I could be so stupid not to notice that before posting (or at least a few minute later), but there are 3 little mistakes in op_power.sh which prevent it from working:
Line 9: remove the $ at the beginning of the line
Between line 146 and 147: add ";;"
Between line 161 and 162: add ";;"