summaryrefslogtreecommitdiff
path: root/modules/40-neofetch/install.sh
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2022-08-09 17:53:16 -0400
committerGalen Guyer <galen@galenguyer.com>2022-08-09 17:53:16 -0400
commit1ce073aa9fae85ade97673ae5ac297fc7f8d6255 (patch)
tree96a8515307ae0a4dbd92d733a007aaee4cbf16b2 /modules/40-neofetch/install.sh
parentce1678ec45b4b0df1c3195b926410e62641de431 (diff)
add neofetch module
Diffstat (limited to 'modules/40-neofetch/install.sh')
-rw-r--r--modules/40-neofetch/install.sh21
1 files changed, 21 insertions, 0 deletions
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"
+}