#!/bin/bash DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")" function error { echo -e "\\e[91m$1\\e[39m" exit 1 } # Get dependencies "${DIRECTORY}/pkg-install" "xclip wl-clipboard feh" "$(dirname "$0")" || exit 1 if [ ! -d /usr/local/go ]; then echo -e "\nInstalling Go." wget -q --show-progress -O /tmp/go.tar.gz https://golang.org/dl/go1.14.6.linux-armv6l.tar.gz sudo tar -C /usr/local -xzf /tmp/go.tar.gz && rm /tmp/go.tar.gz echo /usr/local/go/bin/go version || error "Failed to install go somehow!" else echo "Go is already installed. Moving to next step." fi echo -e "\nDownloading Cordless." GO111MODULE=on /usr/local/go/bin/go get -u "github.com/Bios-Marcel/cordless" echo "[Desktop Entry] Name=Cordless Exec=${HOME}/go/bin/cordless Path=${HOME}/go/bin/ Icon=${DIRECTORY}/apps/Cordless/icon-64.png Type=Application Comment=Terminal Discord client - for power-users and low memory consumption. Categories=Network Terminal=true X-KeepTerminal=true" > ~/.local/share/applications/cordless.desktop