install scripts for all modules

This commit is contained in:
2 * r + 2 * t
2025-01-28 16:45:16 +11:00
parent 1f9044c5db
commit 587e29efe4
14 changed files with 250 additions and 19 deletions
+67
View File
@@ -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.'
+13
View File
@@ -0,0 +1,13 @@
#!/bin/fish
. (dirname (status filename))/util.fish
install-deps git foot inotify-tools
set -l foot $CONFIG/../foot
confirm-overwrite $foot
git clone 'https://github.com/caelestia-dots/foot.git' $foot
sed -i 's|$SRC|'$foot'|g' $foot/foot.ini
log 'Done.'
+28
View File
@@ -0,0 +1,28 @@
#!/bin/fish
. (dirname (status filename))/util.fish
install-deps git fuzzel-git
set -l systemd $CONFIG/../systemd/user
set -l fuzzel $CONFIG/../fuzzel
# Clone repo
confirm-overwrite $fuzzel
git clone 'https://github.com/caelestia-dots/fuzzel.git' $fuzzel
# Install systemd service
if test -d $systemd
log 'Installing systemd service...'
echo "[Service]
Type=oneshot
ExecStart=$fuzzel/monitor/update.fish" > $systemd/fuzzel-monitor-scheme.service
cp $fuzzel/monitor/fuzzel-monitor-scheme.path $systemd/fuzzel-monitor-scheme.path
systemctl --user daemon-reload
systemctl --user enable --now fuzzel-monitor-scheme.path
systemctl --user start fuzzel-monitor-scheme.service
end
log 'Done.'
+16
View File
@@ -0,0 +1,16 @@
#!/bin/fish
. (dirname (status filename))/util.fish
install-deps git uwsm hyprland-git hyprpaper-git hyprlock-git hypridle-git polkit-gnome gnome-keyring wl-clipboard wireplumber
install-optional-deps 'gammastep (night light)' 'wlogout (secondary session menu)' 'grimblast-git (screenshot freeze)' 'hypricker-git (colour picker)' 'foot (terminal emulator)' 'firefox (web browser)' 'vscodium-bin (IDE)' 'thunar (file manager)' 'nemo (secondary file manager)' 'fuzzel (secondary app launcher)'
set -l hypr $CONFIG/../hypr
confirm-overwrite $hypr
git clone 'https://github.com/caelestia-dots/hypr.git' $hypr
sudo pacman -S --needed --noconfirm ydotool
systemctl --user enable --now ydotool.service
log 'Done.'
+12
View File
@@ -0,0 +1,12 @@
#!/bin/fish
. (dirname (status filename))/util.fish
install-deps git dart-sass aylurs-gtk-shell-git alsa-utils libappindicator-gtk3
set -l safeeyes $CONFIG/safeeyes
confirm-overwrite $safeeyes
git clone 'https://github.com/caelestia-dots/safeeyes.git' $safeeyes
log 'Done.'
+17
View File
@@ -0,0 +1,17 @@
#!/bin/fish
. (dirname (status filename))/util.fish
install-deps git hyprland-git hyprpaper-git okolors-git imagemagick wl-clipboard fuzzel-git socat foot jq
install-optional-deps 'vesktop-bin (discord client)' 'btop (system monitor)' 'wf-recorder (screen recorder)' 'grim (screenshot tool)' 'firefox (web browser)' 'spotify-adblock (music player)'
set -l dist $CONFIG/scripts
confirm-overwrite $dist
git clone 'https://github.com/caelestia-dots/scripts.git' $dist
mkdir -p ~/.local/bin
ln -s $dist/main.fish ~/.local/bin/caelestia
log 'Done.'
+13
View File
@@ -0,0 +1,13 @@
#!/bin/fish
. (dirname (status filename))/util.fish
install-deps git dart-sass libastal-meta npm curl libnotify ttf-material-symbols-variable-git ttf-jetbrains-mono-nerd ttf-rubik-vf pacman-contrib
install-optional-deps 'uwsm (for systems using uwsm)' 'yay (AUR package management)' 'fd (launcher file search)' 'wl-clipboard (clipboard support)' 'foot (opening stuff in terminal)'
set -l shell $CONFIG/shell
confirm-overwrite $shell
git clone 'https://github.com/caelestia-dots/shell.git' $shell
log 'Done.'
+55
View File
@@ -0,0 +1,55 @@
. (dirname (status filename))/../util.fish
function confirm-overwrite -a path
if test -e $path
read -l -p "input '$(realpath $path) already exists. Overwrite? [y/N] ' -n" confirm
if test "$confirm" = 'y' -o "$confirm" = 'Y'
log 'Continuing.'
rm -rf $path
else
log 'Exiting.'
exit
end
end
end
function install-deps
# All dependencies already installed
pacman -Q $argv &> /dev/null && return
# Get AUR helper or install if none
which yay > /dev/null && set -l helper yay || set -l helper paru
if ! which paru > /dev/null
warn 'No AUR helper found'
read -l -p "input 'Install yay? [Y/n] ' -n" confirm
if test "$confirm" = 'n' -o "$confirm" = 'N'
warn "Manually install yay or paru and try again."
warn "Alternatively, install the dependencies '$argv' manually and try again."
exit
else
sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
cd ..
rm -rf yay
# First use, see https://github.com/Jguer/yay?tab=readme-ov-file#first-use
yay -Y --gendb
yay -Y --devel --save
end
end
# Install
log "Installing dependencies '$argv'"
$helper -S --needed --noconfirm $argv
end
function install-optional-deps
for dep in $argv
if ! pacman -Q $dep &> /dev/null
read -l -p "input 'Install $dep? [Y/n] ' -n" confirm
test "$confirm" != 'n' -a "$confirm" != 'N' && install-deps (cut -f 1 -d ' ' $dep)
end
end
end