refaktor
This commit is contained in:
+70
-2
@@ -3,7 +3,10 @@ set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||
|
||||
cp "$SCRIPT_DIR/colors/Colors.qml.template" "$SCRIPT_DIR/colors/Colors.qml"
|
||||
cp "$SCRIPT_DIR/config/Colors.qml.template" "$SCRIPT_DIR/config/Colors.qml"
|
||||
|
||||
cp "$SCRIPT_DIR/config/path/ConfigPath.qml.template" "$SCRIPT_DIR/config/path/ConfigPath.qml"
|
||||
sed -i "s|__CONFIG_DIR__|$SCRIPT_DIR|g" "$SCRIPT_DIR/config/path/ConfigPath.qml"
|
||||
|
||||
# ----------------------------
|
||||
# UI helpers
|
||||
@@ -51,7 +54,6 @@ transform_svg_white() {
|
||||
echo
|
||||
info "Preparing wlogout icons..."
|
||||
mkdir -p "$SCRIPT_DIR/modules/wlogout/icons"
|
||||
mkdir -p "$SCRIPT_DIR/colors/icons"
|
||||
|
||||
# ----------------------------
|
||||
# Icons (wlogout)
|
||||
@@ -103,6 +105,61 @@ download \
|
||||
"$SCRIPT_DIR/colors/icons/correct.svg" \
|
||||
"correct.svg"
|
||||
|
||||
# ----------------------------
|
||||
# Nerd Font
|
||||
# ----------------------------
|
||||
echo
|
||||
info "Installing CodeNewRoman Nerd Font..."
|
||||
FONT_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/fonts"
|
||||
mkdir -p "$FONT_DIR"
|
||||
|
||||
if [ ! -f "$FONT_DIR/CodeNewRomanNerdFont-Regular.ttf" ]; then
|
||||
download \
|
||||
"https://github.com/ryanoasis/nerd-fonts/releases/latest/download/CodeNewRoman.tar.xz" \
|
||||
"/tmp/CodeNewRoman.tar.xz" \
|
||||
"CodeNewRoman Nerd Font"
|
||||
|
||||
tar -xf /tmp/CodeNewRoman.tar.xz -C "$FONT_DIR" --wildcards '*.ttf' 2>/dev/null || \
|
||||
tar -xf /tmp/CodeNewRoman.tar.xz -C "$FONT_DIR"
|
||||
rm -f /tmp/CodeNewRoman.tar.xz
|
||||
|
||||
if command -v fc-cache &>/dev/null; then
|
||||
fc-cache -fv "$FONT_DIR" &>/dev/null
|
||||
fi
|
||||
ok "CodeNewRoman Nerd Font installed"
|
||||
else
|
||||
ok "CodeNewRoman Nerd Font already installed"
|
||||
fi
|
||||
|
||||
# ----------------------------
|
||||
# Japanese Font (for JLearner)
|
||||
# ----------------------------
|
||||
echo
|
||||
info "Installing Noto Sans JP font..."
|
||||
|
||||
if [ ! -f "$FONT_DIR/NotoSansJP.ttf" ]; then
|
||||
download \
|
||||
"https://github.com/google/fonts/raw/main/ofl/notosansjp/NotoSansJP%5Bwght%5D.ttf" \
|
||||
"$FONT_DIR/NotoSansJP.ttf" \
|
||||
"Noto Sans JP"
|
||||
|
||||
ok "Noto Sans JP font installed"
|
||||
else
|
||||
ok "Noto Sans JP font already installed"
|
||||
fi
|
||||
|
||||
# ----------------------------
|
||||
# Font cache reload
|
||||
# ----------------------------
|
||||
echo
|
||||
info "Reloading font cache..."
|
||||
if command -v fc-cache &>/dev/null; then
|
||||
fc-cache -fv &>/dev/null
|
||||
ok "Font cache reloaded"
|
||||
else
|
||||
warn "fc-cache not found — font cache not updated"
|
||||
fi
|
||||
|
||||
# ----------------------------
|
||||
# Example Wallpaper
|
||||
# ----------------------------
|
||||
@@ -111,6 +168,17 @@ info "Preparing wallpaper..."
|
||||
|
||||
WALLPAPER_DIR=$(scripts/wallpaper_dir.sh)
|
||||
|
||||
mkdir -p "$WALLPAPER_DIR"
|
||||
|
||||
info "Copying example Wallpaper..."
|
||||
|
||||
cp "$SCRIPT_DIR/assets/example_background.png" "$WALLPAPER_DIR/japan_old_emperor_stream_with_bridge.png"
|
||||
|
||||
info "Creating Wallpaper Folder Config"
|
||||
|
||||
cp "$SCRIPT_DIR/config/path/WallpaperPath.qml.template" "$SCRIPT_DIR/config/path/WallpaperPath.qml"
|
||||
sed -i "s|__CONFIG_DIR__|$WALLPAPER_DIR|g" "$SCRIPT_DIR/config/path/WallpaperPath.qml"
|
||||
|
||||
# 5. Ensure it exists
|
||||
mkdir -p "$WALLPAPER_DIR"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user