blob: 98213710755489b762c72ece81336392400b5411 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/bin/bash
# Install udt by symlink, so the repo stays canonical.
# Copyright (C) 2026 Danilo M. <danix@danix.xyz>
# Licensed under the GNU General Public License v2 only.
set -euo pipefail
repo="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
target="$HOME/.config/rofi/udt"
mkdir -p "$target" "$HOME/bin" "$HOME/.cache/wal"
# Theme files are symlinked individually; accent.rasi is NOT, it points at the
# generated file in the wal cache instead.
for f in palette.rasi common.rasi menu.rasi list.rasi; do
ln -sfn "$repo/rofi/udt/$f" "$target/$f"
done
# launcher.rasi is generated rather than symlinked: it references the wallpaper
# by absolute path, which cannot live in a committed file. Regenerating it is
# why re-running this script after moving the repo is safe.
rm -f "$target/launcher.rasi"
sed "s|@WPAPER@|$HOME/.cache/wal/wpaper|" \
"$repo/rofi/udt/launcher.rasi" > "$target/launcher.rasi"
# Seed the generated accent if it does not exist yet, so themes parse on a
# fresh install before any wallpaper has been set.
if [ ! -f "$HOME/.cache/wal/udt-accent.rasi" ]; then
cp "$repo/rofi/udt/accent.rasi" "$HOME/.cache/wal/udt-accent.rasi"
fi
ln -sfn "$HOME/.cache/wal/udt-accent.rasi" "$target/accent.rasi"
ln -sfn "$repo/bin/udt-accent" "$HOME/bin/udt-accent"
echo "installed:"
ls -l "$target" "$HOME/bin/udt-accent"
|