Archived
1
0
Fork 0
Config file management tool
This repository has been archived on 2017-05-27. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
2017-05-27 11:21:49 +03:00
blossom.png Add retina support for the logo 2016-07-19 19:59:42 +03:00
blossom.py Coding style fixes 2017-05-27 11:21:49 +03:00
LICENSE Add line breaks to LICENSE 2016-07-19 16:29:48 +03:00
README.md Fix typo 2016-07-19 20:07:22 +03:00

Let your files blossom

Codacy Badge

What Is This?

The majority of us use various configuration files to setup our systems. Because of the big number of those it's really hard and unaesthetic to leave your dotfiles as they are in home directory or wherever else. So, here is where dotfiles managers come. With them you can organize files as you want.

Blossom is a single-file script which allows you to clean up directories and install files by creating symbolic links. It's easy as git clone $repo && cd dotfiles && python blossom.py -l. Most likely you are going to use it to install your dotfiles; actually, there is no difference to Blossom which files to perform with. The main goals of this project are:

  • provide a tool which does its own job good;
  • maximize simplicity of the code and usage;
  • minimize the code base.

Setup

First of all, you need to decide where to store your configuration files. Usually this folder called ~/dotfiles. Then you need to add the blossom configuration file in it.

Configuration File

In this file you can specify script's behaviour: what directories should be cleaned up and how exectly to link your configs. This file has to be in the dotfiles directory (by default, ~/dotfiles) and named blossom.cfg.

Config has simple structure divided into two sections: [clean] and [link]. First one should contain a list of the directories to clean up (absolute path), one per line. Each chosen directory will be cleaned from all symbolic links. Second section has to list symlinks — targets (relative to dotfiles) and destinations (absolute). You can read more about the allowed syntax on python's configparser module documentation.

Example blossom.cfg:

[clean]
~
~/.config

[link]
vim/vim         = ~/.vim
vim/vimrc       = ~/.vimrc
misc/bashrc     = ~/.bashrc
xorg/xinitrc    = ~/.xinitrc
xorg/xresources = ~/.Xresources

Command-Line Options

When running script those options are allowed:

-h, --help    show the help message and exit
-c, --clean   perform cleanup
-l, --link    perform linking
-f, --force   remove existing destination files
-d D, --dir D specify working directory (default is ~/dotfiles)

Troubleshooting

In this situation the most common are those cases:

  • The destination of symlink is exists already, so you can remove it manually or just add the --force flag.

  • You're trying to put a symbolic link in the nonexistent directory. For example, you may want Blossom to place your ~/dotfiles/compton folder to ~/.config, but the second directory doesn't exist. The only workaround is just to create this folder manually.

Script execution does nothing!

If you are executing sctipt with the right flags and getting no result, most likely you're using custom directory, so the script is getting nothing from the <default directory>/blossom.cfg. You can specify custom working directory with the --dir option.

Contact

You can contact the developer via e-mail — alexquot@gmail.com.

License

Copyright (c) 2016 Alex Quot. This software released under the MIT License.