• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE][Difficulty: Intermediate] Hold/Swipe-up Home Button to Enable One-Handed Mode

Search This thread

MishaalRahman

Editor in Chief
Nov 2, 2015
1,042
2,132
www.xda-developers.com
A few months back, I wrote about a hacky way to enable one-handed mode using a shell script, taken from this reddit thread. With this task (provided you have root access), you can enable one-handed mode just by holding down the home button or swiping-up from it.

Prerequisites

  • Root access

Instructions

  1. (For Android 6.0+) Go to Settings --> Apps. Press the settings cog up top, then go to Default Apps. Enter "Assist & Voice Input" and for the "Assist App" choose Tasker. Be warned that doing this will stop the "OK Google" on every screen (and off) from working, but if you're okay with that then go ahead and change it!
  2. (For Android < 6.0) Clear the default app that is set for swiping up from the home button. You will enable Tasker as your default app after you're done following the rest of the steps below.
  3. Create a new profile and name it whatever you want, then choose the Event context. Go to UI, then choose Assistance Request.
  4. Back out, and create a new task named 'Overscan' or whatever else you want.
GBJkbOa.jpg


Now, we'll make the actions needed for the task itself.

  1. Task --> If. Set the condition to %Overscan eq 1.
  2. Code --> Run Shell. For the Command, type in wm overscan reset. Check "Use Root" and then back out.
  3. Variables --> Variable Set. Under Name, choose %Overscan, and set it to 0.
  4. Task --> Else.
  5. Code --> Run Shell. For the command, type in wm overscan LEFT,TOP,RIGHT,BOTTOM where each of the directions are the pixel counts that the screen will shift in. On my Nexus 6p, I've set it to wm overscan 0,845,0,0. See my article for examples.
  6. Variables --> Variable Set. For Name choose %Overscan and set it to 1.
  7. Task --> End If.
NCws86S.jpg


That's it! Now when you swipe-up/long press the home button, you'll launch the Overscan tasker task which will shift your screen depending on whether or not it has already been shifted. The %Overscan variable is a global variable that is set to 1 if the screen is shifted and 0 if not.

Of course, this isn't the only thing you can do with long-pressing the home button. You can also do and set the Assistance Request to open a web-search overlay on any app.
 

digitalpig82

Senior Member
Oct 20, 2014
214
118
Berlin
@MishaalRahman
Thanks for this great guide! :) I first set it up as suggested and then switched it to a shake event, quite handy. I might end up using this with a swipe gesture from Nova launcher.

Do you have any idea how we could realize a shrinking screen just like Samsungs one handed mode? Example here -> http://www.androidcentral.com/sites.../2015/09/note-5-reduce-screen-size-screen.jpg

I did some research and I think it might work using the commands "wm size" and/or "wm density", but I have very little knowledge about how to use them properly. Maybe you can help me out on this...?
 
Last edited:

MishaalRahman

Editor in Chief
Nov 2, 2015
1,042
2,132
www.xda-developers.com
@MishaalRahman
Thanks for this great guide! :) I first set it up as suggested and then switched it to a shake event, quite handy. I might end up using this with a swipe gesture from Nova launcher.

Do you have any idea how we could realize a shrinking screen just like Samsungs one handed mode? Example here -> http://www.androidcentral.com/sites/androidcentral.com/files/styles/xlarge/public/article_images/2015/09/note-5-reduce-screen-size-screen.jpg

I did some research and I think it might work using the commands "wm size" and/or "wm density", but I have very little knowledge about how to use them properly. Maybe you can help me out on this...?

To mimic Samsung's implementation, you will have to change the LEFT and RIGHT parameters. However be noted that it will really mess with a lot of apps and they won't display properly.

https://imgur.com/a/e3e3y

When I use this in the home screen and all drawer I get what's in the pictures. Any thing I need to change to fix this? I am using Nova launcher on a rooted nexus 6.

Some apps just don't turn out that well, unfortunately. Like I said this is a very hacky method.


Hi, nice works but how to set correct overscan? I'm using OP2

Experiment a bit. Make sure you set a fail safe to revert it back to normal, say if you shake your phone.
 

AshKaiser

Member
Mar 14, 2013
48
2
Chennai
OnePlus 7 Pro
Thanks for this trick! But i don't seem to be getting tasker as an option in the voice assist list of apps. I do get secure settings though. Anything that i might be missing here? Also, i've granted accessibility permissions for tasker. On 6.0.1 - Nexus 5
 

lokesh.acm

Senior Member
Feb 19, 2012
634
122
Bangalore
1465882985667.jpg
I have checked the 'root'box. Accessibility on for Tasker. But as you can see from the pic above, it's not running. See the red dot? I'm on 6.0.1 and use Google launcher. Long press on home doesn't work either. I get the su toast message saying Tasker has been granted su permissions but that's it. Any help would be appreciated. @MishaalRahman

Sent from my XT1562 using XDA-Developers mobile app
 
Last edited:
  • Like
Reactions: anialator

ohuzo

New member
Jun 7, 2009
1
0
Hello!
Help needed, I am on Galaxy S6 and I am looking for a way to start / stop the task by long pressing the home button.
As for now I didn't figured it out.

Any help please?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    A few months back, I wrote about a hacky way to enable one-handed mode using a shell script, taken from this reddit thread. With this task (provided you have root access), you can enable one-handed mode just by holding down the home button or swiping-up from it.

    Prerequisites

    • Root access

    Instructions

    1. (For Android 6.0+) Go to Settings --> Apps. Press the settings cog up top, then go to Default Apps. Enter "Assist & Voice Input" and for the "Assist App" choose Tasker. Be warned that doing this will stop the "OK Google" on every screen (and off) from working, but if you're okay with that then go ahead and change it!
    2. (For Android < 6.0) Clear the default app that is set for swiping up from the home button. You will enable Tasker as your default app after you're done following the rest of the steps below.
    3. Create a new profile and name it whatever you want, then choose the Event context. Go to UI, then choose Assistance Request.
    4. Back out, and create a new task named 'Overscan' or whatever else you want.
    GBJkbOa.jpg


    Now, we'll make the actions needed for the task itself.

    1. Task --> If. Set the condition to %Overscan eq 1.
    2. Code --> Run Shell. For the Command, type in wm overscan reset. Check "Use Root" and then back out.
    3. Variables --> Variable Set. Under Name, choose %Overscan, and set it to 0.
    4. Task --> Else.
    5. Code --> Run Shell. For the command, type in wm overscan LEFT,TOP,RIGHT,BOTTOM where each of the directions are the pixel counts that the screen will shift in. On my Nexus 6p, I've set it to wm overscan 0,845,0,0. See my article for examples.
    6. Variables --> Variable Set. For Name choose %Overscan and set it to 1.
    7. Task --> End If.
    NCws86S.jpg


    That's it! Now when you swipe-up/long press the home button, you'll launch the Overscan tasker task which will shift your screen depending on whether or not it has already been shifted. The %Overscan variable is a global variable that is set to 1 if the screen is shifted and 0 if not.

    Of course, this isn't the only thing you can do with long-pressing the home button. You can also do and set the Assistance Request to open a web-search overlay on any app.
    3
    @MishaalRahman
    Thanks for this great guide! :) I first set it up as suggested and then switched it to a shake event, quite handy. I might end up using this with a swipe gesture from Nova launcher.

    Do you have any idea how we could realize a shrinking screen just like Samsungs one handed mode? Example here -> http://www.androidcentral.com/sites/androidcentral.com/files/styles/xlarge/public/article_images/2015/09/note-5-reduce-screen-size-screen.jpg

    I did some research and I think it might work using the commands "wm size" and/or "wm density", but I have very little knowledge about how to use them properly. Maybe you can help me out on this...?

    To mimic Samsung's implementation, you will have to change the LEFT and RIGHT parameters. However be noted that it will really mess with a lot of apps and they won't display properly.

    https://imgur.com/a/e3e3y

    When I use this in the home screen and all drawer I get what's in the pictures. Any thing I need to change to fix this? I am using Nova launcher on a rooted nexus 6.

    Some apps just don't turn out that well, unfortunately. Like I said this is a very hacky method.


    Hi, nice works but how to set correct overscan? I'm using OP2

    Experiment a bit. Make sure you set a fail safe to revert it back to normal, say if you shake your phone.
    1
    Un 6.0.1 i don't have the option to change the assist app to tasker
    +1
    1
    Yeah, trying to do that exactly, am not getting taker as an assist device option.

    I think you have to uncheck "Beginner Mode" in settings first
    1
    1465882985667.jpg
    I have checked the 'root'box. Accessibility on for Tasker. But as you can see from the pic above, it's not running. See the red dot? I'm on 6.0.1 and use Google launcher. Long press on home doesn't work either. I get the su toast message saying Tasker has been granted su permissions but that's it. Any help would be appreciated. @MishaalRahman

    Sent from my XT1562 using XDA-Developers mobile app