Skip to content

Support Cargo install #5

@yara-blue

Description

@yara-blue

This would replace:

git clone https://github.com/danieldg/rwaybar
cd rwaybar
cargo build --release
cp target/release/rwaybar <somewhere>
cp doc/rwaybar.toml ~/.config/
$EDITOR ~/.config/rwaybar.toml

with:

cargo install rwaybar
rwaybar  # generates example config if it does not find a config
$EDITOR ~/.config/rwaybar.toml
  • To support cargo install rwaybar needs to be published on crates.io
  • Since we do not clone the repo anymore rwaybar needs to generate the config. A simple const CONFIG: &str = include_str!(doc/rwaybar.toml) combined with a fs::write_all(config_path, CONFIG.as_bytes()) when the config is not found should do the trick.

----------------------- Edit ----------------------
I just realize I can also use cargo install --git https://github.com/danieldg/rwaybar. However I still think it would still be nice to have this on crates.io.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions