[MOD] [KERNEL MODULE] [July 26] Sweep2sleep

flar2

Recognized Developer
Jun 11, 2012
18,463
87,183
263
Southwestern Ontario
elementalx.org
Sweep2sleep

This is a kernel module for sweep2sleep. The new motion gestures are nice, but there is no way to put the phone to sleep with gestures. To make it worse, the power button placement is awkward. It bothered me so much, I've built this module. It is based on @show-p1984's sweep2wake2.


Swipe your finger from right to left over the navbar and your phone will go to sleep.

I will update this soon, with some improvements and also to work with GPE ROMs.







Download:

Sweep2sleep module for Sense 4.4.4 stock kernel (thanks @lyapota)
http://forum.xda-developers.com/attachment.php?attachmentid=2970798&d=1413289508

Sweep2sleep module for Sense 4.4.3 stock kernel (2.22 base)
Sweep2sleep module

Older version:
s2w_mod





Installation:
Flash zip in recovery


Un-installation:
While in recovery, do:
Code:
adb shell rm /system/lib/modules/s2w_mod.ko /system/etc/init.d/40s2w

Requirements:
In order to load automatically at boot, you need init.d support and busybox. If you have a custom ROM it should work.

For stock users, you'll need to insert the module manually:
Code:
su
insmod /system/lib/modules/s2w_mod.ko



Source:
Module was compiled against Nexus 5 kernel source with m8_defconfig. Some symbol CRC checks had to be hexedited in the compiled module.
s2w_mod.c
 
Last edited:

mwilky

Recognized Developer
Feb 21, 2011
6,542
16,171
263
Manchester
Great work as always mate!

Looking forward to getting this loaded up tomorrow when I get my m8!

Sent from my HTC One using XDA Premium 4 mobile app
 

kickassdave

Senior Member
Oct 2, 2010
2,186
636
183
My issue with swipe to sleep on the m7 was that the home button minimised the app you had open. And I didn't always want to do that. This has basically increased my love for this handset 10x over. No need to touch that damn stupidly placed power button... AT ALL.

Thanks!!

Sent from my HTC One_M8 using XDA Premium 4 mobile app
 

MassStash

Senior Member
Sep 26, 2008
3,837
2,446
253
33
Chicago
Ah man that's awesome it works still on the nav bar! Was just wondering if there would be a good option for shuttin off the screen. Get mine tomorrow! This should work on sprint m8 right? OneXL kernel still working great btw haha



~S-Off LTEvo; Always Solid Viper4G Latest;
cpu0/1: 1.5ghz ¦ 384mhz
 
Last edited:
  • Like
Reactions: looeee2

ballaz

Senior Member
Nov 14, 2009
195
46
0
I know on the N5 this slide/tap to wake features drained the battery? Does this implementation drain the battery as well. But the way, Love your work.

Sent from my Nexus 5 using XDA Premium 4 mobile app
 

MassStash

Senior Member
Sep 26, 2008
3,837
2,446
253
33
Chicago
Curious about that too, since NiN was saying he didn't like it in n5 because of that, but said n5 handles it different in some way.

~m8whl modded stock
2.265 Max ¦ 300 Min
ondemand
row
 

MassStash

Senior Member
Sep 26, 2008
3,837
2,446
253
33
Chicago
This doesn't drain battery, the gesture is used when the screen is on.

The N5 has bad drain from sweep2wake, not sweep2sleep. The lcd panel has to stay powered on to recognize touches when the phone is sleeping.
So how does HTC's implementation of dt2w work, screen off, moves, like at all, in pocket even, the screen is on to respond to tap or gestures?
 

flar2

Recognized Developer
Jun 11, 2012
18,463
87,183
263
Southwestern Ontario
elementalx.org
So how does HTC's implementation of dt2w work, screen off, moves, like at all, in pocket even, the screen is on to respond to tap or gestures?
That seems to be it. You have to move the phone before the gestures work.

I actually don't like that, because I can't doubletap when it's sitting on my desk. That's how I'm used to checking my phone.
 

MassStash

Senior Member
Sep 26, 2008
3,837
2,446
253
33
Chicago
That seems to be it. You have to move the phone before the gestures work.

I actually don't like that, because I can't doubletap when it's sitting on my desk. That's how I'm used to checking my phone.
Yea, I like the idea.... But not sure if it works out. Cuz then it's on anyway when moving around in your pocket wasting battery life yea? and could be turned on by your leg if you have some thinner workout shorts on, or in a breast pocket of your favorite flannel tee haha. I've heard that complaint already, I just grab from sides, raise a lil/giggle, then dt2w