diff options
author | Galen Guyer <galen@galenguyer.com> | 2022-08-21 18:35:44 -0400 |
---|---|---|
committer | Galen Guyer <galen@galenguyer.com> | 2022-08-21 18:35:44 -0400 |
commit | fef4b59ade496bb127cc0506cd0506636c4e9852 (patch) | |
tree | a696a576d5d0a92f85a08b32ffe1f29cbcb764a5 /modules/50-discord/install.sh | |
parent | f668e009263cdafdebae3607719ae19bfd9dc249 (diff) |
add discord config
Diffstat (limited to 'modules/50-discord/install.sh')
-rw-r--r-- | modules/50-discord/install.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/50-discord/install.sh b/modules/50-discord/install.sh new file mode 100644 index 0000000..1589a5c --- /dev/null +++ b/modules/50-discord/install.sh @@ -0,0 +1,24 @@ +_script="$(realpath ${BASH_SOURCE[0]})" +_scriptname="$(basename $_script)" +_scriptdir="$(dirname $_script)" +_modulename="$(basename $_scriptdir)" +DOT_MODULE_NAME="neofetch" + +function preinstall() { + if ! [[ -x "$(command -v discord)" ]]; then + PACKAGES+=("discord" "alsa-lib") + fi +} + +function install() { + # backup old file if it exists and we haven't backed it up before + if [[ -f "$HOME/.config/hh3/discord.json" ]] && ! [[ -f "$HOME/.config/hh3/discord.json.bak" ]] && ! [[ -f "$_scriptdir/.firstrun" ]]; then + log verbose "making backup" + cp "$HOME/.config/hh3/discord.json" "$HOME/.config/hh3/discord.json.bak" + touch "$_scriptdir/.firstrun" + fi + + log info "linking hh3 config" + mkdir -p "$HOME/.config/hh3" + ln -f "$_scriptdir/discord.json" "$HOME/.config/hh3/discord.json" +} |