GithubHelp home page GithubHelp logo

xxiaoa / xdm Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 1.0 314 KB

XXiaoA's dotfiles manager

License: GNU General Public License v3.0

Rust 100.00%
configuration dotfile dotfiles dotfiles-manager rust yaml

xdm's Introduction

xdm

XXiaoA's dotfiles manager Screenshot

πŸ‡¨πŸ‡³δΈ­ζ–‡

Install

Releases

Download the file from releases

Crates.io

Download from crates.io: cargo install xdm. And remember to add ~/.cargo/bin/ into your $PATH

From source

Clone the source code with git. Then run cargo install --path .. And remember to add ~/.cargo/bin/ into your $PATH

AUR

https://aur.archlinux.org/packages/xdm

paru -S xdm

Usage

Run xdm -h for more details

First you should create a yaml file named xdm.yaml (not prerequisite, but recommend).

Then you can run xdm s in a directory which has the yaml file. Xdm will find the xdm.yaml automatically in the current directory. Or you're able to use xdm s file.yaml to specify a yaml file.

Also, you can link a specific a directory or file.

Manual

You can set manual true in your link parameter (see configuration).

If a link is manual, it won't be crated after run xdm s. But you can create it manually:

xdm link {path}

Also, link command can work in all links, whether it'is manual or not.

And you can crate all links with xdm s -a

Add

You can use add command to add a link item into your configuration automatically. For example:

xdm a a

Then the following will add into your configuration:

link:
  # add by xdm
  a:
    path: b

BTW, the link is added is absolutize. And it don't use a simple way: a: b in order to let you add other parameter more easily.

Notice: This feature will change your configuration. Your configuration probably be messy, but it still legal. Maybe fix it in the futrue.

Configuration

For example:

link:
  ./path-to-original-file:
    path: ./path-to-linked-file

  ./nvim: ~/repos/nvim

  ./tmux:
    path: ~/.tmux.conf
    if: test -e /usr/bin/tmux # for fish shell

create:
  - ~/repos

Notice: you must have link option.

Link

Link a file/directory.

What's more, the two following form is same, it can reduce your work:

link:
  ./a:
    path: b

  ./a: b
Parameter Explanation type default
path The file path to linked file string \
exist Only create the link if the original file exists bool true
force Create the link whether the linked file exists or not bool false
if Create the link if shell command is true (WIP) string \
create Create the parent directory of link if need bool true
manual Check here bool false
relink Auto relink if the linked path is a link bool true

Create

Create a directory

Others

inspried by dotbot

Notice

Whether path-to-linked-file is a directory or file, it shouldn't end with /.

But path-to-original-file should end with / or not is base on yourself.

Full example

XXiaoA/dotfiles

TODO

  • add support for AUR

License

GNU General Public License v3.0

xdm's People

Contributors

xxiaoa avatar

Stargazers

 avatar sc avatar 权 avatar  avatar Masoud Azizi avatar Uriel avatar OptiFox avatar  avatar  avatar

Watchers

 avatar

Forkers

plus7wist

xdm's Issues

add new subcommand `add`

There's a file named ~/.vimrc linked to ~/dotfiles/vimrc then run
xdm add ~/.vimrc then add '~/dotfiles/vimrc: ~/.vimrc` in configuration

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.