Dot Manager is a set of tools used to manage dot files. It targets portability across multiple devices and user customization (ability to change themes / tweaks).
./install.sh- txtpp : Text PreProcessor, used to preprocess text files like cpp.
- dotmgt : Dot file manager, uses txtpp to update files.
First, go to a directory where your dot files will be located.
mkdir dotfiles
cd dotfilesSecond, initalize the dot files directory
dotmgt i # Or initHere are all created files :
.
├── config.yml # dotmgt config file
└── deffile.py # txtpp config file
You can add a new config file like a .vimrc by creating it without the dot at the start of the name.
echo '" My vimrc' > vimrcThe config.yml file contains files with custom paths or ignored files :
files:
i3: .config/i3/config
ignored:
- README.mdFinally, the deffile.py is used to add programmatically preprocessor definitions using python :
import os
definitions = [
'LAPTOP' if 'laptop' in os.uname().nodename else 'DESKTOP',
]Here are some useful commands :
dotmgt u # Or updateUpdate user config with dot filesdotmgt d # Or diffCompare between user config and dot filesdotmgt l # Or listList every config file path
The preprocessor is inspired by the c preprocessor, it uses the @ symbol to declare a directive. Directives can be controls (if / ifnot / elif / elifnot / else), instructions (define / undef / error / warning) or comments.
# Background
@@ Preprocessor comment
@if THEME_DARK
exec_always --no-startup-id feh --bg-scale "dark.png"
@elif THEME_LIGHT
exec_always --no-startup-id feh --bg-scale "light.png"
@else
@ error No theme found
@endMore details here.