You can use workgroups2
to manage your desktop. From the README on GitHub:
Workgroups is a session manager for Emacs.
- It saves all your opened buffers, their location and sizes on disk to restore later
- You can create several workspaces
You can also restore such buffers as: org-agenda, shell, magit-status, help.
If you have the MELPA repository enabled, you can install this package via M-x package-install
RET workgroups2
RET.
The basic setup is:
(require 'workgroups2)
(workgroups-mode 1) ; This should go at the end of your init file
When you restart Emacs for the first time after adding this code to your init file, workgroups2
will automatically create a workgroup for you. You can verify that this was successful by checking the *Messages*
buffer for the following information:
Workgroups Mode: on
Switched: First workgroup
Created: First workgroup ( -<{ 0: First workgroup }>- )
From this point on, Emacs will save the current configuration of windows and files automatically on exit, and restore it the next time it starts.