You’re probably using a desktop environment along with Linux. Whether it’s an extra lightweight one or more fully fledged, you’ll need one if you want to run graphical applications. Sure, you could try running everything in the terminal, but that’s just silly.
But what happens when your desktop kicks up a fuss? The panels lock, glitch up, or decide not to respond? Shut down the computer? Okay, that’s actually a really good idea, but there are alternatives — and no, it doesn’t involve getting a new desktop. Instead, you can just refresh it.
Why Refresh the Desktop?
The thing about rebooting your computer is it takes more time than it should. Refreshing the desktop means you’re only restarting a few programs (though slightly heavy ones). If you don’t want to lose any progress with your currently running software, it can also be quite inconvenient.
Refreshing also makes receiving updates to the desktop more seamless. For example, my Plasma desktop has recently gone through some changes, which only showed after starting it again.
Plus, there are also things that shutting down can’t solve. Glitches in your desktop due to tweaking won’t go away on their own for example. You need to do a bit more than that.
Some desktop environments make it easier than others to refresh. Cinnamon is one of them, having the function built in, and quite easy to find. It’s a fairly simple matter as well — no command line required.
Right click on any of Cinnamon’s desktop panels. Make sure you’re not selecting any applets on the panel accidentally (it won’t show if that’s the case). You’ll see a drop down menu which will let you modify Cinnamon in a number of ways, including restarting it. Select Troubleshoot > Restart Cinnamon.
If you’re a fan of keyboard shortcuts, you’re in luck. Cinnamon can do it that way as well. Just hold down Ctrl + Alt + Esc and the desktop will be refreshed. Keep in mind that this is exclusive to Cinnamon (e.g. on KDE, it lets you kill an application).
Your desktop will blank out for a moment, then refresh itself. It also hopefully means any problems before it will go away. Nice and simple.
If you’ve been fiddling with Cinnamon’s applets, you might also want to reset it to its default panel settings. This can be especially helpful if you’re experimenting with less supported extensions. It’s possible they might have introduced some instability to your desktop.
This is easy enough to fix. Right click on any empty part of Cinnamon’s panels. Then go to Troubleshoot > Restore all settings to default.
While the Unity desktop is no longer going to be used by default future Ubuntu releases, it’s not going to disappear overnight. After all, if people are comfortable with it, it’s not likely they’ll change.
While it’s quite easy to restart the Unity desktop, you still need to open the terminal to do it. Having done this, simply type in this command:
You could also just hit Alt + F2 and type in the command from there if you wanted.
If you like, you could also try setting it as a keyboard shortcut for ease of use. Just go to System Menu > System Settings > Keyboard > Shortcuts and use whatever key combination you like.
Resetting the desktop has another benefit under Gnome. When installing extensions to improve it, you might find that the change doesn’t always happen instantly. Refreshing Gnome can help solve this problem. Like Cinnamon, there are two ways to do this: either from the command line or the desktop.
For the terminal, enter in this command:
gnome-shell --replace & disown
The last parts of the command are very important. Without them, if you close the terminal, your desktop will stop working. This way, the shell will continue running in the background.
If you’d rather something a bit less strict, you can always refresh Gnome graphically. To do this, press Alt + F2, and in the input that appears, type in r, then Enter.
It seems to be a cleaner way to restart the desktop as well. There are no graphical glitches while it refreshes, for example.
4. KDE Plasma
KDE’s Plasma desktop is known for its extreme flexibility. It’s yours to mold as you see fit. As a result of this though, this can make getting things done a little bit tougher for the untrained eye. Refreshing the desktop is no exception.
Unlike Gnome, you’ll need to use the terminal to restart Plasma. Enter in this command below:
kquitapp5 plasmashell && kstart5 plasmashell
This will stop and start the desktop in a single line. It might take a few seconds for it to refresh, so be patient.
If you’re using a lot of custom Plasma applets, you might want to reset your settings if you find it causes some instability. To do this, you’ll need to delete (or rename) the plasma-org.kde.plasma.desktop-appletsrc file located in your ~/.config folder. Or just enter this command:
mv ~/.config/plasma-org.kde.plasma.desktop-appletsrc old-configuration
Don’t forget to restart the desktop to see your changes!
The Xfce desktop environment prides itself on being lightweight yet flexible. This shows in the way you go about refreshing it. It’s a two-step affair: restarting the panels and the window manager.
Enter this command:
xfce4-panel -r && xfwm4 --replace
As you can see, it’s basically just two commands strung together. You could type them in separately if you wanted to.
However, this might not be enough to fix your desktop. For example, if you fiddled around with Xfce’s appearance until it crashed, restarting it probably won’t help. In this case, it might be best to restore it to its default state.
Xfce stores its settings in a group of configuration files. However, it provides you with an easy way of accessing them, so you don’t need to touch them directly. This comes in the form of a settings editor app. To launch it, type in this command:
From there, it’s easy to reset Xfce’s panel settings: all you need to do is right click on the entries you want and select Reset. Don’t forget to reset the panel afterwards!
It’s also possible to do this entirely in the command line using the xfconf-query tool. It’s basically just the settings editor in the terminal. To reset the Xfce panel settings, enter in these commands:
xfconf-query -c xfce4-panel -p / -R -r xfce4-panel -r
Basically, any options under the xfce4-panel group will be removed (hence the -R -r option), leaving the defaults once you restart the desktop.
Like Xfce, LXDE is one of the lighter desktop environments out there. This also means the only way to refresh it is through the command line.
To do so, you need to refresh two components of the desktop at once: the panels and the window manager. Traditionally, LXDE uses Openbox (though you can change it if you want).
lxpanelctl restart && openbox --restart
Since it’s a lightweight desktop, it should only take a second or so to refresh itself.
You might also want to restore LXDE back to its default appearance. This is just a matter of moving the right configuration files out. All you have to do is rename (or delete) the correct ones. They’ll be replaced once you refresh the desktop.
For example, if you want to restore LXDE’s panel arrangement, you’ll need to remove/change the ~/.config/lxpanel folder. It contains all the configuration files This can be done either graphically or in the terminal.
mv ~/.config/lxpanel lxpanel.bak
The above command renames the lxpanel folder, forcing LXDE to regenerate it.
You can do the same with Openbox as well, by renaming the ~/.config/openbox folder to something else.
If you find yourself having to refresh the desktop lots of times, you might be interested in using command aliases. This will let you enter in a shorter terminal command for ease of use. These are located in a hidden file, called .bashrc.
To do this, first, open up the file using this command:
From there, you can add your aliases using this format:
alias refresh='xfce4-panel -r && xfwm4 –replace'
If you type in refresh into a newly opened terminal, you’ll run the assigned commands. Remember to keep these commands wrapped in quotation marks, and separated by && signs!
Perhaps your desktop has locked up — you can’t launch the terminal, but your mouse still moves for example. In this case, it might be best to restart the system. Soft refreshes can only go so far.
What tips do you have to share about your Linux desktop?