From d3a9b6051664373aecbf8f8cbe1e4ff0377cf19f Mon Sep 17 00:00:00 2001 From: vinceliuice Date: Wed, 6 Jan 2021 19:00:15 +0800 Subject: [PATCH] update --- build.sh | 38 +++++++++++++++++++++++++++++++++++++- install.sh | 2 +- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index cee9522..d19fd09 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,40 @@ -#!/bin/bash +#! /usr/bin/env bash + +# check command avalibility +has_command() { + "$1" -v $1 > /dev/null 2>&1 +} + +if [ ! "$(which xcursorgen 2> /dev/null)" ]; then + echo xorg-xcursorgen needs to be installed to generate the cursors. + if has_command zypper; then + sudo zypper in xorg-xcursorgen + elif has_command apt; then + sudo apt install xorg-xcursorgen + elif has_command dnf; then + sudo dnf install -y xorg-xcursorgen + elif has_command dnf; then + sudo dnf install xorg-xcursorgen + elif has_command pacman; then + sudo pacman -S --noconfirm xorg-xcursorgen + fi +fi + +if [ ! "$(which inkscape 2> /dev/null)" ]; then + echo xorg-xcursorgen needs to be installed to generate the cursors. + if has_command zypper; then + sudo zypper in inkscape + elif has_command apt; then + sudo apt install inkscape + elif has_command dnf; then + sudo dnf install -y inkscape + elif has_command dnf; then + sudo dnf install inkscape + elif has_command pacman; then + sudo pacman -S --noconfirm inkscape + fi +fi + function create { cd "$SRC" diff --git a/install.sh b/install.sh index 1eea8a1..8bfbfa5 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#! /usr/bin/env bash ROOT_UID=0 DEST_DIR=