How To Back Up The LXQt Desktop Settings On Linux
Sick of re-setting up your LXQt desktop environment every time you install it? Instead of sitting at all of your computers taking time re-customizing your desktop, it might be a good idea to back up the LXQt desktop settings. That way, the next time you need to re-setup your LXQt environment, it happens in a matter of minutes, rather than hours.
SPOILER ALERT: Scroll down and watch the video tutorial at the end of this article.
Back Up LXQt Desktop Settings
If you’re trying to preserve your LXQt desktop settings, you’ll need to create a complete backup of your ~/.config folder. When backing up this folder, it’s best to compress it to a TarGZ archive.
To start the backup, open up a terminal and use the tar command to create a new archive. Be sure also to use the “p” switch. Using “p” switch will allow you to preserve all of the permissions of everything in the ~/.config folder.
Note: close any programs, including things like FireFox and Chrome when running this backup, as it may affect the compression process.
tar -cvpf config-folder-backup.tar.gz ~/.config
Your data is backed up in a TarGZ archive. Feel free to upload the config-folder-backup.tar.gz file to Google Drive, Dropbox, Microsoft OneDrive, etc.
Encrypt Backups
Encrypting desktop environments usually isn’t necessary. In this case, it’s not a required step, though users should still consider it. Why? We haven’t backed up LXQt’s config files on their own. Instead, we’ve created a backup of the default configuration folder, which holds sensitive data (like browser info, application info and potentially even passwords).
The quickest way to encrypt files and folders on Linux is with GPG. Launch a terminal window and follow the instructions below to learn how to install it.
Ubuntu
sudo apt install gpg
Debian
sudo apt-get install gpg
Arch Linux
sudo pacman -S gnupg
Fedora
sudo dnf install gpg
OpenSUSE
sudo zypper install gpg
Generic Linux
GPG has support on all Linux distributions in some form. To install it on your OS, search your package manager for “gpg” or “GnuPG.” Can’t find it? Check the Pkgs.org website for a downloadable binary file.
Make a backup up of config-folder-backup.tar.gz by running gpg with the “c” switch.
gpg -c config-folder-backup.tar.gz
In the terminal, enter a secure password. If the encryption is successful, config-folder-backup.tar.gz.gpg will appear in your home folder. Finish up the encryption process by removing the unencrypted archive file.
rm config-folder-backup.tar.gz
Finish up the LXQt backup process by uploading config-folder-backup.tar.gz.gpg to a safe place online or on your network.
Themes And Icons
After backing up the ~/.config folder, you’ll need to create a backup of your custom icons and themes. If you don’t, LXQt will not look right after the backup is restored.
Generally, most users have icons set up in the ~/.icons and ~/.themes folders, so we’ll be creating backups of those using the tar command. Keep in mind that if you install your custom icon themes system-wide, you’ll have to back up the /usr/share/icons/ and /usr/share/themes/ instead.
To start the backup, open up a terminal and use the tar command.
tar -cvpf custom-icons.tar.gz ~/.icons tar -cvpf custom-themes.tar.gz ~/.themes
For a system-wide backup of custom icons and themes, run the following commands
sudo -s cd /usr/share/ tar -cvpf custom-icons.tar.gz icons tar -cvpf custom-themes.tar.gz themes
mv *.tar.gz /home/username/
When the compression process is complete, close the terminal and open up your file manager. In the file manager, navigate to your home folder and upload both custom-icons.tar.gz and custom-themes.tar.gz to the cloud, or a home server for storage purposes.
Restore Backup
Grab a copy of your config-folder-backup.tar.gz.gpg data and place it in ~/Downloads on your Linux PC. When that’s taken care of, place the custom-icons.tar.gz and custom-themes.tar.gz files there as well. After all of the TarGZ archive files are in place, launch a terminal window and use the CD command.
cd ~/Downloads
Decrypt your config-folder-backup.tar.gz.gpg file using the gpg command.
gpg config-folder-backup.tar.gz.gpg
Using the tar command, extract the contents of the decrypted config-folder-backup.tar.gz archive to the home directory.
tar --extract --file config-folder-backup.tar.gz -C ~/ --strip-components=2
After restoring your configuration files, extract both the icon and theme archive files with tar.
Restore icons and themes for single users
tar --extract --file custom-icons.tar.gz -C ~/ --strip-components=2 tar --extract --file custom-themes.tar.gz -C ~/ --strip-components=2
Restore icons and themes system-wide
sudo tar --extract --file custom-icons.tar.gz -C /usr/share/ --strip-components=1 --overwrite sudo tar --extract --file custom-themes.tar.gz -C /usr/share/ --strip-components=1 --overwrite
Now that the custom icons and themes are in place, restoration is complete. Finish up by restarting your Linux PC. When you log back in, LXQt should look as if nothing happened.