Implement double-tap-to-wake and gesture-to-sleep with just Tasker and root - Nexus 6 General

I've been looking around for options to avoid using the physical power button to turn my N6 on or off. The double-tap-to-wake functionality has been documented elsewhere (here, for instance), though I've found it harder to implement a gesture to turn off the screen. I finally happened upon using the "input keyevent" shell command. This is different (in a better way) from using a Device Administrator app that locks your screen; the input keyevent command exactly duplicates the power button behavior and so will obey your settings for when to actually lock the phone (as opposed to just turning the screen off). If you have root and Tasker, it turns out that all of this is easy to do; both the double-tap-to-wake and gesture-to-sleep actions don't require stand-alone apps to implement.
Requirements:
Root access
Tasker
A custom launcher (like Nova) that allows you to implement gesture shortcuts
For double-tap-to-wake, create a Tasker task (I call it "DTTW") that has one step: Run Shell (under "Code"), where the Command is echo 'AUTO' > /sys/bus/i2c/devices/1-004a/tsp Check the "Use Root" option.
For gesture-to-sleep, create a Tasker task (I call it "Turn Off") that has one step: Run Shell (again, under "Code"), where the Command is input keyevent 26 Again, check the "Use Root" option. You may have to choose an icon to link the task to a launcher gesture.
Now, to implement double-tap-to-wake, run the DTTW task, and you're done. It will reset (i.e., double-tap-to-wake will no longer work) when you reboot, so you can set a profile to have Tasker run the DTTW task on Device Boot (this is an Event, under "System").
To implement gesture-to-sleep, use your launcher to choose a gesture that launches the Turn Off task. Using the Nova launcher, I started Nova Settings --> Gestures and Buttons --> Swipe up Two fingers (the gesture I chose) --> Shortcuts --> Task Shortcut --> choose the Turn Off task. Now, whenever I swipe up with two fingers on my home screen, the screen goes off.
Done! Easy! Free!

i use tbe lock screen widget to turn off the screen https://play.google.com/store/apps/details?id=com.droidmania.lockscreenwidget

simms22 said:
i use tbe lock screen widget to turn off the screen https://play.google.com/store/apps/details?id=com.droidmania.lockscreenwidget
Click to expand...
Click to collapse
But I believe that locks your phone. I just want to turn off the screen, as if I'm pressing the power button.

NYZack said:
But I believe that locks your phone. I just want to turn off the screen, as if I'm pressing the power button.
Click to expand...
Click to collapse
no. it just turns your screen off, just like pressing the power button. if you have a password set, itll lock the device, just like using the power button.

simms22 said:
no. it just turns your screen off, just like pressing the power button. if you have a password set, itll lock the device, just like using the power button.
Click to expand...
Click to collapse
Are you sure? If I have a PIN set, with my phone set to lock 10 minutes after screen off, you're saying that the lock screen widget will turn off my phone but not lock it (for 10 minutes)? I think it locks it immediately.

NYZack said:
Are you sure? If I have a PIN set, with my phone set to lock 10 minutes after screen off, you're saying that the lock screen widget will turn off my phone but not lock it (for 10 minutes)? I think it locks it immediately.
Click to expand...
Click to collapse
itll behave the same way as pressing the power button to turn off the screen.

yup, I use it and it is the same thing as turning your phone off with the power button.

simms22 said:
itll behave the same way as pressing the power button to turn off the screen.
Click to expand...
Click to collapse
Well, I have nothing against Lock Screen Widget, but when I installed it and used it, it immediately made me enter a PIN to unlock my phone, even though this wouldn't happen for 10 minutes after pressing the power button.

Just wanted to say thank you for this. I have a smart watch and use that smart lock feature where if my watch is connected my screen won't lock.
All the lock screen apps in the play store lock my screen regardless if my watch is connect. But your method with tasker works perfectly thank you so much.

yup, I use it and it is the same thing as turning your phone off with the power button.

Related

Can Autolock be disabled?

I want to use an application to control it, can it be disabled?
Im not aware of an application designed to do what you are asking. However, you can use power manager to change the profile to keep the phone awake all the time. It would still lock when in standby, AFAIK.
Kieth
Settings->sound & display->screen timeout->never
Turning off the screen timeout off wont disable autolock. And yes, there are "slider" programs that immitate the iphone unlocked, which gets annoying to use when i have to hit menu to get out of autolock, and do the slider.
Go to anycut create an activity for setup wizard when it says touch screen, touch and quickly remove the battery, when you restart it will be disabled but you also loose the home key function, along with the green function, but it works if you can live without those.
that worked great but i dont think i can live with out the home and call buttons, how do i get them back?
Just run the wizard again and follow it through till the end and reset your phone.

lock the screen and turn off backlight together?

is there an app that locks the screen AT THE SAME TIME with the locking of the screen with the button on the top of HD?
fuorigioco1981 said:
is there an app that locks the screen AT THE SAME TIME with the locking of the screen with the button on the top of HD?
Click to expand...
Click to collapse
Various apps for doing this including Smartlock (which I use), HD Tweak, LockMeLite and various others apps.
Once you've installed it Smartlock, go to Settings > system > smartlock and make sure 'suspend lock' is enabled. Now each time you turn on/off device using top button device will lock
thank you.can one of these programs UNLOCK the screen AT THE SAME TIME that the light goes ON?
fuorigioco1981 said:
thank you.can one of these programs UNLOCK the screen AT THE SAME TIME that the light goes ON?
Click to expand...
Click to collapse
Sorry don't follow you. You want a lock which unlocks device when the light comes on after pushing power button??
Putting phone into standby by pressing button will lock device if you use one of apps attached, but when you press power button again you'll need to unlock device by swiping finger across screen
Fallen Spartan said:
Sorry don't follow you. You want a lock which unlocks device when the light comes on after pushing power button??
Putting phone into standby by pressing button will lock device if you use one of apps attached, but when you press power button again you'll need to unlock device by swiping finger across screen
Click to expand...
Click to collapse
i want to lock the screen and switch of the light with power button and THE SAME WAY to undo these actions!again by pressing the power button!
Fallen Spartan said:
Various apps for doing this including Smartlock (which I use), HD Tweak, LockMeLite and various others apps.
Once you've installed it Smartlock, go to Settings > system > smartlock and make sure 'suspend lock' is enabled. Now each time you turn on/off device using top button device will lock
Click to expand...
Click to collapse
i installed smart lock ,i see it in "remove programs" but i cannot find it anywhere!
well i mean it is in the path you gave me but not in the same position in the spb shell..anyway works great thank you!
what i meant with a preivious question is if it possible like when i press once the power button and display goes off AND device is locked,i want when the phone is like that to press the power button and the 1--display to light(as it does ) BUT also 2-- the display to UNLOCK also at once!
Pocketshield...
The app you're looking for is Pocketshield. It can unlock based on the light sensor...so if there's enough light touching the screen then it will unlock! It also does many other options too. Its not free but you can try it first...google it for their website
Yeah, sounds like pocketshield is the answer for you as none of the ones I mentioned has the light sensor option so you'd have to turn on device and then unlock it.
Fallen Spartan said:
Yeah, sounds like pocketshield is the answer for you as none of the ones I mentioned has the light sensor option so you'd have to turn on device and then unlock it.
Click to expand...
Click to collapse
ok thanks!

Automatic - Slide to lock - Without password

I want my phone to lock everytime I switch it off, so far the only way I can do it is by setting up a password. Anyway I can do it skipping that step?
Thanks
http://forum.xda-developers.com/showthread.php?t=542482
us this. wat im using locks when screen goes off.
Get keyboard config remapping tool, then do the following
1. Add key (press the power button on top of the device)
2. Click the + icon next to Actions, and pick Run Program from the drop down menu (browse to Devicelock.exe located in windows folder, or so it seems)
3. then add an additional Action, this time pick Action Type > Power Management > Power Toggle or Suspend Device from the drop down menu
okay everything is done and voila, your device now locks and turns it's screen off every time you press the power button on the top, and when you press the power button again it welcomes you with the slide to unlock screen.
I have attached all the necessary cab files below, the shortcutsandicons cab simply makes shortcut for you to the devicelock.exe in the start menu.
search for smartlock
The first link worked perfect! THANKS!
every suggestion so far locks the screen, but then I have to enter my password to unlock, it is only supposed to ask every 30 minutes, on my old 8525 i could lock the screen and then press a softkey and then a location on the touchscreen to unlock, is there anything similiar for the tilt2, or someway to configure any of the suggestions in this thread for that functionallity?
thanks
i use s2u2 works awesome no password needed ( but optional 4 the nosies lol)

[Q] How to change lock screen pernamently?

I want vanilla android lock screen. Widget locker сant remove it completely and can't skip it on reboot. It also works sometimes very strangely and slowly!
That's odd. I purchased Widget Locker and it works fine on my GS2. I no longer see Samsung's lockscreen after reboot or standby. And I've no issues with the behavior and performance of it either.
Perhaps check your WidgetLocker settings.
Did you enable "Appear on boot"?
ohyeahar said:
That's odd. I purchased Widget Locker and it works fine on my GS2. I no longer see Samsung's lockscreen after reboot or standby. And I've no issues with the behavior and performance of it either.
Perhaps check your WidgetLocker settings.
Did you enable "Appear on boot"?
Click to expand...
Click to collapse
Yes, it doesn't help. I've tried every setting possible to set. Also middle button works terrible! I need to press it many time before it starts working. Besides middle button turns off lock screen, but I don't want it and I don't know how to disable this.
Anyway, why I need to use it? I just want to use only ONE standart lockscreen. Without any unnecessary soft in memory.
I'm using WidgetLocker and i got no problem, it completely replaced the default lockscreen. Just use easy wake wake mode and appear on boot and samsung's default lockscreen will be replaced.
How to disable unlocking by pressing a middle button?
Sp1tfire said:
it completely replaced the default lockscreen
Click to expand...
Click to collapse
No, it's not! If you quickly press power button than try to unlock screen - you will see a samsung lockscreen for a second. Samsung lockscreen and widget locker just working in same time.
Have you disabled Samsung's lockscreen ? I don't have my SGS2 yet but on my current Android phone I can completely disable existing lockscreen.
anonymous572 said:
No, it's not! If you quickly press power button than try to unlock screen - you will see a samsung lockscreen for a second. Samsung lockscreen and widget locker just working in same time.
Click to expand...
Click to collapse
Sorry, mine works perfectly. Can't see any trace of samsung lockscreen, nor when i unlock, neither in applications running. I also disabled it from WidgetLocker settings, so there's no way it can run or appear.
Ok, let it show for a second, this is not a big problem. Told me - how to disable unlocking by pressing middle button???
In samsung default lockscreen (or any default lockscreen on android device) i press power or middle button - and screen show on. In widget locker I press middle button (power button works here ok) and waiting from 2 to 5 seconds before screen go on. This problem is only with my device?
XpLoDWilD said:
Have you disabled Samsung's lockscreen ?
Click to expand...
Click to collapse
Yes, in widget locker settings
I was having similar issues and enabled easy wake mode as a previous poster said-now spot on. There are a lot of settings to get right i must admit
anonymous572 said:
Ok, let it show for a second, this is not a big problem. Told me - how to disable unlocking by pressing middle button???
In samsung default lockscreen (or any default lockscreen on android device) i press power or middle button - and screen show on. In widget locker I press middle button (power button works here ok) and waiting from 2 to 5 seconds before screen go on. This problem is only with my device?
Yes, in widget locker settings
Click to expand...
Click to collapse
My home button doesn't unlock the device, it just wakes it. In button actions i just cleared every button and only allowed volume buttons. I'm talking about WidgetLocker, not default samsung lockscreen.
Found setting in widget locker to disable middle button unlock phone, but slow home button is still here.
anonymous572 said:
Found setting in widget locker to disable middle button unlock phone, but slow home button is still here.
Click to expand...
Click to collapse
can you show me the setting? My middle button unlocks the phone as well.
atb1o1 said:
can you show me the setting? My middle button unlocks the phone as well.
Click to expand...
Click to collapse
I have a russian version...
"Настройки - Расширенные настройки - HomeHelper - HomeHelper блокирует"
In english may be
"Settings - Advanced settings - HomeHelper - HomeHelper blocking"

[Q] Shortcut for lock screen?

On my NST Glowlight, I have a case that is beautiful but unfortunately covers the back power button (Verso Prologue Antique Tan, currently a steal on Amazon at $10). When I close the cover, it bumps things on the screen and either opens random books (in ReLaunch) or loses my place (in Coolreader). Does anyone know of a simple app that triggers the screen lock so I can map it to a hardware button? I set a "Lock Screen" shortcut in ReLaunch but at least half the time it doesn't work (instead, it asks if I want to power off). Thoughts?
Install Button Savior and tap its on-screen power button.
cowbutt said:
Install Button Savior and tap its on-screen power button.
Click to expand...
Click to collapse
IMO Button Savior is an eyesore and I can already duplicate all of its functions with hardware button mappings. I want to be able to map power to a hardware button, which I know I can do if I have an app shortcut of some sort.
OK, I found my own solution and it works well enough that I thought I'd share.
I found a whole bunch of screen lock apps but they all require Android 2.2 or later.
Thinking outside the box, I instead downloaded a simple app called "White Screen Flashlight" and mapped it to my n button. Now if I push n the screen goes completely blank and doesn't register touch input, so it's safe. I have the added benefit that if anyone swipes my Nook and wants to see what I am reading, they get a boring empty screen when they turn it on. Sleep mode kicks in as normal.
Alternatively, use http://forum.xda-developers.com/showthread.php?t=1848962 to set a Lock PIN. I combine this with a Tasker rule that disables the PIN if I'm connected to a 'friendly' WiFi network (i.e. my home WLAN) and re-enables it when I disconnect.
cowbutt said:
Alternatively, use http://forum.xda-developers.com/showthread.php?t=1848962 to set a Lock PIN. I combine this with a Tasker rule that disables the PIN if I'm connected to a 'friendly' WiFi network (i.e. my home WLAN) and re-enables it when I disconnect.
Click to expand...
Click to collapse
That is a great idea! I previously set a lock on my Nook ST (pre-Glowlight), but this time I'm simply keeping it disconnected from Google and any sensitive information. There's a bar on the screensaver that gives "please return to..." information. I figure if someone steals it, they won't get access to anything but some books, and if it's lost, a kindly soul may return it.

Categories

Resources