login in for the first time ..populating ~/Desktop

When a user logs in for first time a few things get put in /home/username/Desktop
How can I stop this happening ( it doesn’t seem to come from /etc/skel )




First, as we are nopt clairvoyant, please allways tell which version of openSUSE you are using. You may think it is not relevant for your question, but after all you try to ask people with some knowledge, so give them all the deetails and let them decide if it is of interest.

Second, as you talk about the ~/Desktop directory, we can assme that you mean that the user logs in in the GUI, going to use some desktop environment. Allways tell which of the many different deskop environments (DE) this is about: KDE, Gnome, …

You can prevent this happening by not using a desktop environment. But that is probably not what you want. The creation and populating of not only ~/Desktop, but a few more, is desktop dependant, thus stating which DE you are talking about, may help getting people here that know about how that particular DE does this.

And of course, be aware that all those directories are used by the DE. Deleting (or not creating) them might have a bad influence on their functionality.

Not that much is put in ~/Desktop. ~/Desktop itself is created by xdg-user-dirs-update (which is started by /etc/X11/xinit/xinitrc.d/xdg-user-dirs.sh everytime X is started). There has been recently a thread about this http://forums.opensuse.org/english/get-technical-help-here/install-boot-login/477147-adding-users-what-creates-their-default-subdirectories-suse-11-4-a.html. Read the answer in post #6.

12.1 and KDE 4.8.4 - Sorry about that
I want the directories created I just don’t want anything put in them


Hmmm there are many files both normal and hidden the are needed for a normal operation. I don’t think it is possible to have a completely empty home


It’s only ~/Desktop I would like empty. To make a short story long :slight_smile: KDE has a
bug ( or a feature there appears to be some debate on this ) that it doesn’t show
the correct icons when the users home directory is on a nfs share. So when people
log in for the first time the desktop folder shows cogs not the icons for firefox
my computer etc which looks terrible and gives a poor first impression of suse/kde
You can however drag things from the kicker menu and link them in the desktop
folder and the icons show correctly. Rather than have to explain to people that to get
a pretty desktop they need to delete the items in the Desktop folder it would be
easier for it to be empty in the first place.


I have even removed that rectangular part of the screen with some icons in it completely. I do not even understand where I need it for??? But that may be very personal :wink:

And BTW I see something like you mention as a bug. An application like KDE should not have any knowledge about the way things are mounted, NFS or not.

You’re not describing a bug, not even a problem. If you don’t want to see icons in ~/Desktop, don’t put files in this directory. As for Home and Trash, you can use something like this to make them all go:

for item in ~/Desktop/*.desktop ;  do
        sed -i 's|OnlyShowIn=KDE;|NotShowIn=KDE;|' $item

If it doesn’t work, just add this line in ~/Desktop/Home.desktop, ~/Desktop/Trash.desktop (an other .desktop files you might have there):


Other desktops have a setting to hide or show these icons. This might explain why my example already includes the line:


I might have disabled them in Xfce.

Or … just remove that indeed useless ‘rectangular part’ ! :wink:

This is full of nice suggestions, that can help the OP. But I think his problem is not that “If you don’t want to see …” where “You” is one particular end-user (aka the OP himself), but it is a system manager (the OP) who wants that all the end-users he introduces in his system(s) do not have see-able items when they do their first login in KDE. This would mean that your “remove statement” must be run asap after that first login. (I do not know if then the end-user is allowed to add icons him/herself, which would mean that the “remove statement” must not be run at subsequent logins).

In any case, I would concentrate on the original problem: an NFS mount would influence these icons. But that is up to the OP.

He might want to take a look in /usr/share/kde4/env/startkde.suse.sh. There are a lot of things that get copied from /usr/share/kde4/config/SuSE/default into user’s ~/Desktop. You could hack this script or remove (some of) these files. I actually don’t seem to have this problem while using my own KDE skeleton. Hmmm … I see… Try to create an empty /etc/skel/Desktop and add a new user, then log in as this user in KDE for the first time. Does it work?

Ah ha ! … /usr/share/kde4/env/startkde.suse.sh seems to be the cookie, I can chop some bits out of that …many thanks

BTW the reason for this is https://bugs.kde.org/show_bug.cgi?id=178678 … perhaps it might have helped if I said in the first place this rather than my convoluted question

Anyway thanks again