From 1ce073aa9fae85ade97673ae5ac297fc7f8d6255 Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Tue, 9 Aug 2022 17:53:16 -0400 Subject: add neofetch module --- modules/40-neofetch/install.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 modules/40-neofetch/install.sh (limited to 'modules/40-neofetch/install.sh') diff --git a/modules/40-neofetch/install.sh b/modules/40-neofetch/install.sh new file mode 100644 index 0000000..65a90d3 --- /dev/null +++ b/modules/40-neofetch/install.sh @@ -0,0 +1,21 @@ +_script="$(realpath ${BASH_SOURCE[0]})" +_scriptname="$(basename $_script)" +_scriptdir="$(dirname $_script)" +_modulename="$(basename $_scriptdir)" + +function preinstall() { + if ! [[ -x "$(command -v neofetch)" ]]; then + PACKAGES+=("neofetch") + fi +} + +function install() { + # backup old file if it exists and we haven't backed it up before + if [[ -f "$HOME/.config/neofetch/config.conf" ]] && ! [[ -f "$HOME/.config/neofetch/config.conf.bak" ]] && ! [[ -f "$_scriptdir/.firstrun" ]]; then + echo "making backup" + cp "$HOME/.config/neofetch/config.conf" "$HOME/.config/neofetch/config.conf.bak" + touch "$_scriptdir/.firstrun" + fi + + ln -f "$_scriptdir/config.conf" "$HOME/.config/neofetch/config.conf" +} -- cgit v1.2.3