Linux Tip: How to Clean Up KDE on Logout

By Detector | 04 March 2009



Windows has a plenty of programs that do stuff like clean out your web cache, remove temporary files and all sorts of other stuff when you logout. Wouldn’t it be cool to do this on Linux too? With KDE, you don’t need to even install any new software, as the startkde script will automatically run scripts you put in special places.

First, you need to open Terminal and create a directory called shutdown in your .kde directory:

mkdir /home/username/.kde/shutdown

Now create a script to do any stuff you like on shutdown. Here is an example:

#!/bin/bash
#clear up temp folder
rm -rf ~/tmp/*
#clear out caches
rm -rf ~/.ee/minis/*
rm -rf ~/.kde/share/cache/http/*
# delete konqueror form completions
rm ~/.kde/share/apps/khtml/formcompletions

Now make sure you set the correct permissions:

chmod ug+x ~/.kde/shutdown/cleanup.sh

(or whatever you called it). As well as cleaning up sensitive files, you can also have global shutdown scripts for all users, by placing the script in your default KDE folder, in a subfolder called shutdown. To find out which is your default KDE directory, try:

kde-config –path exe

Tags | , , ,

| |

Comments are closed.





Archives

Add to Technorati Favorites
website stats
TwitterCounter for @ukion