Which application should I blame for compulsively creating a directory again and again?

There’s an application on my system which keeps creating an empty ~/Desktop directory again and again. I can’t stand capital letters in my home, nor I can stand this “desktop” thingy. So, as picky as I am, I remove the directory each time I see it. I’d really like to know which application is responsible for that (probably some application I won’t use so often¹).

Any good ideas to track down the culprit?



1. Obviously I’d like to get rid of it, or maybe patch it if I can’t live without it.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

This directory might be created by any application that follows the Freedesktop userdirs standard. That potentially includes all Gnome or KDE applications.

If you want to know which application creates the file, you can use the LoggedFS filesystem or the Linux audit subsystem. See Is it possible to find out what program or script created a given file? for more information.

Method 2

This looks like a directory from one of the free desktop standards. Any application compliant with it could be creating it.

Those “standard” directories can be specified in $HOME/.config/user-dirs.dirs. You can change the name there not to start with a capital letter and to be hidden somewhere, but getting totally rid of will be difficult.

There is one program (xdg-user-dirs-update) whose aim is to create those directories, see xdg-users-dirs. If should be able to deactivate it by having a $HOME/.config/user-dirs.conf containing

enabled=False

Method 3

If you’re a complete graphical environment on your box (X and some desktop environment like Gnome or KDE), it’ll undoubtedly a process of your desktop environment. It’ll probably create the Desktop directory each time you log in. The process responsible for creating the directory is completely dependent on which desktop environment you’re running.

Method 4

On Debian and Ubuntu you could see that there is an entry user-dirs-update-gtk.desktop in /etc/xdg/autostart/.

Removing that entry prevents from creating user directories again.

Been a thing coming from freedesktop standard, it is probable that this works in other distros too.

Method 5

If the application is still running, you may be able to find an open file in that directory using lsof. Since the directory is only part of the filename, i don’t think you’d be able to use it as lsof’s parameter, so you’d need to grep for a part of it.

lsof | grep $HOME/Desktop


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x