40 lines
1.4 KiB
Bash
Executable File
40 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -Eeuo pipefail
|
|
|
|
REPO_ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
|
FEDORA_ROOT="$REPO_ROOT/fedora"
|
|
CONFIG_ROOT="$HOME/.config"
|
|
LOCAL_BIN="$HOME/.local/bin"
|
|
|
|
link_config() {
|
|
local source=$1
|
|
local destination=$2
|
|
|
|
mkdir -p "$(dirname -- "$destination")"
|
|
if [[ -e "$destination" && ! -L "$destination" ]]; then
|
|
printf 'Refusing to replace existing path: %s\n' "$destination" >&2
|
|
exit 1
|
|
fi
|
|
ln -sfn -- "$source" "$destination"
|
|
}
|
|
|
|
for name in niri fuzzel alacritty btop glow gtk-3.0 gtk-4.0 xsettingsd environment.d autostart; do
|
|
link_config "$FEDORA_ROOT/$name" "$CONFIG_ROOT/$name"
|
|
done
|
|
|
|
link_config "$REPO_ROOT/nvim" "$CONFIG_ROOT/nvim"
|
|
link_config "$FEDORA_ROOT/quickshell/control-center" "$CONFIG_ROOT/quickshell/control-center"
|
|
link_config "$FEDORA_ROOT/systemd/user/quickshell-control-center.service" \
|
|
"$CONFIG_ROOT/systemd/user/quickshell-control-center.service"
|
|
link_config "$FEDORA_ROOT/wallpapers/wallpaper.png" "$CONFIG_ROOT/wallpaper.png"
|
|
|
|
mkdir -p "$LOCAL_BIN"
|
|
|
|
for project in khal-calendar mail-counter; do
|
|
cargo build --release --manifest-path "$FEDORA_ROOT/$project/Cargo.toml"
|
|
install -m 755 "$FEDORA_ROOT/$project/target/release/$project" "$LOCAL_BIN/$project"
|
|
done
|
|
|
|
systemctl --user daemon-reload
|
|
printf 'Installed Fedora and Neovim links; Rust binaries are in %s.\n' "$LOCAL_BIN"
|