diff --git a/.stow-local-ignore b/.stow-local-ignore index 8b887aa..2279831 100644 --- a/.stow-local-ignore +++ b/.stow-local-ignore @@ -1,2 +1,3 @@ ^/\.git.* .*\.bak$ +readme.md diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..0ffa5d8 --- /dev/null +++ b/readme.md @@ -0,0 +1,73 @@ +# Stew Home + +This repo contains dotfiles LailaTheElf uses in the home directory. It also +contains a script (`stow/dot-local/bin/stowhome`) that uses GNU Stow to link +them from all the correct spots. + +## Install + +> NOTE: this is made for [ElfOS](https://gitea.finnvanreenen.nl/LailaTheElf/ElfOS.git) +> any other setup are **not** suported! + +1. Install GNU Stow: + +```sh +sudo pacman -Sy stow +``` + +2. Clone this repository to `~/.config/dotfiles`. + +```sh +git clone https://gitea.finnvanreenen.nl/LailaTheElf/stowhome.git -O "$HOME/.config/dotfiles" +``` + +3. Install stowhome + +```sh +"$HOME/.config/dotfiles/stow/dot-local/bin/stowhome" stow +``` + +## File structure + +Of the repo, the root directory contains a folder for every package and the +following files: + +- **.stow-local-ignore**: The ignore file for GNU Stow (uses [Perl regex](https://perldoc.perl.org/perlre)). +- **readme.md**: This file. + +The packages is essentially a chroot of the home directory. All the files in +there are links to the corresponding place of the home directory (except the +once matching a line in the `.stow-local-ignore` file). + +The `--dotfile` option is used; this means files and directories starting with +'dot-' will be prepended with a dot. So `dot-local` will become `.local`. This +is to prevent a repository full of hidden files. + +## Usage + +### Link the dotfiles: + +```sh +stowhome [ [ [...]]] +``` + +Where `` is a directory from this repo. + +If the dotfiles already exist as normal files (not symlinks), it will skip this +file. To overwrite the file in stow, use this command: + +```sh +stowhome --adopt [ [ [...]]] +``` + +To overwrite the dotfile, you can just remove or rename the file and then run +`stowhome` again. + +### Update dotfiles + +To edit an already managed by stowhome dotfile, you can just edit it. The +changes will update in the Git repository (`$HOME/.config/dotfiles`), but no +commit will be made. + +Overriding a file with one in this repo is easies by removing or renaming the +file. diff --git a/shell/dot-bashrc b/shell/dot-bashrc index 6aa3631..d4fcad2 100644 --- a/shell/dot-bashrc +++ b/shell/dot-bashrc @@ -9,7 +9,7 @@ alias ls='ls --color=auto' alias la='ls --color=auto -plhA' alias grep='grep --color=auto' -PS1='\n\h \W\n\$ ' +PS1='\n\h \w\n\$ ' export PATH="$PATH:$HOME/.local/bin" export EDITOR=vim diff --git a/stow/dot-local/bin/stowhome b/stow/dot-local/bin/stowhome index 4dfd414..63b0928 100755 --- a/stow/dot-local/bin/stowhome +++ b/stow/dot-local/bin/stowhome @@ -1,8 +1,11 @@ #!/bin/bash if [ "$*" == "" ] -do +then echo "you must supply at least one package" + echo + echo "packages:" + cd "$HOME/.config/dotfiles" && find . -maxdepth 1 -type d -not -name ".git" -not -name "." | sed -e 's|^.\/| - |' else stow --dir "$HOME/.config/dotfiles" --target "$HOME" --dotfiles $* fi