The purpose of this post is only to provide some basic info about how to restore a default desktop configuration, or how to back up and restore an existing desktop configuration. Should anyone notice errors or have questions please let me know and I'll do the best I can.
There may be any number of other reasons why someone wants to restore a default configuration. Maybe you just messed things up, or sometimes upgrades will result in a somewhat poor overall configuration, and these same principles can be used to backup and restore configuration files as long as the proper packages are still installed.
While I usually prefer using the CLI to perform most operations the simplest way to do this is simply by opening your Home folder. You'll typically see only the expected user folders (eg; Desktop, Documents, Downloads, Music, Pictures, etc), but if you go to the navigation bar and click on View -> Show Hidden Files you'll see what I like to refer to as "hidden dots":
hidden_dots.png
For the purposes of desktop configuration you'll typically be concerned only with .config, .gconf, .gnome2, and .compiz-1. But if this is an upgrade from a previous version of Ubuntu you may see both .compiz-1 & .compiz.
NOTE: While I'm only dealing with desktop configuration files for my purposes here I'd be lax not to mention that renaming or copying some hidden dots like .mozilla or .thunderbird will fail unless that process is killed first, eg; if I copy .mozilla while Firefox is running and try to launch Firefox after restoring that configuration I'll get a "Firefox is already running" warning. But this typically does not effect the aforementioned hidden dot desktop configuration files.
So lets say we have a messed up configuration, we made a recent change and now things are just messed up. We can simply open our home folder and click on View -> Show Hidden Files.
Note: You can open your home folder easily if you applied the change in step #3 of my OP in this thread:
Alt+F2.png
Then you can right click on the aforementioned .config, .gconf, .gnome2, and .compiz-1 folders and choose "Rename". After choosing Rename simply click within the highlighted "box" and add a suffix like "_OLD":
rename.png
Note: I usually use suffixes that just make sense to me, eg; if I decide to play with a new configuration but I want the old one to have a name I'll remember I might use "_OLD" or "_MOD". Recently I've been playing a bit with Compiz so I'll typically rename the hidden dot config files I want to backup with "_MET" meaning metacity.
Regardless, once you've renamed the aforementioned configuration files you can either reboot or just log out and log back into a fresh desktop environment so you can totally start over. If you later decide to restore the old hidden dots you can send the newest ones to the trash bin (or rename them) and remove the suffix from the ones you'd renamed previously.
Now, another way to create a "backup" of these hidden dots is to simply create an actual backup folder wherever you wish. Maybe just create a new folder in Home called Config_Backup. Then simply drag-n-drop or copy-n-paste those hidden dots to the new folder - remember they'll still be hidden files.
**************************
Now let's move on to some CLI methods. By default the terminal looks in home unless told to do otherwise so just running "ls" will display your basic user files and folders but running "ls -a" will also display the hidden dots, (no sudo needed because it's your home folder) eg;
Example:
Code:
lance@lance-desktop:~$ ls -a
. examples.desktop .mozilla
.. .fontconfig Music
.adobe .gconf .opera
.bash_history .gksu.lock Pictures
.bash_logout .gnome2 .profile
.bashrc .goutputstream-B0OKEW Public
.cache .gstreamer-0.10 .pulse
.compiz-1 .gtk-bookmarks .pulse-cookie
.config .gvfs Templates
.dbus .ICEauthority .thumbnails
Desktop .indicator-sysmonitor.json Videos
.dmrc .local .Xauthority
Documents .macromedia .xsession-errors
Downloads .mission-control .xsession-errors.old
Now I can either copy or rename those hidden dots using either "cp -a" or "mv" respectively. Examples:
Using "cp -a" to create a backup:
Code:
cp -a .compiz-1 .compiz-1_OLD
Result:
Code:
lance@lance-desktop:~$ cp -a .compiz-1 .compiz-1_OLD
lance@lance-desktop:~$ ls -a
. examples.desktop Music
.. .fontconfig .opera
.adobe .gconf Pictures
.bash_history .gksu.lock .profile
.bash_logout .gnome2 Public
.bashrc .goutputstream-B0OKEW .pulse
.cache .gstreamer-0.10 .pulse-cookie
.compiz-1 .gtk-bookmarks Templates
.compiz-1_OLD .gvfs .thumbnails
.config .ICEauthority Videos
.dbus .indicator-sysmonitor.json .Xauthority
Desktop .local .xsession-errors
.dmrc .macromedia .xsession-errors.old
Documents .mission-control
Downloads .mozilla
Using "mv" to rename:
Code:
mv .compiz-1 .compiz-1_OLD
Result:
Code:
lance@lance-desktop:~$ mv .compiz-1 .compiz-1_OLD
lance@lance-desktop:~$ ls -a
. examples.desktop .mozilla
.. .fontconfig Music
.adobe .gconf .opera
.bash_history .gksu.lock Pictures
.bash_logout .gnome2 .profile
.bashrc .goutputstream-B0OKEW Public
.cache .gstreamer-0.10 .pulse
.compiz-1_OLD .gtk-bookmarks .pulse-cookie
.config .gvfs Templates
.dbus .ICEauthority .thumbnails
Desktop .indicator-sysmonitor.json Videos
.dmrc .local .Xauthority
Documents .macromedia .xsession-errors
Downloads .mission-control .xsession-errors.old
Then, of course, after renaming the aforementioned configuration files you can either reboot or just logout and log back in to see the new default configuration.
****************************
I often create backup configurations and store them on a flash drive both for restoration purposes and to duplicate a configuration for multiple installations, but I'll discuss that more in a future post.
Bookmarks