You are not logged in.

#1 2009-08-08 19:07:08

Shapeshifter
Member
Registered: 2008-03-11
Posts: 231

Put your $HOME in .home!

Well, just a little something I've been doing for half a year now, which I find very smart. >.>

my $HOME is in /home/shapeshifter/.home

That means that all the apps will put their dotfiles in the .home folder, instead of trashing my "real" home folder. I have all the folders I like in /home/shapeshifter, like docs and images and whatever, but the configs and dots go all in .home. Brilliant I think! smile

To do this you just tell adduser or whatever user creation method you use to use .home as the home folder instead of the default one. Also, put this in your .bashrc:

cd /home/username

So now when you open a terminal, you don't end up in that uninteresting $HOME of yours but in the tidy place. unless you're a tilde (~) user, which I am not, everything will work as ever. Scripts will not be disturbed by this as non-interactive bash sessions don't read .bashrc.

Simple, and very tidy. Only problem: Some gui apps, like e.g. the gtk dialogs will open up .home as default thinking that it is the folder of interest. I pretty much suspect that there's a way of telling them to use the actual home folder as a start instead of .home, but I really don't care yet, and I've been doing this for a while.

So, this is just a little tip some people may have not thought of, and it really makes your home folder a lot tidier!

Last edited by Shapeshifter (2009-08-09 21:30:13)

Offline

#2 2009-08-08 19:48:36

Pyntux
Member
From: Serbia
Registered: 2008-12-21
Posts: 398

Re: Put your $HOME in .home!

Or you can even tell your user to use home folder for example on other partition, like me. My home dir with config files is on /files/home, but my /home is just home for data! wink


I do not speak English, but I understand...

Offline

#3 2009-08-08 19:55:19

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: Put your $HOME in .home!

Or more developers could begin making their applications write configuration in $XDG_CONFIG_HOME, where it should really go.

Last edited by Wintervenom (2009-08-08 19:56:10)

Offline

#4 2009-08-08 20:01:50

XFire
Member
From: UK
Registered: 2008-05-11
Posts: 192

Re: Put your $HOME in .home!

Wintervenom wrote:

Or more developers could begin making their applications write configuration in $XDG_CONFIG_HOME, where it should really go.

I like ^^ way more.


There is a difference between bleeding [edge] and haemorrhaging. - Allan

Offline

#5 2009-08-08 20:22:30

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Put your $HOME in .home!

Or you can have a relatively small /home partition for configs and have a data partition which you mount at /mnt/data
That's the way I do it...


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#6 2009-08-08 20:23:29

Shapeshifter
Member
Registered: 2008-03-11
Posts: 231

Re: Put your $HOME in .home!

Wintervenom wrote:

Or more developers could begin making their applications write configuration in $XDG_CONFIG_HOME, where it should really go.

I agree 100%. Unfortunately, this is not reality. Until then, the "fix" I use, works ^^

Offline

#7 2009-08-08 21:30:41

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: Put your $HOME in .home!

That's a good idea.

It seems like it would not be hard to patch every program, although it's probably beyond Arch's purview.

Offline

#8 2009-08-08 23:35:30

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: Put your $HOME in .home!

Good thinking.  In KDE I know you can tell Dolphin to use anything as home directory.  Been thinking about this awhile why linux doesn't just create a config directory.


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#9 2009-08-09 06:17:20

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: Put your $HOME in .home!

Gen2ly wrote:

Good thinking.  In KDE I know you can tell Dolphin to use anything as home directory.  Been thinking about this awhile why linux doesn't just create a config directory.

It has one. hmm The question is why so many programs ignore it.

Offline

#10 2009-08-09 07:10:46

xd-0
Member
From: Sweden
Registered: 2007-11-02
Posts: 327
Website

Re: Put your $HOME in .home!

Wintervenom, could'nt agree more! Have very often got irritated about applications storing data in the "wrong" places. Perhaps it's time to start sending in some bug reports wink

Offline

#11 2009-08-09 08:13:12

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: Put your $HOME in .home!

Hmm, I might set $HOME to $XDG_CONFIG_HOME…

Offline

#12 2009-08-09 13:27:25

SpeedVin
Member
From: Poland
Registered: 2009-04-29
Posts: 955

Re: Put your $HOME in .home!

Barrucadu wrote:

Hmm, I might set $HOME to $XDG_CONFIG_HOME…

I think I will to the same but how do that apps will save their config files in $HOME/.config?

Last edited by SpeedVin (2009-08-09 13:27:47)


Shell Scripter | C/C++/Python/Java Coder | ZSH

Offline

#13 2009-08-09 14:49:16

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: Put your $HOME in .home!

SpeedVin wrote:
Barrucadu wrote:

Hmm, I might set $HOME to $XDG_CONFIG_HOME…

I think I will to the same but how do that apps will save their config files in $HOME/.config?

If I keep $XDG_CONFIG_HOME set to /home/barrucadu/.config compliant apps should still work.

Offline

#14 2009-08-09 14:56:59

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Put your $HOME in .home!

If you set XDG_CONFIG_HOME and HOME to the same, won't you have both directories with and without dots? That can't look good.

Offline

#15 2009-08-09 15:11:25

SpeedVin
Member
From: Poland
Registered: 2009-04-29
Posts: 955

Re: Put your $HOME in .home!

Barrucadu wrote:
SpeedVin wrote:
Barrucadu wrote:

Hmm, I might set $HOME to $XDG_CONFIG_HOME…

I think I will to the same but how do that apps will save their config files in $HOME/.config?

If I keep $XDG_CONFIG_HOME set to /home/barrucadu/.config compliant apps should still work.

Where can I set this globally or I have to configure manually all my apps to store config files in $HOME/.config ?


Shell Scripter | C/C++/Python/Java Coder | ZSH

Offline

#16 2009-08-09 16:37:19

Acecero
Member
Registered: 2008-06-21
Posts: 1,373

Re: Put your $HOME in .home!

This sounds more complicated then it needs to be, there should be a standard that tells what devs to do with the dot config files in the first place.

Offline

#17 2009-08-09 18:10:21

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: Put your $HOME in .home!

Acecero wrote:

This sounds more complicated then it needs to be, there should be a standard that tells what devs to do with the dot config files in the first place.

There is. Unfortunately, people don't follow it. User specific files should be stored in $XDG_CONFIG_HOME, if unset, ~/.config should be used.

Offline

#18 2009-08-09 18:18:16

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Re: Put your $HOME in .home!

Some people don't follow it, some projects are dead and won't change it... I've found some projects that don't even put a dot in front of the folder name.

I've been using the same solution from the creator of this topic.


(lambda ())

Offline

#19 2009-08-09 19:29:11

Baraclese
Member
Registered: 2008-05-28
Posts: 48

Re: Put your $HOME in .home!

I've never heard about $XDG_CONFIG_HOME before but it makes so much sense, I've always been annoyed by the clutter of .* in my home directory.

Offline

#20 2009-08-09 21:20:02

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,643
Website

Re: Put your $HOME in .home!

Interesting... I haven't messed with environment variables before.  How can one change $HOME to this paradigm of /home/USER/.home without roaching things?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#21 2009-08-09 21:23:53

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: Put your $HOME in .home!

Try setting it in your ~/.bashrc (or whatever). I haven't tried it yet, so I don't know if that works.

Offline

#22 2009-08-09 21:26:28

Shapeshifter
Member
Registered: 2008-03-11
Posts: 231

Re: Put your $HOME in .home!

graysky wrote:

How can one change $HOME to this paradigm of /home/USER/.home without roaching things?

If you're not setting the user up from scratch, you can simply edit /etc/passwd where you'll find a line like:

shapeshifter:x:1000:100:,,,:/home/shapeshifter/.home:/bin/zsh

Change the path in the middle to your desired directory, and then move all your configs to it right after, or you'll make a mess of things. Or you can play safe and instead of editing a file you can do

usermod -d your-new-desired-home-path

and again move the configs.

Offline

#23 2009-08-09 21:29:33

Shapeshifter
Member
Registered: 2008-03-11
Posts: 231

Re: Put your $HOME in .home!

Ohhhh, most important bit about the whole deal I forgot to mention in the first post (added it now):

Put this in your .bashrc:

cd /home/username

So now when you open a terminal, you don't end up in that uninteresting $HOME of yours but in the tidy place. unless you're a tilde (~) user, which I am not, everything will work as ever. Scripts will not be disturbed by this as non-interactive bash sessions don't read .bashrc.

Offline

#24 2009-08-10 08:29:54

SpeedVin
Member
From: Poland
Registered: 2009-04-29
Posts: 955

Re: Put your $HOME in .home!

Shapeshifter wrote:
graysky wrote:

How can one change $HOME to this paradigm of /home/USER/.home without roaching things?

If you're not setting the user up from scratch, you can simply edit /etc/passwd where you'll find a line like:

shapeshifter:x:1000:100:,,,:/home/shapeshifter/.home:/bin/zsh

Change the path in the middle to your desired directory, and then move all your configs to it right after, or you'll make a mess of things. Or you can play safe and instead of editing a file you can do

usermod -d your-new-desired-home-path

and again move the configs.

Ohh thanks that work's I got clean home directory wink
I got one question about bash.
Bash use config's from /home/user or /home/user/.home can I delate them form my /home/user?

Last edited by SpeedVin (2009-08-10 08:37:51)


Shell Scripter | C/C++/Python/Java Coder | ZSH

Offline

#25 2009-08-10 09:39:32

scj
Member
From: Sweden
Registered: 2007-09-23
Posts: 158

Re: Put your $HOME in .home!

Or you could try something like libetc

Offline

Board footer

Powered by FluxBB