Skip to content

Commit

Permalink
docs: Add installation steps + script
Browse files Browse the repository at this point in the history
  • Loading branch information
liamg committed Jul 31, 2021
1 parent 1f2980c commit 6fa6998
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/master/scripts/install.sh" | sudo bash
```

## Configuration

Expand Down
20 changes: 20 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -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!"

0 comments on commit 6fa6998

Please sign in to comment.