Author Topic: LXDE: new users don't update folder names according to locale. SOLVED  (Read 1003 times)

Offline TheGhost

  • Sr. Member
  • ****
  • Posts: 435
  • Boo!
Installed LXDE Mini, fully updated.
Ran addlocale, changed system to Spanish.
All is well. (Well, I found a few quirks, but solved most of  them.)

However, when I make a new user, the folder names in the Home folder are still in English; the script to update the names does not run.

I tried copying the desktop config file from /etc/xdg/autostart to /etc/skel/.config/autostart, but it didn't work.

A few things to notice:

- The name of the config file in /etc/xdg/autostart is now in Spanish; it says "Actualización de las carpetas del usuario". But when I attempt to rename it, the name actually says "user-dirs-update-gtk.desktop"

- If I open PCManFM as root, navigate to /etc/xdg/autostart, and double click on the file; it does run; and attempts to update the folder names for root, not for the user. So, the script is still there in /usr/bin, and it runs.

- If I copy the config file to the user, and try to run it from there, nothing happens. Also, if I try to run from the terminal the command xdg-user-dirs-gtk-update (the command that the config file runs), nothing happens.

So, how can I make the new users to run this script on first boot, and if possible, forget about it after that?

PS: I uninstalled addlocale after running it. I don't know if this is relevant.
« Last Edit: February 23, 2012, 09:27:02 PM by TheGhost »
I was once a sinner, but I have seen the light. Linux saved me!

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: LXDE: new users don't update folder names according to locale.
« Reply #1 on: February 23, 2012, 03:11:38 PM »
Why would you think copying he desktop config file from /etc/xdg/autostart to /etc/skel/.config/autostart would help? /etc/skel/.config/autostart is copied to a new user's /home/>name</.config/autostart folder. It contains the .desktop files of apps/tools that you want to start on login. Parcellite, for example, can be put there to be automatically started and give the user this clipboard manager for use on every login.     

You have a home in Spanish? Try copying the config file/folders from it to the new user. The defaults in /etc/skel are in English. When you create a new user, those are the files used to set up the new home.     

Offline TheGhost

  • Sr. Member
  • ****
  • Posts: 435
  • Boo!
Re: LXDE: new users don't update folder names according to locale.
« Reply #2 on: February 23, 2012, 03:42:40 PM »

Why would you think copying he desktop config file from /etc/xdg/autostart to /etc/skel/.config/autostart would help? /etc/skel/.config/autostart is copied to a new user's /home/>name</.config/autostart folder. It contains the .desktop files of apps/tools that you want to start on login.


That's exactly what I was trying to achieve. I hoped that when the new user was created, it would have the config file in the autostart folder, and therefore run it when logging in.



You have a home in Spanish? Try copying the config file/folders from it to the new user. The defaults in /etc/skel are in English. When you create a new user, those are the files used to set up the new home.     

I understand that. But if I give the Spanish remaster to a friend, he would have to do that with every new user he creates. I guess I could change the names of the folders in the skel directory; but... that's kind of cheating, isn't it?  ;D

The script runs after addlocale is used (at least the first time), and it's still there. I was trying to figure out if the script was supposed to run whenever a new user was created; sort of what "post-addlocale" does in KDE.
I could try to make my own script (although I know next to nothing about scripts, it doesn't look too difficult); but I still can't figure out how to make either the config file, or the "xdg-user-dirs-gtk-update" command to run from the user; so far I can only run them as root.

So, the question is: does the update script runs only once, after addlocale; or it should run every time a new user is created?
I was once a sinner, but I have seen the light. Linux saved me!

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3794
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: LXDE: new users don't update folder names according to locale.
« Reply #3 on: February 23, 2012, 03:47:18 PM »
try addlocale for root, too...
Maybe it will help.

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: LXDE: new users don't update folder names according to locale.
« Reply #4 on: February 23, 2012, 04:02:52 PM »

Why would you think copying he desktop config file from /etc/xdg/autostart to /etc/skel/.config/autostart would help? /etc/skel/.config/autostart is copied to a new user's /home/>name</.config/autostart folder. It contains the .desktop files of apps/tools that you want to start on login.

That's exactly what I was trying to achieve. I hoped that when the new user was created, it would have the config file in the autostart folder, and therefore run it when logging in.
     
You missed the boat there. New users' desktops are created from /etc/skel, not /etc/xdg.     

Quote

You have a home in Spanish? Try copying the config file/folders from it to the new user. The defaults in /etc/skel are in English. When you create a new user, those are the files used to set up the new home.     

I understand that. But if I give the Spanish remaster to a friend, he would have to do that with every new user he creates. I guess I could change the names of the folders in the skel directory; but... that's kind of cheating, isn't it?  ;D
     
Why would that be cheating? ??? ::) That is what /etc/skel is used for.     

Quote
The script runs after addlocale is used (at least the first time), and it's still there. I was trying to figure out if the script was supposed to run whenever a new user was created; sort of what "post-addlocale" does in KDE.
I could try to make my own script (although I know next to nothing about scripts, it doesn't look too difficult); but I still can't figure out how to make either the config file, or the "xdg-user-dirs-gtk-update" command to run from the user; so far I can only run them as root.

So, the question is: does the update script runs only once, after addlocale; or it should run every time a new user is created?
     
When a new user is created, their desktop (home & etc) is created from the files and folders in /etc/skel. If those are in English, the new /home/>user< will be in English. Perhaps you should do as Leiche says and run addlocale as root.     

Offline TheGhost

  • Sr. Member
  • ****
  • Posts: 435
  • Boo!
Re: LXDE: new users don't update folder names according to locale.
« Reply #5 on: February 23, 2012, 04:38:54 PM »

Why would you think copying he desktop config file from /etc/xdg/autostart to /etc/skel/.config/autostart would help? /etc/skel/.config/autostart is copied to a new user's /home/>name</.config/autostart folder. It contains the .desktop files of apps/tools that you want to start on login.

That's exactly what I was trying to achieve. I hoped that when the new user was created, it would have the config file in the autostart folder, and therefore run it when logging in.
   
You missed the boat there. New users' desktops are created from /etc/skel, not /etc/xdg.    
  

Well, I copied the script from /etc/xdg to /etc/skel, so that the script would be in the new user; so skel would do what it's supposed to do.

By the way I did a test removing the folders from /skel and seeing if they were created from /etc/xdg/user-dirs.defaults; like KDE does. (All this is a test installation, I am trying to learn how LXDE works.)
The folders were not created. So, I got that, unlike KDE, LXDE only uses the /skel folder when creating the new user.
In KDE, I can remove the folders in /skel, and let /xdg create them. And since the user-dirs.conf file calls for the locale, the folders in the new user are created in Spanish.
In LXDE, I need to work inside the skel directory only; so that's what I am learning to do.

On a different hand, all the system is already in Spanish - addlocale did that -, meaning that PCC or PCManFM as root are showing in Spanish. The only things that are still in English are the folders in the "root" user; I intentionally have not changed them to Spanish - I cancel the update script when it runs - so I can see whether any test I do affects the root user or not.
I'll try running addlocale from root; see what happens.

So, the key question is my final question in my previous post: does the update script runs only once, after addlocale; or it should run every time a new user is created?
« Last Edit: February 23, 2012, 04:43:24 PM by TheGhost »
I was once a sinner, but I have seen the light. Linux saved me!

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3794
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: LXDE: new users don't update folder names according to locale.
« Reply #6 on: February 23, 2012, 04:43:19 PM »
no, i mean login as root, and run addlocale...

Offline TheGhost

  • Sr. Member
  • ****
  • Posts: 435
  • Boo!
Re: LXDE: new users don't update folder names according to locale.
« Reply #7 on: February 23, 2012, 04:47:08 PM »
no, i mean login as root, and run addlocale...

Yes, that's what I will do. Let's see what happens

This is exciting...  8)
I was once a sinner, but I have seen the light. Linux saved me!

Offline TheGhost

  • Sr. Member
  • ****
  • Posts: 435
  • Boo!
Re: LXDE: new users don't update folder names according to locale. SOLVED
« Reply #8 on: February 23, 2012, 09:38:59 PM »
Ok, I figured it out.

It was a dumb - but kind of accidental - mistake on my part.

When I was doing changes to the /etc/skel directory (I have made some cosmetic changes that I want to keep for all new users), I "accidentally" removed the following directory: /etc/skel/.config/pcmanfm.

I had kept the original skel, and I found that the script did run properly if I used the original skel.
So, I checked for differences, and found that the /pcmanfm folder was missing.
Restoring it solved the behavior; now new users get asked whether to update the folder names to the Spanish locale on first login.

In my defense, I'd say that I hadn't thought of that, because I don't see anything making reference to a locale in any files in that folder.

But it's all working now. All is well that ends well.

And it's been a fantastic learning experience.

Thanks Neal and Leiche for your guidance. Unfortunately, you haven't heard the last of me; I plan to keep testing LXDE (I LOVE it so far) so I'm bound to ruin it eventually.
So, ominously, I'll be back.
I was once a sinner, but I have seen the light. Linux saved me!

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: LXDE: new users don't update folder names according to locale. SOLVED
« Reply #9 on: February 23, 2012, 11:18:12 PM »
Quote
In LXDE, I need to work inside the skel directory only; so that's what I am learning to do.
     
As I told you. ;) ---     
LXDE is not KDE. It does not use /etc/xdg to set up new user environments.     

Here is a tip for you:     
Knowing how kde works does not give you advance knowledge on how lxde works. The two DEs have differences that can cause you problems, if you make the assumption that they are the same. The deleting of /.config/pcmanfm and/or other .config files/folders from /etc/skel for instance. It is better to ask than to assume that doing something like you would with kde will work with lxde.