moof-moof/Icon-pycon
Script for saving and restoring desktop icons positions in a Gnome type of desktop environment.
Icons_pycons
A pair of function definitions for saving and restoring the preferred spatial positions of the set of all current desktop icons.
Hopefully useful in case one's cherished handcrafted desktop layout has been
accidentally deleted, e.g. by clicking the inexplicable contextual menu
option "Organize Desktop by Name", which naturally can't be undone...
The names of icons' corresponding files must have no leading or trailing spaces.
Tested on Ubuntu Mate 20.04, using the Caja file manager and python3.
Requires gio and egrep.
Based on a rather more elaborate script provided by RockDoctor.
By moof-moof 2021-01-20.
To make a backup of the names and positions of the desktop icons:
-
Open a terminal in the directory "1-SAVING".
-
Issue
python3 SAVE_desktop_layout.py. -
Note terminal output and the newly created pickle (*.p-YYYY-MM-DD) file in the configured backup directory.
To later restore all the desktop icons to their saved positions:
-
Copy desired pickled file w/o date suffix to the configured backup directory.
-
Open a terminal in the directory "2-RESTORING".
-
Issue
python3 RESTORE_desktop_layout.py. -
Note terminal output (which should ideally present none or very few
returncode=1messages). -
Update filemanager by clicking the desktop while hitting F5.