# Restore Xfce4 to default settings

*2025-12-25*

> Restore Xfce4’s default desktop settings for the current user with a Bash script that removes configuration files, caches, and saved sessions.

I run Debian 13 (Trixie) with KDE (on Wayland) as my daily driver for Android development on a Lenovo ThinkPad P50, with Xfce4 alongside mainly for tinkering. As with everything you tinker with, things tend to break along the way.

Here is a script that will restore Xfce to it's default desktop settings for the current user.

```bash
#!/bin/bash
pkill -KILL xfconfd xfce4-panel xfce4-session xfsettingsd xfdesktop 2>/dev/null || true

rm -rf ~/.config/xfce4
rm -rf ~/.cache/xfce4
rm -rf ~/.config/xfconf
rm -rf ~/.cache/sessions
rm -rf ~/.local/share/xfce4
rm -rf ~/.local/share/xfce4-panel

```

Save it as _restore\_xfce.sh_, and make it executable:

```sh
chmod +x restore_xfce.sh

```

Log out of your Xfce session and switch to a virtual console using **Ctrl + Alt + F3**, log in with your username and password, and run:

```sh
./restore_xfce.sh

```

Switch back to GUI by pressing **Alt + F2** or **Alt + F1**.

