GithubHelp home page GithubHelp logo

blossom's Introduction

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

Script fails with the 'failed to create symlink' error message!

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 โ€” [email protected].

License

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

blossom's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.