rwaybar icon indicating copy to clipboard operation
rwaybar copied to clipboard

Support Cargo install

Open yara-blue opened this issue 3 years ago • 0 comments

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.

yara-blue avatar Apr 29 '22 10:04 yara-blue