 So in a few of my videos you've heard me talk about my home directory problem in fact I've made several videos specifically about my home directory and the mess that it's in I've talked about how it's a pet peeve of mine that developers constantly take configuration files that are supposed to be in dot config and put them in the home directory just because they can It drives me absolutely bonkers and as you guys have probably seen in recent videos My home directory looks like this. It's absolutely insane I've given up on this problem now You can use tools like XGD Ninja which I've made a video about that will help you move things that can be moved but the problem is that not everything can be moved and you have to do a good job of Staying on top of it because every time you install something new Chances are that program is going to shove something in the home directory It's going to drive you nuts if you care at all now a lot of people just don't care about this problem They don't look at their home directory or they don't have the hidden files feature in their favorite GUI file manager turned on So most of that stuff is out of sight out of mind. They just never see it But for me I spend the vast majority of my time when I'm dealing with the terminal or in file managers in the home directory that's where I am most of the time because it's the home directory and I always have the hidden files turned on in GUI file managers and I and when I do an LS in The terminal it shows me everything of course, right? So I see those dot files dot files all the time and it bugs me So I have just kind of given up on this problem at least until yesterday So the other day in one of my videos a commenter and I I'm sorry. I forgot your name as I told you that I would forget your name. I'm sorry Told me what they did for this problem and it was pure Brilliance like seriously. I feel so stupid for not coming up with us that it's shameful But the idea here is Like I said shockingly simple is just use a different home directory Let all the developers do whatever they want with the dedicated default home directory But create yourself a directory that you consider home Set it as your home for the things that you deal with the most And then just treat that as your home directory Allowing the other one to fill up with as much cruft as you as developers want to fill it up with You never have to deal with it or at least you don't have to deal with it nearly as often All that stuff really is it's kind of the equivalent of putting newspaper over the spilled milk The problem's still there, but you're really really never going to see it if you treat this new directory As your home directory. So that's what I've done. I've been messing around with it now for over a day and I've Got it mostly set up the way that I like it So I'm going to walk you guys through what I've done here and see So I'm going to show you how it works and I'll talk about some pros and cons of doing this because there are some downsides to this It's not necessarily something you're always going to want to do on every computer that you own It does require some workarounds. Let's just put it that way So let's go ahead and talk about what I've done to fix my home directory problem before I do If you leave a thumbs up on this video, I'd really appreciate it. It really helps the channel So let's go ahead and take a look at my desktop again And like I said, this is my traditional home directory The one that is installed with open suzer when I installed it and I've been using open suzer now for 195 days. I'm coming up on 200 days. I'm Working through my two-year challenge. I'm still very happy with open suzer In 195 days, as you can see with my home directory, it's it's developed quite a bit of cruft There's a lot of stuff in there Some of it I could get rid of and delete because it's either for for Applications that I don't use or have long since uninstalled So I could do some cleaning and clean this up just a little bit But I won't be able to get rid of all of it. So what I've done is I've actually created my own home directory And I call it m home now This is the first kind of tip that I'd give you if you're going to do this call your directory something other than home because you already have a home directory now you can I believe call your new home directory just home because the paths are going to work fine But it might be confusing somewhere down the line. So I named it something a little bit different Just called it m home for mat home and that was fine for me Like I said, it might get confusing if you name them both home So another thing before I continue an eye that I should mention is that you can The environment variable actually change where linux thinks your home directory is That's not what we're doing here. And there's a reason why if you were to use that environment variable to Set your home into a different place Basically what linux is going to do is just treat treat that new place as your home directory So you're not actually solving the problem every time you install something stuff's going to get shoved into that new home Directory you're going to have the exact same problem just in a different location So what I'm talking about here is that we're actually bypassing that we're we're keeping The default home set as it is just like you would on any linux distribution But we're creating a different directory that we're going to treat as home So if I do an ls here, you'll actually see That it's a much cleaner experience. All I have is the regular directories that I would have in a very low key Home directory and I'm going to move some more stuff in here I'm just kind of testing the waters just want to make sure everything's working and Some of the changes that I want to make are going to require a little bit more work And I'll talk about that here in a minute, but as a start This is obviously much more clean Than what you did, you know, than what I showed you earlier, right? So all I have right now is what six or seven directories in there No hidden files whatsoever and it is pristine Now obviously there's more to this than just creating a new directory and moving all of your xdg dirs into that directory It's more complicated than that So once you've created your new home and moved all of the directories you want to move to it You'll want to make sure that linux knows that's where those directories are specifically the ones that fall under the xdg dirs Classifications so things like desktop documents downloads music pictures videos and template those are the I think that's seven different Directories you'll want to make sure you tell linux exactly where those the new location of those directories are Otherwise, it's just going to create them again the next time you boot up in your real home directory So you go into your dot-config file and you'll see a directory that's called user dirs dot dirs So you're going to them into that like so and this is what this directory or file looks like And basically what you want to do here is change the location path for all of these Different directories so you want to make sure your desktop directory is in your new home directory Your your download directory is in your new home directory and so on and so forth This way when you go into a file manager that has or respects xdg xdg dirs And you click downloads it'll take you to the proper download folder It's not just going to create a new one in your default home directory So by setting this you're ensuring that linux uses the new location for these specific directories Which is precisely what you want to do now That's just the first step and the this is out. This is right here is the most important step Probably because if you don't do this it's going to continue to try to use The old paths for these directories. So that's the most important step Another one that you'll want to do is set an alias So if you go into your bash rc or your zshrc or your fish alias Wherever the hell they store those things. I don't even know I didn't use fish for very long So I don't remember anything about fish But anyways you go wherever you set aliases in so it's usually your bash your zshrc And you want to set a alias that looks like this here. So alias cd to cd Then the path to your new home directory that way when you press cd It's actually going to take you to your new home directory And not to your default home directory like it would traditionally do so this way you're always going to be able to have Your new home directory as your home So that will prevent you from accidentally cd-ing into your default directory when you meant to go into your new home directory Now this does present one very large pitfall if you are going to set this alias Anything that you need to cd into you're going to need to do so With a trick So if I were to go cd into till the slash dot config Like so i'm going to get an error cd too many arguments. What's going on there? Well, I have an alias And it's basically this is the equivalent of cd My new home directory and then dot config it's actually trying to cd into two directories at the same time And that obviously does not work. That's not the way cd actually works So what you're going to need to do here is actually use an escape patch So you want to do a backslash And then the command that you want to do in this case cd that's going to bypass the alias And then you can cd into dot config and now I'll take you into dot config So this is one of the pitfalls that you're going to discover if you're going to do this is that you have to do This every time you want to use cd. It's a mess now What you could do and what i'm thinking about doing is just making it so that when I want to go home I have a different command. So I like if I did a gh command or a gh alias I could make that my new cd And use that every time I want to go home and then just leave cd alone I would just use cd to go into specific directories instead of the home directory And if I wanted to go home, which would be my new home, I'd use gh So that's that's one workaround you could get by that way You wouldn't have to use the escape hatch in order to actually use cd every time you want to use cd So just to keep that in mind if that's if you end up doing this like I am Another kind of weird thing that you're going to have to do is because a lot of stuff is still going to reside in your Home directory. So if we do an alice here in my actual home directory like my default home directory, there's still a lot of stuff here and Unfortunately, I'm still going to be able to have to get to this stuff And because I'm not going to be spending much time in this directory here Most of the time I'm going to have to provide it a different path than normal So usually what I want to do if I'm going to cd into dot config I need and I'm at and I'm at home So if I go if I go to my new home and I want to cd into dot config that's what What I would normally Type right because I'm usually in the home directory But because I'm not in the default home directory This command doesn't actually work unless I were to move dot config To my new home directory, which I haven't done But so what I'm going to actually have to get used to doing is no matter where I'm at providing the actual Path, so I'm going to have to do this and again. I'm going to have to have that Escape hatch if I want the cd to actually work So there are some kind of downsides to doing this It's going to require some Retraining of your muscle memory if you're going to do this and you're going to have to to perform some Workarounds in order to make this actually work for you and I've only been using this for a day So there actually may be more workarounds that I'm going to need to do if I'm going to do this long term, right? So Over time I may discover that there's something that really doesn't work this way And I'm going to have to kind of adapt as that goes along But over the course of the last day, I haven't discovered anything that's like a deal breaker mostly it's just the matter of Making sure that I'm cd-ing into the right directory so always paying attention where I'm at And ensuring that I'm not deleting or moving things that I don't want to delete or move Which I do anyways for the most part. So it's not that big a deal. So there's another couple things that I want to do So first is going to be messing around with my GUI file manager. So this right here is crusader And crusader is obviously the best file manager. I don't want to hear any arguments against it It's the best it's the apps the best file manager that has ever existed And what I want to do next that I haven't figured out how to do quite yet is to make sure to Set crusader to always treat my new home directory as the home directory Or at least as the default directory I haven't figured out how to do that yet except gone through the settings and it doesn't appear that that's actually in there Almost certainly somewhere along the line. I can do that. I just don't know where yet There's so many settings that I have to kind of troll through them But the idea here is that if I were to press the home key here It wouldn't actually take me to home. It would take me to my new home now if I can't do that what I can do is set a Favorite to my new home directory and just keep that up here with the rest of my favorites And that would be fine, right? It's not necessarily what I want to do But I could do that that way if I needed to now a lot of other file managers that which are Not as good as crusader, obviously Do have the ability to have things pinned to a sidebar or they're called favorites So crusader has favorites, but they're kind of buried in the menu for a lot of different file managers So if I were to open up Thunar along the side here, I have a whole bunch of things that say places So so if I wanted to I could right click on this click send to and then hit side pane It would actually add my new home directory to The side panel over here so I could easily get to it Right and almost every gooey file manager has something like that Some of them lets you put it in their actual places. Some of them call them just bookmarks It really does depend on what what file manager you're actually using So another thing that I want to do actually is set the location of dot config So this is going to be a two pronged effort and the reason why I haven't done it yet Is because it's going to be quite tedious to do because first off I have a whole bunch of if I do an ls here You'll see that I have actually I have a whole bunch of sim links to This directory or into this directory. So I have you know, like i3 is here Pycom X monads here, which I'm using right now Qtile ranger A whole a whole bunch of stuff and if I were to do move my dot config to my new home directory All those sim links would probably be broken somewhere along the line Almost definitely something would go way bonkers and I'd be an unhappy camper So I'm going to change all of those to make sure that they're properly linked Another thing that I'll need to do is actually set the proper environment variable to change my the location of dot config so there is a An environment variable that you can set that will tell linux where your dot configuration file is that way when you install a new Application and the developer of that application has properly Done things and they want to store files in your dot configuration directory They can know where that particular configuration file actually is or that configuration directory actually is so You set this environment variable. It'll tell linux where your dot config actually is It doesn't have to be in your traditional home directory. You can put it wherever you want So that's another thing that I'm going to do eventually Like I said, it's going to take a little bit of time to make sure that everything stays up and running the where it's supposed to Supposed to also as you can see my dot config here is really really really freaking bloated It has a ton of stuff in it now over half of the stuff that comes from kde Thank you kde for continuing to be very very bloated But that's beside the point So i'm a little cautious about actually putting my dot config in my shiny new very clean home directory Because this is such a mess. I don't know if there's a half and half way I could use it like I could create a brand new config directory and just you know point What applications I want to use towards that. I don't know if that's possible Yeah, I'll have something I'll have to look into But I'm a little weary of putting something that's this messy in my brand new home directory because my home directory like I said looks like this and That's the cleanest thing you've ever seen and I could add some hidden files So then I probably will because I can just if I need to hide some stuff also If you watch my snap videos, you or you watch my snap video I should say you know that I hate the fact that there's a snap directory in my home directory Well, I don't see that anymore. It's gone poof. It's like magic. It's fantastic. So That's what I've done and like I said it it it's only been a day So there's it's very well that there could be some pitfall that's you know coming up on me real fast And I don't know about it But so far this has worked really really well And I think that any pitfalls that do come up I'll be able to work around, you know fairly easily because I should be able to do that anyways, so Overall again, I apologize for not knowing the Commenter who told me about this trick But this is brilliance other brilliance and while there are some things that I have to do to kind of work around the traditional workflow I think I'll get used to those things and I might come up with other tricks as I go along to get past those And maybe in the comment section below you guys will have some tricks that I could use To make this even a little bit easier. So this is awesome seriously awesome And all of a sudden my home directory is very clean and that makes me very very happy the Yes, I know in the back of my mind that the default home directory is still a freaking mess But it was a mess before and I had to look at it every day Now I don't have to to look at it. It's behind the closet door And it's I'm only going to notice it when I open the closet and get hit in the face with everything that's in there so there's a There's something to picture. Anyways, that's it for this video if you have thoughts any of this stuff You can leave those in the comment section below. I'd love to hear from you You can follow me on mass at honor odyssey those links will be in the video description You can support me on patreon at patreon.com slash linux cast You can also head on over to the store where you'll find desk mats and hoodies and hats and shirts and All sorts of stuff all that the proceeds for all that stuff goes to directly help support my content So thank you very much for everybody who has done that for the rest of you head on over to the shop Dot the links cast dot org and get yourself some merch. It's all very very cool So thanks to everybody who does support me on patreon and youtube you guys are all Absolutely amazing without you the challenges would not be anywhere near where it is right now. So thank you so very Very very very very very much for your support. I truly again do appreciate it And I don't say that enough Well, I say it as much as I can Because I say it at the end of every video and I mean it very much every time so thanks everybody for watching I'll see you next time also. I was very very worried again So I take some time off from actually doing videos from way ahead and every time I come back to get how to talk Anyways, thanks for watching. See you next time