How to update folderview from a script?

Hi,
I have an encfs protected folder with office data and wrote a script that asks for a password and unlocks it. I want to have the documents in this folder in a folder view widget on a certain activity. Problem is, the folder view app only shows “folder does not exist” because that was the case when the desktop started (before folder was unlocked). How can I update the folder view (or restart it) from the script after it mounts the folder? I tried stopping and restarting the activity but to no avail, folder view does not update. What can I do?

I know I can manually update the folder viewer with right click/refresh but that’s not what I want, I want it to refresh automatically.

Thanks for any help in advance.

I am not sure how to do that. Maybe there even isn’t a way to do it except manually.
Or you would use a script to decrypt the folder during the login process before plasma-desktop loads. This would mean putting the script in ~/.local/share/plasma-workspace/env directory (if not there creating it).
This can also be achieved via systemsettings startup programs. There you should be able to setup a script or app to start prior to the desktop being loaded.

That does not work because I use kdialog to read the paraphrase from the keyboard and when I run it at that stage, it does not accept any input from the keyboard. Is there a similar tool like kdialog I could use?

There is zenity but when it comes to entering a password that would not work either as the desktop would not wait loading until you enter your password.
Hmm… can’t you run the script during normal tty bootup so that you have to enter the password to decrypt in a plymouth dialog before even the graphical login manager starts?

I found an easier/more convenient way: ecryptfs private folder auto-mounted during login