From 8e68939171130c45e50e1c6699875e492372490f Mon Sep 17 00:00:00 2001 From: vinceliuice Date: Wed, 6 Jan 2021 18:59:12 +0800 Subject: [PATCH] update --- build.sh | 37 ++++++++++++++++++++++++++++++++++++- install.sh | 2 +- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 3ea2d3f..3e3dd35 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,39 @@ -#!/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 279d7f1..9361420 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#! /usr/bin/env bash ROOT_UID=0 DEST_DIR=