Readme.md 3.54 KB
Newer Older
Farzeen's avatar
Farzeen committed
1
# Dotcastle
2 3 4
###### Version 0.1b

Do you find you .bashrc/.zshrc too large to maintain?
Farzeen's avatar
Farzeen committed
5
Have you felt that is finding and updating the right options in vimrc
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
is a real headache?
Do you have to maintain two versions of almost similar configuration file,
because a few tweaks you made for your home computer are incompatible with
your work environment?

Dotcastle is designed to solve these problems.
It helps to seperate a configuration file into logical units,
preprocess them combine them and copy the resulting file to the respective
configuration dirs.

It also has this concept of configuration group which lets you preprocess
and copy over the files differently for your home computer and work computer.

Plus, you can share the common parts of a configuration file across configuration groups.


## Install
23
Running `make dotcastle` creates a single binary `dotcastle`.
24 25
Copy it to `/usr/bin` or anywhere you wish.

26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
### Dependencies
Dotcastle depends upon Boost Filesystem and Boost Unit test and cpp-subprocess libraries.

* Boost libraries and header files must be installed using system package manager.
  On Arch Linux, install the `boost` package.

* Specify `--recursive` option during cloning the repo, or
  Execute:
  ```
  git submodule init
  git submodule update
  ```

  to pull in cpp-subprocess.


42
## Setting up your castle
Farzeen's avatar
Farzeen committed
43
The configuration files are organized as:
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
```
<DOTCASTLE>/
  -- app
      -- config-group1.make
      -- config-group1.install
      -- config-group2.make
      -- config-group2.install
      -- file1_to_be_processed_by_make
      -- file2_to_be_processed_by_make
      -- output_file1
      -- output_file2
  -- Readme.md

```

Example:

```
/home/farzeen/dotcastle/
  -- vim
      -- home.make
      -- home.install
      -- office.make
      -- office.install
      -- keybindings
      -- plugins
      -- extra_options
      -- vimrc.office
      -- vimrc.home
  -- i3
      -- home.make
      -- home.install
      -- variables
      -- basic_keybindings
      -- auto_start_apps
      -- app_keybindings
      -- i3config.home
  -- bash
      -- office.make
      -- office.install
      -- home.make
      -- home.install
      -- bashrc.home
      -- bashrc.office
  -- zsh
      -- office.make
      -- office.install
      -- home.make
      -- home.install
      -- zshrc.home
      -- zshrc.install
  -- Readme.md
  -- common_env_vars    // This file can be included into bashrc and zshrc by
                        // respective make scripts
```

100 101
> See also: https://github.com/farseenabdulsalam/my-dotcastle

Farzeen's avatar
Farzeen committed
102
## Usage:
103 104 105 106 107 108 109 110 111 112 113 114 115

```
dotcastle
  or
dotcastle -l|--list
   Show a hierarchial list like:
      ConfigGroup1
       .. App1
       .. App2
      ConfigGroup2
       .. App2
       .. App3

116
dotcastle -lc|--list-config-groups
117 118 119 120 121 122 123
   Show the list of config groups

dotcastle -la|--list-apps
   Show the list of apps

dotcastle -m|--make    <config-group>[/<app>]
dotcastle -i|--install <config-group>[/<app>]
124
  if <app> is omitted, all apps under the <config-group> are processed.
125 126 127 128 129 130

Example:

dotcastle -m office_conf
dotcastle -m office_conf/vim
```
Farzeen's avatar
Farzeen committed
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147

## What are .make and .install files
Currently, `.make` and `.install` should be simple executables,
preferably shell scripts or python scripts.
They will be executed when `dotcastle` is called with
`--make` or `--install` options respectively.

## License
This software is free as in free speech and free beer.
Feel free to copy, modify or redistribute.

## Contributing
I would really appreciate any kind of contribution.
If you have any suggestion, feature request or found any bugs,
please open an issue.

FOSS is awesome.