I’m new to Nova Launcher, so don’t hate me if you already know about this. I switched to the launcher a couple of days ago, as I couldn’t get used to the native MIUI way of storing apps (no app drawer) on my new Xiaomi Mi9. After poking about inside Nova Launcher settings I found a really neat option!
Nova Launcher shortcut for apps and Tasker tasks.
What I’m referring to is a Nova Launcher gesture shortcut for folders. That’s right, you can perform a “swipe up” gesture on a folder to do its own thing. And this is rather brilliant. Here are cool things you can do with it!
- Launch the “default” app from the Folder
- Display “Digital Wellbeing” info for apps in the folder (needs Tasker)
In all honesty, all I wanted was a simple tutorial, but after 4 iterations I have a rather complicated looking contraption to explain in Tasker, but dead easy to use.
Favourite App in the folder
You can link the Nova Launcher shortcut with a “default app” for your folder. For this, you won’t even need Tasker. I have a “camera” folder, where I store the camera app shortcut and all my photo apps. It’s handy but to access the photo gallery I have to open the folder and select the correct app in the folder. Now, I all I have to do is to swipe up to achieve the same effect (the camera app opens with a designated button).
Create a folder (name it – optional). Long press on it to see the “edit” option.In the folder options, select the swipe action and pick the application from the list. DONE!
Digital Wellbeing info with Tasker
Digital Wellbeing is a thing, whether we like it or not! You can track the app use in the latest iterations of Android but the option is buried in menus. I thought it would be cool to get simple usage stats for each app in the folder! Since the time conversion has proven to be a task on its own, I wrote about it more in a separate post.
This profile does just that:
- Displays daily app usage data
- Displays monthly app usage data
- Uses dynamic values for the timer
- You can monitor any app you want
- Assign custom sort for each folder
Unfortunately, there is no clever way of getting the information of the app use (or at least, I’m yet to come across it!) so for now, I have to do this manually. My 1st iteration had a profile for every app, since then, I went full PRO and made it even more complicated impressive.
Getting the usage stats
I can calculate how long an app is open for, by creating a timestamp when the app is opened and closed. Then with a simple maths calculate the number of seconds elapsed.
These will be added to %MST (Monthly Stats) and %DST() (Daily Stats). Then I can use the Seconds to DD:HH:MM:SS tutorial to get that information flashed briefly on your screen.
Task – App Index
I need an array %AppIndex() which will hold the names of the apps I want to monitor. You have to reference at least one (the profile is set to add new ones as you go) to get started, so use Array Set action to do that.
This task has to be run just once. Please note if you run the reset task Setup, it will wipe all the values not specified in the Array Set action.
Task – App Folder *(Social Folder)
Each Nova Launcher folder has its own swipe up action, so for each folder you want to monitor this way you have to create a task. I called mine: Social Folder, as I will monitor the use of social media.
For each folder, specify the %index variable. It should be set as numbers separated by “,” (comma) and the numbers should correspond with app names stored in %AppIndex. The order of the numbers will define the apps and their order in the usage monitor window:
%AppIndex = (Facebook,Twitter,Instagram) %index = 2,3 displays stats for Twitter and Instagram %index = 3,1 displays stats for Instagram and Facebook
Profile – App Stats
To monitor the usage of each app, select all the apps that you are interested in. When the app is opened, it will get identified, %AppIndex updated and stats measured even if you don’t display it in the folder.
Yes, this means that even if you delete the folder, you won’t lose the usage stats and you can bind it to other folders too!
Task AppsStats+
To identify which app triggered the profile, I use App Info action and check %app_name against the values stores in %Appindex array %AppIndex(#?~R%app_name)
. The result is the index number of the array where the app is stored.
To save the start timestamp, I need to pop the relevant element form %AppStart(%index) out to make space for the new value to push without ruining the order in the array. I also need the app name in %AppTemp for the exit task.
If the result of my array search is 0…
IF %index < 0
If you want to monitor an app which isn’t properly set up, this condition will push the new name of the app to the %AppIndex array on 1st position and shift the %DST, %MST and %AppStart values one up.
Task AppsStats-
Upon exit, I need to grab another timestamp and calculate the number of seconds the app had been opened for. But first, I need to know where I’m going to put it.
Since I stored the name of the app in %AppTemp I can search again %AppIndex to find out where I should store the app (%index). Then you can calculate the time with: %TIMES - %AppStart(%index)
by recalling the starting timestamp from the %AppStart array.
The raw number of seconds is pushed simultaneously to %DST and %MST arrays which are responsible for storing the total number of seconds per Day and Month respectively.
Day Stats
To update the day value, I have to remove the existing value with a pop action and store it as %dtemp and add the current session by %dtemp+%stop
, then push it back to %DST() array. Note that I already know where I’m sending all the data thanks to the %index.
Month Stats
To update the month value, I have to remove the existing value with a pop action and store it as %mtemp and add the current session by %mtemp+%stop
, then push it back to %MST() array. Note that I already know where I’m sending all the data thanks to the %index.
Task – Calculate Stats
For a strange reason, I cannot use %par1 directly in my FOR loop, but if I split the %FolderArray set to %par1 to get %FolderArray() the loop seems to be working ok!
Day|Month loop
Both loops work in the same way, I just draw the information from different arrays (%DST() & %MST()). First, I take the one of the values assigned to my loop and read it the app name from %AppIndex(%loop), then I take the number of seconds and perform the seconds to DD:HH:MM::SS conversion (I used the JavaScriplet specifically as I have enough of nested tasks as is). I assign the return value to (%display_timed or %display_timem) variable and format it with the last action (remember to add Enter at the end to have a list view).
Profiles Daily|Monthly Reset
To reset the stats, I need two more profiles. One to clear the relevant variable at midnight and one to do it on the 1st of each month. For the day stats, I need to clear %DST* and set 0 value for each app that is monitored.
I can simply loop through elements of %AppIndex and push 0 value iterating the index number each time.
The same applies to monthly reset, but it’s performed on %MST* instead.
Conclusion
I’m well aware that most of you will jump to the bottom of the screen as going through this all, well it’s slightly insane. I guess I’m not 100% OK! It’s an excellent opportunity to join the Patreon as one of the perks is to get your hands on the projects like this one 3 day early.
I still love Pixel launcher, but looks like Nova Launcher will be the next best thing! Oh, I know I could use social total, but I’m past 2000 words already and I need a coffee! Let me know what will you come up with in this Reddit thread.
Project Download
Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.