Nova automate

Post your questions and help other users.

Moderator: Martin

Post Reply
simon_magus101
Posts: 38
Joined: 06 Sep 2017 06:59

Nova automate

Post by simon_magus101 » 12 Oct 2017 04:04

To Nova launcher users here. How to I automate the change of default homescreen page? Is it possible? Is there a way for AM to send command to Nova to change default homescreen page?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Nova automate

Post by Desmanto » 12 Oct 2017 07:05

It seems there is no direct way, no direct activity to set that. Changing via control UI seems not practical, no visible element to be scrolled to change it. What I can think about is to modify the nova database directly and will require root.

What is your usage case? Automagic has action show home screen and you can show which page of the screen you wanna visit directly. It works with nova.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

simon_magus101
Posts: 38
Joined: 06 Sep 2017 06:59

Re: Nova automate

Post by simon_magus101 » 12 Oct 2017 07:29

I have this one page that I customize for driving. So I need to see only this one page while in driving mode. When I press home button I want to see this particular page. I have managed to automate driving mode; turn on GPS, launch Waze, turn on Bluetooth and more. But I don't know how to control Nova launcher to change default page.
Maybe it is about time to change to different launcher that I can automate with Am.

User avatar
Philip
Posts: 82
Joined: 08 Jun 2015 19:20
Location: Hampshire, UK

Re: Nova automate

Post by Philip » 12 Oct 2017 09:26

Have you tried using the Action Show Home Screen?

I use Nova Launcher with 8 or 9 different Home screens, and I successfully use this Action to select a particular one within my flows.
--
Philip

simon_magus101
Posts: 38
Joined: 06 Sep 2017 06:59

Re: Nova automate

Post by simon_magus101 » 12 Oct 2017 09:39

Show home screen works. Thanks.
However that does not change the default homescreen page when I press home button.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Nova automate

Post by Desmanto » 12 Oct 2017 14:20

Hahaha, it is fun playing with nova. Even though you have partially solved it, I think about something more complicated. Since there is no direct way to do it, I think about workaround to achieve the same result.

I actually wanna use Control UI to check for certain element, example for my battery widget. And if that doesn't exist, it will show homescreen 1 (where the widget located). Use loop while nova is on foreground, so the control UI will check every second for the existence of the widget. Everytime we stray away from home screen 1, Control UI will guide it back to the right path (show home screen 1). It doesn't need to be your default home. You can press home button and land on page 5. But since it doesn't have the widget, flow triggered and show home screen 1, and boom, you will be redirected to the "default" screen when this flow is active. But I concern about the battery life, since it checks every second. Then I think it should not be a problem, since most likely you plugged your phone during driving.

The fun part is I test this in my UI event test flow. I actually wanna change it to app task started (so the trigger for the Control UI per second check is when nova is foreground). But somehow I miss pressed the "Recent event" and see there is "announcement" event from nova. (what a coincidence!) Everytime it switch homescreen, it will announce something like "Home screen 2 of 5". Wow!!! That means I can now check for home screen position. And no need to check every second anymore.

The flow is very simple, just need Trigger : UI event (accessiblity need to be enabled) and Action : show home screen. I made assumption that your driving screen is at page 4, and you have total 5 page in the home screen.

Trigger : UI Event
Event Type : Announcement
Packaga Name : com.teslacoilsw.launcher
Text : matches regex : Home screen [1|2|3|5] of 5

Action : Show Home Screen
Page : Checked : 4

For UI event, change the one regex in bracket based on every page number except the one you need. So only 4 is exclude. If you have 3 page, and the driving is on page 2; the it will be "Home screen [1|3] of 3". For the Show Home Screen, choose the page you want. Everytime you add new home screen or change the page number of driving page, you have to adjust the flow again.

Enable this flow using your other driving flow. So everytime you are driving, this flow is enabled and will actively guide your home screen to page 4 even if you try to switch to other page. There is a delay about 500 ms before the UI event triggered, I think that is not a big problem. Pressing home will still put you to the default home screen, but half a second later, you will bounced back to driving page.

You probably need to add a shortcut to disable this flow at page 4, since you can't browse to other page while this flow is active. App drawer is not affected though, so you still can access other app from app drawer.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

simon_magus101
Posts: 38
Joined: 06 Sep 2017 06:59

Re: Nova automate

Post by simon_magus101 » 12 Oct 2017 15:32

Thanks Desmanto. I just tried it. It works. I am tempted to purchase Lightning Launcher for better automation but it has not been updated for a long time.

Post Reply