[Samsung Galaxy Z Fold 4] rachnov55:
Here's a tutorial on how to achieve having a different launcher based on the folded status of your z fold 4.

1. What you'll need

- Tasker

- Autotools (for tasker)

- 2 different launchers (I use Nova Launcher and Total Launcher)

2

. Before we start

Install tasker and autotools. Next, you'll need to grant Tasker the permission to read logs. This can only be achieved via ADB.

Get adb shell up and running, and input these 2 commands:

adb shell pm grant net.dinglisch.android.taskerm android.permission.READ_LOGS

adb shell am force-stop net.dinglisch.android.taskerm

3. Create Tasker Profiles

You'll need to create 2 profiles in Tasker, 1 to be used when your phone is unfolded, and 1 for when it is folded. Click on the + button under Tasker profiles, and select State. type in "Custom Setting" under the filter, and select the option shown. You'll be brought to the "State Edit" screen next. Next to "Name", click on the search (magnifying glass) icon and select "Select Setting". Scroll down and select "edge_panel_scaled_width: 401". Now click on the back arrow at the top of the tasker screen. You'll be asked to create a new task for this. Click on that option, and name it Folded. On the next screen (Task Edit) click on the + button, and type in Autotools Launcher. Click on the edit button next to Configuration, click on Launcher, and select the Launcher you wish to use for folded screen. Then make sure you have enabled "Set Command". Now go back to the Task Edit for this Folded profile. Click on the + button, and select Go Home, make sure to select your launcher package. now back to the task edit previous screen again, click the + button and select Launch App (your launcher).

4. To keep apps when going from folded to unfolded

To keep your app open when going from folded to unfolded, follow these steps.

1. Click on the Tasks tab on the top of the tasker screen. Click on the + button and name it whatever you want. I named it "Open" and "Close"

For Open, click on the + button and select Variables, then Variable Set. Under name, name it whatever you want. I named mine "appopen". Under To, enter 1. Now go back to the Tasks panel, and create your 2nd task "Close" Click on + after creating the task, and select variables, then variable clear. for name, enter %variablename (mine was appopen, so whatever you named yours)

Now go back to profiles tab and click on the + button. Select App, and select the apps you want to keep open when transitioning. Next select the "Open" task you created (or whatever you named it to). now Long press on the Open task with the green arrow, and select "Add Exit Task", and select the "Close" task you created.

Next, go back to your profile for unfolded screen. Click on the task with the green arrow. Click on the + button and type in "if". Under condition, enter "appopen" as the variable, and click on the ~ button, and select Isn't Set". go back to the Task edit previous screen and click + button and select Go Home, make sure to select your launcher package. now back to the task edit previous screen again, click the + button and select Launch App (your launcher). Now the last thing to do is to click + button in the task edit screen, and enter End If.

You're all done with Tasker now, but not all done with the process.

Go to your phone settings, and select Default Apps. You'll need to change your default launcher to Autotools Launcher, if not it will ask you if you want to change your default launcher every time you open/close your phone.

Hope this helps!