Taskbar icon indicating copy to clipboard operation
Taskbar copied to clipboard

[Feature request] Automatic launcher switch for Desktop mode functionality

Open nift4 opened this issue 4 years ago • 10 comments

Hi :) I use an (sadly) closed source alpha version of Lawnchair to make Quickstep work and don't want to loose Quickstep by switching the default launcher forever. Can you include an option for rooted users (or maybe WRITE_SECURE_SETTINGS is enough) to Auto-Switch to Taskbar and back. Or is this possible already?

nift4 avatar Jun 13 '20 16:06 nift4

I'm not aware of any way to auto-switch the user's default launcher, root or otherwise, but if I do figure out a way to do this I would definitely look into adding this as an option to Taskbar.

One thing you could try is asking the maintainer of that alpha version of Lawnchair to integrate libtaskbar into their app. It's a version of Taskbar that's compiled as a library so that other launchers can natively support desktop mode. There's an example implementation of this that's based on Lawnchair that can be referenced here.

farmerbb avatar Jun 14 '20 17:06 farmerbb

Well, with root you can do literally everything :D Maybe I find something out how to change the launcher via root, if yes, I post it here

About libtaskbar: The maintainers is the offical Lawnchair team and they release the source when that version is stable. I'm sure they will not create one or even every build with libtaskbar as they are busy enough already. :(

nift4 avatar Jun 14 '20 18:06 nift4

A quick Google search revealed this: (See the comments: No need to reboot) https://stackoverflow.com/a/46922386

nift4 avatar Jun 14 '20 18:06 nift4

I was able to change the launcher properly (changed in settings too) and on the fly with this command:

cmd package set-home-activity 'com.android.launcher3/.lineage.LineageLauncherActivity'

Yes, I'm using LineageOS ;) (Rooted 17.1)

nift4 avatar Jun 14 '20 18:06 nift4

but if I do figure out a way to do this I would definitely look into adding this as an option to Taskbar.

I'm looking forward to an option :P

nift4 avatar Jun 14 '20 18:06 nift4

I was able to change the launcher properly (changed in settings too) and on the fly with this command:

cmd package set-home-activity 'com.android.launcher3/.lineage.LineageLauncherActivity'

Yes, I'm using LineageOS ;) (Rooted 17.1)

I'm trying something similar with

adb shell cmd package set-home-activity farmerbb.taskbar/.ui.HomeActivity

but I'm getting

adb shell cmd package set-home-activity com.farmerbb.taskbar/com.farmerbb.taskbar.ui.HomeActivity java.lang.IllegalArgumentException: Component ComponentInfo{com.farmerbb.taskbar/com.farmerbb.taskbar.ui.HomeActivity} cannot be home on user 0

The reason of this it's to be used with scrcpy script

LightBlackInfinitum avatar Jun 14 '20 20:06 LightBlackInfinitum

Try changing the default user to something else than Taskbar, just to test the command. What Taskbar does is ig @farmerbb's problem :P. Did you even enable use Taskbar as default launcher in options btw?

nift4 avatar Jun 15 '20 05:06 nift4

Try changing the default user to something else than Taskbar, just to test the command. What Taskbar does is ig @farmerbb's problem :P. Did you even enable use Taskbar as default launcher in options btw?

I tried with Niagara Launcher and it works well

adb shell cmd package set-home-activity bitpit.launcher/.ui.HomeActivity

LightBlackInfinitum avatar Jun 15 '20 19:06 LightBlackInfinitum

@Blakenidby For desktop mode, the correct command to use would be adb shell cmd package set-home-activity farmerbb.taskbar/.activity.HSLActivity.

farmerbb avatar Jun 18 '20 04:06 farmerbb

@Blakenidby For desktop mode, the correct command to use would be adb shell cmd package set-home-activity farmerbb.taskbar/.activity.HSLActivity.

I'm using Android 9. this command worked for me adb shell cmd package set-home-activity com.farmerbb.taskbar/.activity.HomeActivity.

With the previous command, I managed to do this https://youtu.be/n6CgGz_69eI

LightBlackInfinitum avatar Jun 19 '20 20:06 LightBlackInfinitum