[feat] single line bash command for installation
Description
In the purpose of easing the process of installation, I have made a single line bash script to download the script, place it in a file and add it to PATH. I offer myself to update the README.md if necessary.
Changes Requested
- Add to the README.md the script in the
Resourcessection
Resources
mkdir -p ~/.config/cutefetch && \
curl https://raw.githubusercontent.com/cybardev/cutefetch/main/cutefetch > ~/.config/cutefetch/cutefetch && \
chmod a+x ~/.config/cutefetch/cutefetch && \
echo "\nexport PATH=\$HOME/.config/cutefetch:\$PATH" >> .zshrc && \
echo "\nexport PATH=\$HOME/.config/cutefetch:\$PATH" >> .bashrc
Hi.
An install script could be a nice addition, but I'd like to change some things:
- install in
~/.local/liband link in~/.local/bininstead of~/.config(which is supposed to be used for config files of installed programs) - use
git cloneinstead ofcurlso people cangit pullto get updates - avoid
&&(generally, one line should do only one thing). People can paste multiple lines in the terminal if they want. - don't modify
.zshrcor.bashrc(or both). This is intrusive behaviour, and the decision should be left to the user how they want to invokecutefetch. We can make suggestions in the documentation, but that's it.
I propose appending the following to the Install section:
Commands to install cutefetch
mkdir -p ~/.local/lib
mkdir -p ~/.local/bin
git clone https://github.com/cybardev/cutefetch ~/.local/lib/cutefetch
chmod a+x ~/.local/lib/cutefetch/cutefetch
ln -s $HOME/.local/lib/cutefetch/cutefetch $HOME/.local/bin/cutefetch
PS1: after running the above commands, make sure to add the bin directory to path or add an alias to cutefetch so it can be run from the terminal. Put one of these in your shell script config file (.bashrc, .zshrc, etc.):
-
Add the local bin directory to PATH:
export PATH="$HOME/.local/bin:$PATH" -
Add an alias to your shell script config file:
alias cutefetch="~/.local/bin/cutefetch"
PS2: On many distros, the local bin directory is already added to PATH. After running the installation commands, check if you can run cutefetch already (in a new terminal, not the current one). If you can, then you don't need to do anything else.
You can add the changes and make a PR. I'll check it when I can get to it. Thanks. :blush:
Maybe an install.sh script would be more convenient for users. The README would then suggest people to run this command to inspect the script, and then replace cat with sh -e to install after they've verified its contents:
curl -sS “https://www.cybar.dev/cutefetch/install.sh” | cat
I think I won't do this after all. I have a Nix package repository where it is available to install (cybardev/nix-channel) and I would like people to actually understand the process of installing instead of promoting blindly copy-pasting commands. Also, different people have different preferences where they want to put the script, so trying to assume the most likely one is just a whack-a-mole game.