Uln is a symbolic link creator (or file copier) controlled via config file.
Uln looks for a file named .uln in the current directory. This file defines a root link/copy destination directory and a list of target source files. Link targets may be dependent upon system hostname by appending it to target filenames.
$ uln <command> [option...]
init
: Create a new .uln file in current directory.
link
: Create symbolic links defined in .uln file.
copy
: Copy files defined in .uln file.
-D, --dryrun
: Perform trial run making no changes.
-V, --verbose
: Print existing links/copies.
-c, --config <file>
: Source alternative config file.
-d, --dir <directory>
: Set root destination directory.
-s, --src <file>
: Add to list of source files.
-H, --help
: Display help and exit.
.uln - yaml file containing the following keys:
dest or dir : Link/copy destination directory. (required)
srcs : List of source files. (optional)
Created links/copies may be dependent upon system hostname by appending an underscore and the hostname to source filenames.
For example, if file.txt is listed in srcs, uln will create a link to file_.txt, if it exists, instead of file.txt.
Uln can be used to store one's dotfiles in a separate root folder for easy version control, syncing with other machines, etc.
Consider a folder .dotfiles/ in a user's home directory that contains a number of subdirectories and files, mirroring the structure of the user's home directory. .dotfiles/ also contains a file named .uln with the following content:
dest: ~
srcs:
- .bashrc
- .config/feh/
- .config/mpv/input.conf
- .vim/
When the user runs uln link
from within .dotfiles/, corresponding links are
created in the user's home directory to the files listed in srcs.
The user has several machines that share the contents of .dotfiles/. By creating an additional file named .bashrc_debian-pc alongside the original .bashrc in .dotfiles/, the user is able to manage and source a different .bashrc file on their debian machine.