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

Search This thread

flar2

Recognized Developer
Jun 11, 2012
18,897
87,868
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://xdaforums.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:

Basil3

Inactive Recognized Themer
Apr 4, 2008
7,789
13,110
Dublin
Out of interest, has it changed since the previous version? Will keyboard swipe still turn screen off?
 

kickassdave

Senior Member
Oct 2, 2010
2,211
652
Google Pixel 6 Pro
Xiaomi Pad 5 Pro
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,838
2,446
36
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

shasen1235

Senior Member
Apr 7, 2011
167
59
Tainan
Just want to say the Google play edition kernel has released on HTCDev a few moments ago

Let the development rocks!
 
Last edited:
  • Like
Reactions: MassStash

ballaz

Senior Member
Nov 14, 2009
195
46
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,838
2,446
36
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
 

flar2

Recognized Developer
Jun 11, 2012
18,897
87,868
Southwestern Ontario
elementalx.org
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.
 
  • Like
Reactions: Maedhros

MassStash

Senior Member
Sep 26, 2008
3,838
2,446
36
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,897
87,868
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,838
2,446
36
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
 

Rochey13

Senior Member
Jun 22, 2007
85
40
Should this work on the Gpe version? Just tried it but nothing happened.

Sent from my HTC One_M8 using Tapatalk
 

Top Liked Posts

  • There are no posts matching your filters.
  • 71
    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://xdaforums.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
    17
    It's possible, I just haven't had a chance yet, very busy.
    Yep, it possible. Thanks for the mod!
    In attachment version for KitKat 4.4.4 Sense ROMs.
    10
    GPE MM

    Hello, I updated this module for GPE Marshmallow
    Flash in TWRP. Note you have to use SuperSU because I placed the script in su.d. If you're not rooted or rooted by other methods, just put the script in the correct place by yourself.
    7
    It's possible, I just haven't had a chance yet, very busy.
    6
    Sweep2sleep module for Sense 4.4.3 stock kernel


    Download:
    Sweep2sleep module