[SOLVED] KDE decided that my home is in ~/Documents
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I will write ~ for the full path to my home directory, for brevity.
A few days ago my KDE session suddenly decided that my home is in ~/Documents. Unfortunately, I cannot pinpoint the reason. Text console and WindowMaker (via kdm) logins go into ~ as usual, but anything starting in KDE would be in Documents. I tested with Alt-F2 and starting programs via tried-and-true shortcuts. I do not use the folder Documents for anything, and even if I did, I don't understand why it has to be the default starting point for the shell. I went into System Settings, About Me, Paths (thanks Untitled_No4), and replaced Documents path ~/Documents with ~. Now KDE starts in ~. That alone is enough to convince me that it is a bug.
I noticed that konsole starts from ~ regardless of where you run it from, so I think that is how the bug may have crept in. I use xterm, which honestly starts in the current directory.
This post is a copy of the one I made in Ububtu forums overhere, where the same problem is described, but no clear solution or explanation is given. Let me know if you are having the same problem and how you deal with it.
What KDE version are you running? It may not be too pertinent, but would help to cross-check against known-bugs. Also, have you tried logging in as root? Try booting into a lower runlevel, instead of a graphical login. Some more information would be useful in proceeding further.
The thing you're talking about, "tilde-expansion", is strictly a function of the shell (e.g. "bash"), and not KDE.
HOWEVER:
It's possible that maybe your KDE environment is modifying your "$HOME" environment variable to "$HOME/Documents".
SUGGESTION:
1. Start KDE
2. Start a terminal session
3. Type "echo $HOME"
4. Type "echo ~"
If my theory is correct, then 3) and 4) should both say something like "/home/myname/Documents". At which point the easiest solution would probably be to "grep" through the KDE initialization files for "HOME" to see which one(s) might be overriding the default definition.
Thanks guys. I am running KDE 4.4.3 on 13.1 x64. Everything is very vanilla.
Sorry about the tilde confusion. Every time I wrote tilde above I literally meant /home/myname, I was just trying to be brief.
How about this, see if you can actually re-create it. Here is what I can do without even logging out of KDE. I just follow these steps and I get these results.
1. Remove /home/myname/.config/user-dirs.dirs , Alt-F2, type /usr/bin/xterm , Enter. It starts in /home/myname/Documents . echo $HOME says /home/myname .
2. System Settings / About Me / Paths / Documents path is set to /home/myname/Documents (default, I am assuming), change it to /home/myname , Apply, Do not Move. Start xterm just as before, it starts in /home/myname . echo $HOME says /home/myname . A file /home/myname/.config/user-dirs.dirs appears with a single line: XDG_DOCUMENTS_DIR="$HOME" .
3. Back in System Settings / About Me / Paths , hit Defaults (Documents path is set to /home/myname/Documents), Apply. Start xterm just as before, it starts in /home/myname/Documents . echo $HOME says /home/myname . File /home/myname/.config/user-dirs.dirs now says XDG_DOCUMENTS_DIR="$HOME/Documents".
4. Ooooh, here we go. Changing the Documents path to an existing directory makes that the current directory for KDE (programs start there). Changing it to a non-existing that is not Documents makes xterm start in /home/myname . And the best one: changing Documents path to /home/myname/Documents when the directory is missing makes xterm start in /home/myname/Documents , which actually dumps me into a non-existing path.
Note that this is not limited to xterm. I tried other programs, including non-shells such as gimp and a simple "/usr/bin/pwd > /tmp/pwd". It all checks out. This affects the starting location of Alt-F2 and all the existing shortcuts with empty work path.
But, I guess, no one will care, as KDE is already in 4.5.1. Anyway, my preferred work-around is to change the Document path to my actual home. It is because of wonders like these that I keep my actual documents where KDE cannot find them : )
Last edited by qweasd; 09-13-2010 at 03:25 AM.
Reason: posted before finishing editing
I thinks it's best if you know for sure this is a KDE problem. See if you can recreate this in another WM. Again, have you tried to log in as root? Also, have you got both /etc/profile and a $HOME/.bash_profile?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.