95 lines
3.1 KiB
Markdown
95 lines
3.1 KiB
Markdown
# dot
|
|
|
|
## Description
|
|
There is no place like $HOME. Home directory setup and bootstrapping guide.
|
|
|
|
|
|
## Table of Contents
|
|
|
|
* [XDG](#xdg)
|
|
* [Full Install](#full-install)
|
|
* [Dotfiles](#dotfiles)
|
|
* [Bootstrap](#bootstrap)
|
|
* [Acknowledgments](#acknowledgments)
|
|
* [License](#license)
|
|
|
|
|
|
## XDG
|
|
xdg-user-dirs is a tool to help manage "well known" user directories like the
|
|
desktop folder and the music folder. It also handles localization
|
|
(i.e. translation) of the filenames.
|
|
|
|
xdg-user-dirs-update is ran early in the login phase. It reads a configuration
|
|
file `/etc/xdg/xdg-user-dirs.defaults`. You should replace this file as root
|
|
before logging in or opening the file manager. I usually truncate the original
|
|
names, and add a few more directories.
|
|
|
|
You can find the original `/etc/xdg/xdg-user-dirs.defaults`[Here](https://myrepos.dev/Randy-Jordan/eg/raw/branch/main/xdg/user-dirs.defaults)
|
|
|
|
You can find the custom `/etc/xdg/xdg-user-dirs.defaults`[Here](https://myrepos.dev/Randy-Jordan/eg/raw/branch/main/xdg/user-dirs.custom)
|
|
|
|
Here is an easy script to automate the download and replacement of the defaults.
|
|
|
|
`curl -fsSL https://myrepos.dev/Randy-Jordan/sh/raw/branch/main/xdg_custom.sh | /bin/bash`
|
|
|
|
## Full Install
|
|
Once you've got your home directories setup, you may want to download all
|
|
needed packages from apt. Here is a script to automate a full install.
|
|
|
|
`curl -fsSL https://myrepos.dev/Randy-Jordan/sh/raw/branch/main/full_install.sh | /bin/bash`
|
|
|
|
## Dotfiles
|
|
Now that we've got all the needed packages. Lets take care of our dotfiles. I
|
|
will be following the guide in the acknowledgments.
|
|
|
|
From scratch.
|
|
|
|
```bash
|
|
git init --bare $HOME/.dot
|
|
alias config='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'
|
|
config config --local status.showUntrackedFiles no
|
|
echo "alias config='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'" >> $HOME/.bashrc
|
|
```
|
|
|
|
Now add all of your dotfiles. Here is a snippet to make things easier.
|
|
|
|
`curl -fsSL https://myrepos.dev/Randy-Jordan/sh/raw/branch/main/init_dot.sh | /bin/bash`
|
|
|
|
Here is how you can migrate this setup to another system.
|
|
|
|
```bash
|
|
git clone --bare https://myrepos.dev/Randy-Jordan/dot.git $HOME/.dot
|
|
function config {
|
|
/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME $@
|
|
}
|
|
mkdir -p .config-backup
|
|
config checkout
|
|
if [ $? = 0 ]; then
|
|
echo "Checked out config.";
|
|
else
|
|
echo "Backing up pre-existing dot files.";
|
|
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{}
|
|
fi;
|
|
config checkout
|
|
config config status.showUntrackedFiles no
|
|
```
|
|
|
|
And here is that in a snippet as well.
|
|
`curl -fsSL https://myrepos.dev/Randy-Jordan/sh/raw/branch/main/init_dl.sh | /bin/bash`
|
|
|
|
## Bootstrap
|
|
Here is a script to automate all of this.
|
|
|
|
`curl -fsSL https://myrepos.dev/Randy-Jordan/sh/raw/branch/main/bootstrap.sh | /bin/bash`
|
|
|
|
## Acknowledgments
|
|
|
|
[Tom Preston-Werner README Driven Development](https://tom.preston-werner.com/2010/08/23/readme-driven-development)<br>
|
|
[Make a README](https://www.makeareadme.com/)<br>
|
|
[Choose a LICENSE](https://choosealicense.com/)<br>
|
|
[Atlassian - How to store Dotfiles](https://www.atlassian.com/git/tutorials/dotfiles)<br>
|
|
|
|
## License
|
|
|
|
|