How to Manage Dotfiles on Linux

  Рет қаралды 13,981

The Linux Cast

The Linux Cast

Күн бұрын

Today I talk about how I manage my dotfiles.
👇 PULL IT DOWN FOR THE GOOD STUFF 👇
Patreon - / thelinuxcast
Liberapay - liberapay.com/thelinuxcast/
KZbin - / @thelinuxcast
===== Follow us 🐧🐧 ======
Discord - / discord
Odysee - odysee.com/$/invite/@thelinux...
/ thelinuxcast
/ mtwb
Mastodon- fosstodon.org/@thelinuxcast
gitlab.com/thelinuxcast
Subscribe at thelinuxcast.org
Contact us email@thelinuxcast.org
Telegram Group - t.me/+9lYoIuLh0JIyMzcx
Amazon Wishlist - www.amazon.com/hz/wishlist/ls...
Merch Store - zaney.creator-spring.com/
Logo Courtesy of - pedropaulo.net
==== Special Thanks to Our Patrons! ====
thelinuxcast.org/patrons/
==== Time Stamps ====
0:00 Intro
1:16 My Repo
2:24 Sym Link Mania
5:42 My Script
7:00 Conclusions
#tut #linux #thelinuxcast

Пікірлер: 68
@TheLinuxCast
@TheLinuxCast Жыл бұрын
Want more Linux content? Follow me on Twitter twitter.com/thelinuxcast (Or on Mastodon fosstodon.org/@thelinuxcast )
@Little-bird-told-me
@Little-bird-told-me Жыл бұрын
Why can't we just "git" the entire .config directory? Wouldn't that be a simpler way to manage dotfiles? for e.g. My _".config directory"_ is about 250 mb which is well below the space limit in Gitlab/hub. Ofcoruse I will keep it private. Granted you make have to symlink a few files like .bashrc which reside outside, but the majority of config files sit inside .config.
@jackob334
@jackob334 7 ай бұрын
but how do you symlink ssh ? when i tried it didn't work but i don't remeber why. i believe of the nature of how ssh works and the maintainer resisting to change that is when i gave up on it
@laniusdev
@laniusdev Жыл бұрын
I think you would really like stow, because it just creates symlinks, so you still have control. Although for this to work you would need to have a little different structure in your dotfiles, like ~/myrepo/i3/.config/i3 (so first i3 directory acts as root/home directory) and then you symlink your stuff like this: "stow -d ~/myrepo -t ~ i3" (where -d is source dir, -t is target dir, and i3 is module name, so basically contents of i3 folder in myrepo). If e.g. .config/i3 directory already exists in your $HOME, then it would symlink all the files individually, as it won't overwrite anything, and just keeps the folder structure.
@HeCodes2Much
@HeCodes2Much Жыл бұрын
I really like stow for this reason too :)
@TownspersonB
@TownspersonB Жыл бұрын
I was going to say his method is just a reinvention of stow, but less flexible. I used to use stow, but I didn't like seeing all those sym link paths when using stuff like Telescope in Neovim, so I switched to Chezmoi, which is similar to stow but makes copies instead of sym links.
@brunofunnie
@brunofunnie Жыл бұрын
wow, just mixed the github idea with stow... magical! Thanks
@HeCodes2Much
@HeCodes2Much Жыл бұрын
@@TownspersonB does it keep it in sync really well too?
@TownspersonB
@TownspersonB Жыл бұрын
​@@HeCodes2Much Yup, can use chezmoi status, add, re-add, apply, diff, update, and more commands to manage the files. So if you "add" a file from your config, it adds it to the git repo and you can pull that repo and then "apply" the files to your config on other machines. Then when you change the files in your config, you can see it with "status" and "diff", and even just run a "re-add" to re-add all the files that have changed from your config to your repo. Then pull the git repo on other machines and "apply" the changes. The git repo is in your .local/share directory, so it's easy enough to add that to an ignore file to keep it out of searches for stuff like Telescope in Neovim.
@donaldmickunas8552
@donaldmickunas8552 Жыл бұрын
Nice system. I backup my dot files in two locations. I have a series of scripts which give me finer control to both backup and restore. My files physically exist in my home directory. Anyway, it’s my system and I love it. Thanks for sharing. Cool idea.
@niccolofaraco24
@niccolofaraco24 Жыл бұрын
Great video, Matt! Expert “ricers” probably have their own method, but this is simple and very useful for newcomers! By the way, JFYI you can pass a second argument to ‘git clone’ specifying the name of the cloned folder ( ‘git clone myrepo’ in your case), rather than using the ‘mv’ command afterwards.
@anon_y_mousse
@anon_y_mousse Жыл бұрын
Good advice. I use that all the time when they name their repo something silly that's hard to type or remember.
@twb0109
@twb0109 Жыл бұрын
For your setup, GNU stow would be a great way to manage them
@samgould8567
@samgould8567 Жыл бұрын
Absolutely. I’ve tried a bunch of different dotfile management techniques and the best system for me is GNU stow with a Makefile wrapper.
@wyfyj
@wyfyj Жыл бұрын
Thanks for the content Matt. I do wish more people would share knowledge like this.
@lucaslopes1260
@lucaslopes1260 Жыл бұрын
I also used to create symlinks on my .config. But then I turned the .config directory itself into a git repository. From there I can push, pull and even switch branches.
@ribbanya
@ribbanya Жыл бұрын
Personally I find chezmoi to be way easier for managing multiple devices (like a desktop and a laptop, or different operating systems). It requires you to learn the templating system to be effective, though.
@Bruces-Eclectic-World
@Bruces-Eclectic-World Жыл бұрын
I'm like you Matt. I do mine manually too. I never thought of using sim-links like that, cool. I do the sim-link trick on my server to some folders and it does work great. Like the script it is a cool idea. I did not think of using my Git repo as my dot folder. Will have to give that some thought... 🤔 Thanks Matt! LLAP 🖖
@ArniesTech
@ArniesTech Жыл бұрын
Started focussing more on .Files too. Especially now that I use a separate /home partition and Inwant to migrate my personal settings when distro switching 💪🙏
@KonstantWalker
@KonstantWalker 7 ай бұрын
Thank you kind sir, really enjoyed this
@xypsilonzett4708
@xypsilonzett4708 Жыл бұрын
Thanks for sharing. I took this as an opportunity to look into stow again and this time I got it. Thanks also to Jake Wiesler for "Manage Your Dotfiles Like a Superhero" (with stow).
@Flackon
@Flackon Жыл бұрын
+1 for just using stow. Btw it’s probably better to do the repo rename on the git clone command. I’ve had weird issues with git after renaming a repo manually after cloning
@fulcain8596
@fulcain8596 3 ай бұрын
Great video man! simple and straight to the point. I've learned a lot! Thank you.
@TateyRG
@TateyRG Жыл бұрын
Stow can do the same job for you with just a couple of commands.
@TheLinuxCast
@TheLinuxCast Жыл бұрын
As I said in the video, I want full control, and I don't want to rely on someone else's script
@twb0109
@twb0109 Жыл бұрын
@@TheLinuxCast stow gives you full control, you manually tell stow what folder you want to stow and then it will symlink it, taking each folder in the repo as a home directory. So if you want to symlink bspwm, you create a structure like this one: myrepo/bspwm/.config/bspwm/bspwmrc And then run `stow bspwm` inside of myrepo, it'll take care of symlinking the files to ~/.config/*
@TheLinuxCast
@TheLinuxCast Жыл бұрын
As I said, I don't want to rely on someone else's script or app to do this.
@donaldmickunas8552
@donaldmickunas8552 Жыл бұрын
@@TheLinuxCast I feel the same way.
@AliensInc.
@AliensInc. Жыл бұрын
Why not use Git Bare Repository. Got that from DT and it's so easy and no need for symlinks
@TheLinuxCast
@TheLinuxCast Жыл бұрын
Could never figure that out even with his tutorial.
@Chris-ip8uv
@Chris-ip8uv Жыл бұрын
@@TheLinuxCast Agreed - it was a tad confusing. I managed to fumble my way through it and I use a git bare from time to time. I do prefer your process simply because it seems to follow the KISS process.
@noferblatz
@noferblatz Жыл бұрын
This would be simpler if you house your /home directory on its own hard drive, and mount that at /home. This simplifies having all your config and home files available for any disto you switch to.
@donaldmickunas8552
@donaldmickunas8552 Жыл бұрын
I’ve had issues doing it this way. Not all configs work the same in every distro. However, I’m glad it works for you,
@Perry....
@Perry.... Жыл бұрын
Tried that once and got burned.. never again 💀
@alonso0188
@alonso0188 8 ай бұрын
Thanks man.
@bastiand.771
@bastiand.771 Жыл бұрын
You should take a look at "stow" which is a simple peel program meant to handle for files. It does exactly what your script does except more automatically.
@kwamedevopsengineer7633
@kwamedevopsengineer7633 Жыл бұрын
Thanks!
@TheLinuxCast
@TheLinuxCast Жыл бұрын
Thank you!
@oalfodr
@oalfodr Жыл бұрын
My preferred way was just initiating git repo in my home. Downside is that every new file or directory I don't want commited must be ignored but that is also a good thing since no junk files can sneak up on my system.
@castlesnake
@castlesnake Жыл бұрын
You can invert this and whitelist only the things that you want added instead which I find more convenient. Look up the '!' operator
@oalfodr
@oalfodr Жыл бұрын
@@castlesnake I like seeing all new stuff. I am using inversion for some exceptions to my blacklist
@hernanvalenzuela874
@hernanvalenzuela874 Жыл бұрын
what color palette do you use?
@Chris-ip8uv
@Chris-ip8uv Жыл бұрын
Nice work, Matt! Now, how do you manage your dots that fall under your $HOME directory?
@TheLinuxCast
@TheLinuxCast Жыл бұрын
Same way. Symlinks
@alexandrosvangelatos9979
@alexandrosvangelatos9979 Жыл бұрын
I think you should look into stow. With it, it won't matter which distro you are on.
@MrCradleman
@MrCradleman Жыл бұрын
I use chezmoi + keepassxc which give me a possibility to keep passes, ssh key and all important information separate from git repo. You way is pretty dangerous and you didn't mention this in your video. A lot of people push their passes to github/gitlab and where are a lot of bots monitored new repos in order to steal them
@yourlinuxguy
@yourlinuxguy Жыл бұрын
Well I am new to this managing and to the Linux? For Now, I have a few options to search GNU STOW, Git Bare Repo & Using the Symlinks. Manual symlinks look really simple and easy for my small config files now. Git bare repo was confusing I watched DT, Stow is kinda similar to simlinks, but it automates the things and you have to make and ignore list.
@andressalazargaleano6419
@andressalazargaleano6419 Жыл бұрын
I use ansible to handle installation and symlink creation
@JadKanounji
@JadKanounji Жыл бұрын
a suggestion for the script: why not make your .config folder itself a symlink to my my-repo? if you wouldn't want to do that, then another suggestion would be to loop over the contents of the folder and let it create your symbolic links automatically rather than having to add a new line whenever there's a new folder in your repo?
@msor6108
@msor6108 Жыл бұрын
I am using a git bare repo. I used to use stow before that. I also tried to use home-manager since I was on NixOS but I really didn't like it.
@niranet2463
@niranet2463 Жыл бұрын
How come you've never made a custom gtk or qt theme?
@alexstone691
@alexstone691 Жыл бұрын
I used to use chezmoi, some other dotfiles managers, stow but they either suck to use on windows, or dont allow me to easily automate setting up vim for example So.. i went the nerd way and use custom scripts for linking or copyinf the files the config install scripts are like 10 lines very simple suprisingly
@franciscoromero7386
@franciscoromero7386 Жыл бұрын
What if you try chezmoi? It gives you control and is a lot easier.
@waterhermit7314
@waterhermit7314 Жыл бұрын
Haven't watched it yet, but why not use stow?
@TheLinuxCast
@TheLinuxCast Жыл бұрын
Probably should watch it.
@Norbert9696
@Norbert9696 Жыл бұрын
Symlink gang!
@anon_y_mousse
@anon_y_mousse Жыл бұрын
Best thing about symlink gang is they can't touch us. ;)
@Little-bird-told-me
@Little-bird-told-me Жыл бұрын
Why can't we just "git" the entire .config directory? Wouldn't that be a simpler way to manage dotfiles? for e.g. My _".config directory"_ is about 250 mb which is well below the space limit in Gitlab/hub. Ofcoruse I will keep it private. Granted you make have to symlink a few files like .bashrc which reside outside, but the majority of config files sit inside .config.
@Johnson_meta
@Johnson_meta Жыл бұрын
loves from china. I have question for you,how did you add icons in ls outputs.
@yourlinuxguy
@yourlinuxguy Жыл бұрын
By using the lsd package.
@kwamedevopsengineer7633
@kwamedevopsengineer7633 Жыл бұрын
Thanks a lot . . for explaning the concept of dotfiles.
@ralfbaechle
@ralfbaechle Жыл бұрын
The method isn't new and there's nothing fundamentally wrong or superior to it. The one obstacle I see is git is not for everybody. I know a lot of people just don't understand git For those folks i suggest their configuration management system of choice or even keeping their set of config files in a directory that can be distributed by say rsync.
@jwisemanm
@jwisemanm Жыл бұрын
Why don't you just use a bare git repository? It accomplishes basically the same results, with less work.
@foss_land
@foss_land Жыл бұрын
i prefer git --bare repo its more easy and more pratique .
@ForeverZer0
@ForeverZer0 11 ай бұрын
This is horrible advice, and not a sane way to ever suggest to others. Create a directory in your home. Create a git repo inside of it, passing the "--bare" flag. Create an alias in your favorite shell, like: alias dot='git --git-dir=$HOME/dotfiles/ --work-tree=$HOME' Now just add any file you want from anywhere in your home directory, but instead of using "git", you can use your alias "dot". No symlinks. No mess. No git repository in $HOME. No duplicates.
How To Backup Your Computer - Tips and Tricks
23:39
The Linux Cast
Рет қаралды 6 М.
Linux File System/Structure Explained!
15:59
DorianDotSlash
Рет қаралды 4 МЛН
Задержи дыхание дольше всех!
00:42
Аришнев
Рет қаралды 3,1 МЛН
Stow has forever changed the way I manage my dotfiles
8:09
Dreams of Autonomy
Рет қаралды 225 М.
Manage Your Dotfiles with Home Manager!
32:06
LibrePhoenix
Рет қаралды 50 М.
Git Bare Repository - A Better Way To Manage Dotfiles
16:56
DistroTube
Рет қаралды 130 М.
CrowdStrike IT Outage Explained by a Windows Developer
13:40
Dave's Garage
Рет қаралды 2 МЛН
Manage Your Dotfiles Like A Superhero
25:39
Jake Wiesler
Рет қаралды 15 М.
Titus Reacts to Linus Tech Tips Linux Daily Drive Challenge
20:21
Chris Titus Tech
Рет қаралды 734 М.
Customizing i3Blocks For the Ultimate Status Bar on i3WM
27:23
The Linux Cast
Рет қаралды 31 М.
~/.dotfiles in 100 Seconds
13:54
Fireship
Рет қаралды 412 М.
Getting Started With Git and GitLab
24:34
DistroTube
Рет қаралды 41 М.
How A Steam Bug Deleted Someone’s Entire PC
11:49
Kevin Fang
Рет қаралды 940 М.
Красиво, но телефон жаль
0:32
Бесполезные Новости
Рет қаралды 1,5 МЛН
НЕ БЕРУ APPLE VISION PRO!
0:37
ТЕСЛЕР
Рет қаралды 315 М.
S24 Ultra and IPhone 14 Pro Max telephoto shooting comparison #shorts
0:15
Photographer Army
Рет қаралды 9 МЛН
Здесь упор в процессор
18:02
Рома, Просто Рома
Рет қаралды 412 М.
#samsung #retrophone #nostalgia #x100
0:14
mobijunk
Рет қаралды 9 МЛН