Renaming 'Documents' to 'documents' (lowercase)

Hi,

I have renamed my /home/user/Documents to /home/user/documents (lowercase)

However after some time I notice some program creates again an empty Documents directory and I can’t find which one.

How can I tell openSUSE to keep it lowercase and not create again Documents?
Generally is it possible to tell it to keep all default home directories lowercase (during OS install or right after it)?

Are you aware of the fact that linux is case sensitive?
Of course this can be done, one way or another. Question remains: what’s wrong with the default?

How can I tell openSUSE to keep it lowercase and not create again Documents?
Generally is it possible to tell it to keep all default home directories lowercase (during OS install or right after it)?

If you are using KDE, you can set the path to the “Documents” folder in “Configure Desktop”->“User Account Details”->“Paths”.

Other desktop environments might offer a similar setting, or modify ~/.config/user-dirs.dirs with a text editor.

Sure.

Yes, I have done that already. It is lowercase in there but the capitalized directory keeps on self-creating.

Did you logout and login after changing this? These are settings read on the desktop’s start AFAIK.

In /etc/xdg/user-dirs.default this is set too.

Can you post your ~/.config/user-dirs.dirs?
Maybe some other path is still set to ~/Documents/.

Yes, but that’s just the default, and is overridden by ~/.config/user-dirs.dirs.

The machine has been rebooted hundreds of times since then.

In /etc/xdg/user-dirs.default this is set too.


cat /etc/xdg/user-dirs.default 
cat: /etc/xdg/user-dirs.default: No such file or directory

cat ~/.config/user-dirs.dirs
XDG_DESKTOP_DIR="$HOME/desktop/"
XDG_DOCUMENTS_DIR="$HOME/documents"
XDG_DOWNLOAD_DIR="$HOME/"
XDG_MUSIC_DIR="$HOME/music"
XDG_PICTURES_DIR="$HOME/pictures"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_VIDEOS_DIR="$HOME/videos"

This most probably done by the desktop environment you use (at login into that desktop). You did not explain which one you use

You can’t. It is not an openSUSE feature, as said above it is the desktop.

Home dirctories normaly have the username as file name. Thus, when you, as system administrator, create a new user, do not use capitals in tthe username, then the home directory will also not have them in it’s name.

This last one is btw a different question from the earlier ones. The earlier ones are in the realm of the individual user and (s)he can try to bend his/her environments to her/his liking. The last question hasn’t anything to do with the desktop, but with system administration.

BTW, while it may be possible, depending on the desktop, to change names of standard desktop directories like Documents, Downloads, etc. (after all they are different when you use a different language), it may be opening a can of worms.

I use KDE.

Thus, when you, as system administrator, create a new user, do not use capitals in tthe username, then the home directory will also not have them in it’s name.

I understand that. Perhaps the question was not clear: I am asking about the directories inside the home directory.

it may be opening a can of worms.

Could you explain?

It’s /etc/xdg/user-dirs.defaults.

cat ~/.config/user-dirs.dirs
XDG_DESKTOP_DIR="$HOME/desktop/"
XDG_DOCUMENTS_DIR="$HOME/documents"
XDG_DOWNLOAD_DIR="$HOME/"
XDG_MUSIC_DIR="$HOME/music"
XDG_PICTURES_DIR="$HOME/pictures"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_VIDEOS_DIR="$HOME/videos"

Ok, then some application must create it.

I’m not completely sure how to find out which one the best way, though.

You could do a grep for “Documents” over your whole home directory, or use AppArmor to detect it.
For a start, is it created immediatly on login, or some time later when you probably manually start the “offending” application?

Well, as you noticed. Some applications might not conform to the XDG standards and still use Documents (or whatever).
Some applications might be configured to use it explicitly, or even have it hardcoded.
But you’d have the same problems when using localized names, which is actually the default.

May you should then reword your question there. When it is about not alowing some characters to be used for file names in the user’s own dataspace, I do not think that is possible. That would mean that there must be a list somewhere with those characters, out of the thousands allowed, that the user can not use. That should be handled somewhere in the Kernel I guess. And then the Kernel should throw an error when the user tries to create a file with a name that contains at least one of the list. I do not think something like that exists.

Well, I read most of the other answers. They point to several problems. And some of them might only show up in the future (when you start using a new application e.g.). And that point in the future is alwyas when youdo not think immediatly: Oh yes, that is because did so and so three-and-a-half-years ago.

And as far as I can see, you did not answer Knurpht question:

Question remains: what’s wrong with the default?

In other words, when you explain what your real goal is instead of asking about the step you are taking, we could maybe help you better.

On 06/10/15 11:06, heyjoe wrote:
>
> Hi,
>
> I have renamed my /home/user/Documents to /home/user/documents
> (lowercase)
>
> However after some time I notice some program creates again an empty
> Documents directory and I can’t find which one.
>
> How can I tell openSUSE to keep it lowercase and not create again
> Documents?
> Generally is it possible to tell it to keep all default home directories
> lowercase (during OS install or right after it)?
>
>

If your only need is to avoid having to use the shift key, then create a
documents symlink to Documents - then you (and programs) can use either
name.


PeeGee

MSI m/b 870-C45, AMD Athlon II X3 445, 8GB, openSUSE 13.2/13.1 KDE
x86_64 dual boot + Win7 Premium 64bit in VBox
Asus m/b M2NPV-VM, AMD 64 X2 3800+, 4GB, openSUSE 13.2 KDE x86_64/Win7
Premium 64bit dual boot

If you can’t lick them, join them.

I suggest, at a command line:


rmdir Documents
ln -s documents Documents

I have not tested that. Personally, I would prefer to have neither directory. But I learn to live with “Documents” and several other useless directories just to keep the desktop software happy.

Sorry. Here it is:


cat /etc/xdg/user-dirs.defaults
# Default settings for user directories
#
# The values are relative pathnames from the home directory and
# will be translated on a per-path-element basis into the users locale
DESKTOP=Desktop
DOWNLOAD=Downloads
TEMPLATES=Templates
PUBLICSHARE=Public
DOCUMENTS=Documents
MUSIC=Music
PICTURES=Pictures
VIDEOS=Videos
# Another alternative is:
#MUSIC=Documents/Music
#PICTURES=Documents/Pictures
#VIDEOS=Documents/Videos

You could do a grep for “Documents” over your whole home directory, or use AppArmor to detect it.

I tried with grep but nothing meaningful in the result. As for AppArmor - I really don’t know how to use it.

For a start, is it created immediatly on login, or some time later when you probably manually start the “offending” application?

It is some time later.
I tried to start one by one all the applications I normally use, at least the ones I could think of. Unfortunately I don’t see Documents created again, so I really don’t know what makes it.

Some applications might be configured to use it explicitly, or even have it hardcoded.

That would mean “the software is controlling the user”, no? :slight_smile:

The real goal is having in lowercase the directories which default openSUSE installation creates in /home/user.

I know. Unfortunately that is not a solution but a workaround which will only add visual clutter to directory listing. And the reason for wanting lowercase directories is exactly the opposite - to avoid visual clutter. I name all my documents in lowercase. It makes sense the user to be in control of his files, especially in home. The system files (programs etc.) can use whatever they want.

I think the software should make the user happy, not the other way :slight_smile:

The real goal is having in lowercase the directories which default openSUSE installation creates in /home/user.

Better make this a bit more precise so the work of searching for a solution can be minimized.

The creation of e new user (using YaST or useradd) involves the creation of a home directory for a user with some predefined files. They are predefined in /etc/skel:

boven:/etc/skel # l
total 60
drwxr-xr-x   7 root root  4096 Oct 28  2014 ./
drwxr-xr-x 124 root root 12288 Oct  5 22:55 ../
-rw-------   1 root root     0 May 18  1996 .bash_history
-rw-r--r--   1 root root  1177 Oct 10  2014 .bashrc
drwx------   2 root root  4096 Sep 27  2013 .config/
-rw-r--r--   1 root root  1637 Sep 12  2014 .emacs
drwxr-xr-x   2 root root  4096 Sep 27  2013 .fonts/
-rw-r--r--   1 root root   861 Sep 12  2014 .inputrc
drwx------   2 root root  4096 Sep 27  2013 .local/
-rw-r--r--   1 root root  1028 Oct 10  2014 .profile
-rw-r--r--   1 root root  1940 Dec 16  2013 .xim.template
-rwxr-xr-x   1 root root  1112 Sep 28  2013 .xinitrc.template*
drwxr-xr-x   2 root root  4096 Sep 27  2013 bin/
drwxr-xr-x   2 root root  4096 Nov  6  2013 public_html/
boven:/etc/skel #

These names contain no capitals. They are as far as I know independent of the localised/language environment.

The directories you talk about are created by the desktop environment (at least KDE does so, I guess other do and there seems to be a standard here). This is done on first login using hat desktop as a GUI (and probably checked at least at every following login). These are thus created by an/some applications (not the system) and their names are language dependent.

Saying “openSUSE defaults”, etc. is only true in the same way as saying “openSUSE plays music” when you use Amarok.

Ok, I understand. Here is as precise as possible:
I want lowercase directory names for my /home/username

Exactly as I have set them in Configure Desktop.

If (it is possible to tell KDE to make them lowercase for every next user created) - good.
If it is possible to do it during OS install - even better.
If not - I would like KDE (or whatever handles it) to respect at least my preference in Configure Desktop. For the moment I am interested only in English language names for these directories, so other locales are not important for me.

Saying “openSUSE defaults”, etc. is only true in the same way as saying “openSUSE plays music” when you use Amarok.

lol!

You could modify the /etc/xdg/user-dirs.defaults file for that.

If not - I would like KDE (or whatever handles it) to respect at least my preference in Configure Desktop.

KDE does respect the settings.
But apparently some other application creates the ~/Documents/ folder.
You have to find out which one, and then configure it to use a different one if possible.

Does just the folder get created, or does it contain some file(s) too?
Maybe the modification date/time gives a clue?

OTOH, those folders are not really relevant or widely used by applications.
You could just delete them and set all of them to $HOME (to prevent them from being recreated) if you want to “minimize the clutter in your $HOME”.
Won’t solve your problem that something creates ~/Documents/ though of course.

Do not know if the following will help much. I have openSUSE 13.1 and KDE4.
You say you run openSUSE13.2 with KDE ? So I do not know if we have the same KDE.
But In the Desktop Settings > > Pathes, I have a mix of changed and unchanged names.

/home/henk/Desktop
/home/henk/.kde4/Autostart
/home/henk/Desktop (your main culprit, or at least your example)
/home/henk/Downloads
/home/henk (that is the path to movies, apperently not realy filled in)
/hom/henk/Fotos (was Pictures I assume?)
/home/henk/Muziek (was Music I assume)

It seems that the last two where changed somewhere in the past and that the Movies one wasn’t even done very well.

henk@boven:/home/henk> ls -dl [A-Z]*
drwx------  2 henk wij    4096 23 jul 19:46 Desktop
drwxr-xr-x 29 henk wij    4096 20 mrt  2015 Documents
drwxr-xr-x  4 henk wij    4096 25 aug 21:47 Downloads
drwxr-xr-x 14 henk wij    4096 27 aug 14:58 Fotos
drwx-w---- 11 henk wij    4096  6 okt 17:37 Mail
drwx------  7 henk wij    4096 31 okt  2014 Muziek
-rw-r--r--  1 henk wij 4643341  5 apr  2015 Nepal_2014-11-13_10-13-41_h.jpg
drwxr-xr-x  2 henk wij    4096 16 feb  2015 Voorstellingen
henk@boven:/home/henk> 

shows that neither Music, nor Pictures (nor Movies) is created on KDE login.

I understand that this is of only limited value for you.

Thanks. I will do that.

I will keep watching for the potentially “disprespectful” app. I haven’t seen any files inside ~/Documents. Just an empty dir.