Author Topic: HOLd - HOLD daemon  (Read 9323 times)

ValdikSS (OP)

  • Posts: 57
HOLd - HOLD daemon
« on: September 22, 2010, 04:11:47 pm »
Version 0.2!

Hello!
Here's a program which turns off LCD backlight and make current running application sleep if the HOLD button pressed and enables again if unpressed.
The code is very, very bad(I think) because that's my first application on C.
Enjoy! And feel free to rewrite it as it really should be!

To autostart add to /local/sbin/main before "./gmenu2x" following:
/boot/path/to/hold &


http://rghost.ru/2930182
« Last Edit: October 15, 2010, 04:06:52 pm by ValdikSS »

darfgarf

  • Guest
Re: HOLd - HOLD daemon
« Reply #1 on: September 22, 2010, 04:20:27 pm »
just so people don't complain, he never said it locks the buttons, just turns off the backlight

someone's bound to complain about the buttons still working while the screens off.

if it's truly the first thing you've written in c you're nuts, unless of course you skipped learning c and went straight for c++ or something :P

ValdikSS (OP)

  • Posts: 57
Re: HOLd - HOLD daemon
« Reply #2 on: September 23, 2010, 12:15:40 pm »
If anybody knows how to block buttons without kernel hacking let me know

Domian

  • Guest
Re: HOLd - HOLD daemon
« Reply #3 on: September 23, 2010, 01:04:48 pm »
if it would also block the keys and not only disable the backlight but also the LCD itselfe, it would be a nice sleep mode :)

u9

  • Guest
Re: HOLd - HOLD daemon
« Reply #4 on: September 23, 2010, 01:15:10 pm »
FYI: The download site is blocked by TrendMicro

Maybe it is just my workplace which is anal?

/Uni

darfgarf

  • Guest
Re: HOLd - HOLD daemon
« Reply #5 on: September 23, 2010, 01:15:48 pm »
If anybody knows how to block buttons without kernel hacking let me know

maybe do some hacking on the gpio pins, if you set them as outputs, and gave them a value of 1 (pretty sure the buttons pull them low, can't remember though), it could work, though that's a long shot in every sense of long

really you'd need to dig into the actual keymappings of the buttons and check for the hold button

or maybe try remapping the hold switch to something like alt, then if you press one fo teh other buttons you'll get things like alt+right ctrl etc, depending on how it's all coded it could work

drop by #dingoonity on freenode, usually some clever sods lurking there :D

yzzwx2

  • Posts: 57
Re: HOLd - HOLD daemon
« Reply #6 on: September 24, 2010, 03:17:10 am »
thank you very much! :)

samir

  • Posts: 344
Re: HOLd - HOLD daemon
« Reply #7 on: October 06, 2010, 11:58:07 pm »
Thanks!!  ;D

yzzwx2

  • Posts: 57
Re: HOLd - HOLD daemon
« Reply #8 on: October 13, 2010, 07:42:41 am »
If dmenu supports?

ValdikSS (OP)

  • Posts: 57
Re: HOLd - HOLD daemon
« Reply #9 on: October 15, 2010, 04:08:48 pm »
Hello again!
http://rghost.ru/2930182
This is v0.2.

I have really no idea how to make a button lock, but I've done an application sleep mode when the hold slider slided down.
It would work for most programs except audio players and something like this.

Put scripts into /local/gmenu2x folder

RodrigoCard

  • Posts: 314
    • Mac Joystick Apps
Re: HOLd - HOLD daemon
« Reply #10 on: October 15, 2010, 09:22:42 pm »
I did not test it yet, but reading the code I see that you basically pause all the apps running and then continue the processes when requested. Simple and nice!  :)

I was reading how to do it last week (pausing all the processes), and was thinking about using your old code as a base to do almost the same thing you did :P, but I was stuck in the part of calling the script from a C app.

Anyway, are you planning to update again with something more?


ValdikSS (OP)

  • Posts: 57
Re: HOLd - HOLD daemon
« Reply #11 on: October 16, 2010, 12:35:45 am »
RodrigoCard, i will update maybe if I get another ideas. I pause not all processes, but only one runned with gmenu2x

mate

  • Posts: 9
Re: HOLd - HOLD daemon
« Reply #12 on: October 17, 2010, 04:31:30 pm »
sorry for being a dumbass, but how to use it? in the tar i see just sources, do I need to compile them somehow? thanks

ValdikSS (OP)

  • Posts: 57
Re: HOLd - HOLD daemon
« Reply #13 on: October 18, 2010, 06:12:00 pm »
There is a "bin" folder with binaries

joepie91

  • Posts: 179
Re: HOLd - HOLD daemon
« Reply #14 on: October 18, 2010, 11:28:38 pm »
FYI: The download site is blocked by TrendMicro

Maybe it is just my workplace which is anal?

/Uni

It ends in .ru. Anything ending in .ru or .cn is pretty much guaranteed to be blocked by products like Trend Micro...

ValdikSS (OP)

  • Posts: 57
Re: HOLd - HOLD daemon
« Reply #15 on: October 19, 2010, 06:48:30 am »
It ends in .ru. Anything ending in .ru or .cn is pretty much guaranteed to be blocked by products like Trend Micro...
try rghost.net instead.

ddfoobar

  • Guest
Re: HOLd - HOLD daemon
« Reply #16 on: November 15, 2010, 06:59:57 pm »
Thanks ValdikSS for this simple yet very usefull app.

Since i cant lower the backlight (buzzing noise), i need it to be 100%. But the app seems to read only 2 bytes of the backlight value. So instead of returning 100%, it returns 10%. I hex-edited the executable from "cut -b 11-12" to "cut -b 11-13". And yay, that worked.

Thanks again ValdikSS.

Edit: In case anyone would like this. I have uploaded it to RGHost.
Edit2: Btw, compiling is easy, but hexediting 1 byte is easier ;)
« Last Edit: November 15, 2010, 07:54:40 pm by ddfoobar »

RodrigoCard

  • Posts: 314
    • Mac Joystick Apps
Re: HOLd - HOLD daemon
« Reply #17 on: November 15, 2010, 08:16:00 pm »
(...)
Edit2: Btw, compiling is easy, but hexediting 1 byte is easier ;)

Maybe funnier? :P

ValdikSS (OP)

  • Posts: 57
Re: HOLd - HOLD daemon
« Reply #18 on: November 18, 2010, 11:47:18 am »
he-he, i'm a windows and symbian soft cracker, so I enjoy hex-editing too

ryba

  • Posts: 18
Re: HOLd - HOLD daemon
« Reply #19 on: March 19, 2011, 01:37:27 pm »
Hallo.
1. I put files from bin folder to gmenu2x folder
when I run hold from gmenu, it jumps to command line, when i press hold button then, LCD turns off
But: how can i turn on LCD again?
how can i gat back to gmenu from command line?
2. I can't run autostart of this app.
Can anybody help me with this?
thanx

 

Post a new topic