I am using Ubuntu and Windows together. Sometimes I need to use Windows, so I need to restart my computer, but since I am doing lots of things, I don't want them to be closed. For example I run VS Code in a desktop, I have some Chrome tabs and some Ros application on Terminal in another (virtual) desktop. When I close my computer, all of these are closed. When I restart it, it just opens empty.
I don't want the programs reopened, I want them stay in the same state. The VS code tabs must stay the same, the terminal must have the same texts on it, the virtual desktops must be the same again. This is kind of making computer sleep .
Is there a way to do this?
That is depending on what you really want:
If you want to save your session you should hibernate instead of restarting.
If you want to restart you should add your program to startup application.
You can also make a shell script to start your programs.