docs: Add installation steps + script (#300)

* docs: Add installation steps + script
This commit is contained in:
Liam Galvin 2021-07-31 14:38:41 +01:00 committed by GitHub
parent 1f2980cbb4
commit 05e7618fa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 1 deletions

View File

@ -22,7 +22,13 @@ Install dependencies:
- `xorg-dev`
- `libgl1-mesa-dev`
Grab a binary from the [latest release](https://github.com/liamg/darktile/releases/latest).
Grab a binary from the [latest release](https://github.com/liamg/darktile/releases/latest), `chmod +x` it and place it in your `$PATH`.
If you're too lazy to do the above and you like to live life on the edge, you can pipe this script to sudo:
```bash
curl -s "https://raw.githubusercontent.com/liamg/darktile/main/scripts/install.sh" | sudo bash
```
## Configuration

20
scripts/install.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
set -e
echo "Determining platform..."
platform=$(uname | tr '[:upper:]' '[:lower:]')
echo "Finding latest release..."
asset=$(curl --silent https://api.github.com/repos/liamg/darktile/releases/latest | jq -r ".assets[] | select(.name | contains(\"${platform}\")) | .url")
echo "Downloading latest release for your platform..."
curl -s -L -H "Accept: application/octet-stream" "${asset}" --output /tmp/darktile
echo "Installing darktile..."
chmod +x /tmp/darktile
installdir="${HOME}/bin/"
if [ "$EUID" -eq 0 ]; then
installdir="/usr/local/bin/"
fi
mkdir -p $installdir
mv /tmp/darktile "${installdir}/darktile"
which darktile &> /dev/null || (echo "Please add ${installdir} to your PATH to complete installation!" && exit 1)
echo "Installation complete!"