Skip to content

hellozhaowenkai/dotpub

Social Preview

DotPub

Maintainer Version Python Code Style Conventional Commits License Contributor Covenant

🍻 Serve fruity dotfiles for brew fans! 🤩

Quickstart

DotPub makes mounting your dotfiles as easy as drinking:

NOTE: You need Python 3.9 or greater to run the script below.

# Find the DotPub.
git clone https://github.com/hellozhaowenkai/dotpub.git

# Into the DotPub.
cd dotpub

# Then order a cup of drink from the publican.
python publican.py order vim

# Or just have a taste of all drinks we served!
python publican.py order --all

NOTE: I'll regularly add new configurations so keep an eye on this repository as it grows and optimizes.

Usage

usage: publican.py [-h] [-v] ACTION ...

Serve fruity dotfiles for brew fans!

optional arguments:
  -h, --help     show this help message and exit
  -v, --version  show program's version number and exit

subcommands:
  Chose the action you want to execute.

  ACTION
    brew         manage the supported formulae via brew
    menu         list the supported formulae
    order        mount your formulae config files
    cancel       unmount your formulae config files
    tab          show the supported formulae status

Brew (Manage)

usage: publican.py brew [-h] [-s] [-f] [--use-tuna-mirror] [--auto-update] [-a] COMMAND [FORMULAE ...]

Manage the supported formulae via brew.

positional arguments:
  COMMAND            command supported by brew
  FORMULAE           chose the formulae those you want to manage

optional arguments:
  -h, --help         show this help message and exit
  -s, --simplify     simplifies the output
  -f, --force        manage formulae without asking for confirm
  --use-tuna-mirror  use TUNA mirror for brew commonds
  --auto-update      run on auto-updates (e.g. before brew install) to skips some slower steps
  -a, --all          manage all of the formulae those be supported default

Menu (List)

usage: publican.py menu [-h] [-s] [-a] [FORMULAE ...]

List the supported formulae.

positional arguments:
  FORMULAE        chose the formulae those you want to manage

optional arguments:
  -h, --help      show this help message and exit
  -s, --simplify  simplifies the output
  -a, --all       manage all of the formulae those be supported default

Order (Mount)

usage: publican.py order [-h] [-a] [FORMULAE ...]

Mount your formulae config files.

positional arguments:
  FORMULAE    chose the formulae those you want to manage

optional arguments:
  -h, --help  show this help message and exit
  -a, --all   manage all of the formulae those be supported default

Cancel (Unmount)

usage: publican.py cancel [-h] [-a] [FORMULAE ...]

Unmount your formulae config files.

positional arguments:
  FORMULAE    chose the formulae those you want to manage

optional arguments:
  -h, --help  show this help message and exit
  -a, --all   manage all of the formulae those be supported default

Tab (Status)

usage: publican.py tab [-h] [-s] [-a] [FORMULAE ...]

Show the supported formulae status.

positional arguments:
  FORMULAE        chose the formulae those you want to manage

optional arguments:
  -h, --help      show this help message and exit
  -s, --simplify  simplifies the output
  -a, --all       manage all of the formulae those be supported default

What does it do?

Let's take Vim as an example.

All Vim stuff are store in counter/vim/ folder:

  • formula-info.json tell us where the config files should put to.
  • others such as .vimrc are all Vim's config files.

Mount

  1. rm backups/vim/*
  2. mv ~/.vimrc backups/vim/.vimrc
  3. ln -s counter/vim/.vimrc ~/.vimrc

Unmount

  1. rm ~/.vimrc
  2. mv backups/vim/.vimrc ~/.vimrc
  3. rm backups/vim/*

References

The idea is inspired by:

  • Mackup: Keep your application settings in sync.
  • Dotbot: A tool that bootstraps your dotfiles.

The social preview is designed by:

  • Canva: Collaborate & Create Amazing Graphic Design for Free
  • Figma: The Collaborative Interface Design Tool

Thanks to all of them!

Contributing

Thanks for taking the time to contribute! Please check out our Contributing Guidelines for ways to offer feedback and contribute.

Trying to report a possible security vulnerability? Please check out our Security Policy for guidelines about how to proceed.

This project and everyone participating in it is governed by the Contributor Covenant Code of Conduct.

License

Licensed under the GNU Affero General Public License, Version 3.0. See LICENSE and NOTICE for complete details.