summaryrefslogtreecommitdiff
path: root/install/discord.fish
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-01-28 16:45:16 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-01-28 16:45:16 +1100
commit587e29efe4584c8fa8016901302fd4214f78be66 (patch)
tree734816a3e818112cb706363478e6d3a6be7c1822 /install/discord.fish
parenttoggles: update communication (diff)
downloadcaelestia-cli-587e29efe4584c8fa8016901302fd4214f78be66.tar.gz
caelestia-cli-587e29efe4584c8fa8016901302fd4214f78be66.tar.bz2
caelestia-cli-587e29efe4584c8fa8016901302fd4214f78be66.zip
install scripts for all modules
Diffstat (limited to 'install/discord.fish')
-rwxr-xr-xinstall/discord.fish67
1 files changed, 67 insertions, 0 deletions
diff --git a/install/discord.fish b/install/discord.fish
new file mode 100755
index 0000000..c8f81d7
--- /dev/null
+++ b/install/discord.fish
@@ -0,0 +1,67 @@
+#!/bin/fish
+
+if test -z "$argv[1]"
+ echo 'Usage: caelestia install discord <client_config_folder_name>'
+ exit 1
+end
+
+. (dirname (status filename))/util.fish
+
+install-deps git
+
+set -l systemd $CONFIG/../systemd/user
+set -l client $CONFIG/../$argv[1]
+set -l discord $CONFIG/discord
+
+# Clone repo
+confirm-overwrite $discord
+git clone https://github.com/caelestia-dots/discord.git $discord
+
+# Install systemd service
+if test -d $systemd
+ log 'Installing systemd service...'
+
+ echo "[Service]
+Type=oneshot
+ExecStart=$discord/monitor/update.fish" > $systemd/discord-monitor-scheme.service
+ cp $discord/monitor/discord-monitor-scheme.path $systemd/discord-monitor-scheme.path
+
+ systemctl --user daemon-reload
+ systemctl --user enable --now discord-monitor-scheme.path
+ systemctl --user start discord-monitor-scheme.service
+end
+
+# Optionally install arRPC
+read -l -p "input 'Install arRPC? [Y/n] ' -n" confirm
+if test "$confirm" = 'n' -o "$confirm" = 'N'
+ log 'Skipping.'
+else
+ log 'Installing arRPC...'
+
+ install-deps npm
+ git clone 'https://github.com/OpenAsar/arrpc.git' $discord/arrpc
+ cd $discord/arrpc || exit
+ npm install
+
+ echo "[Unit]
+Description=arRPC Discord RPC daemon
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=node $discord/arrpc/src
+Restart=on-failure
+WorkingDirectory=$discord/arrpc
+
+[Install]
+WantedBy=default.target" > $systemd/arrpc.service
+
+ systemctl --user daemon-reload
+ systemctl --user enable --now arrpc.service
+end
+
+# Link themes to client config
+confirm-overwrite $client/themes
+ln -s $discord/themes $client/themes
+
+log 'Done.'