From 15f655d0203416afc643570795a0f0334ccf624c Mon Sep 17 00:00:00 2001 From: Sho Date: Sat, 1 Aug 2026 23:11:22 +0900 Subject: [PATCH] feat: add wallust and lutgen auto-installer to install.sh and fix hardcoded paths in Theme.qml --- install.sh | 49 +++++++++++++++++++++++++++++++++++++- quickshell/theme/Theme.qml | 6 ++--- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index e82a3ff..00d864f 100755 --- a/install.sh +++ b/install.sh @@ -186,7 +186,53 @@ install_quickshell() { success "QuickShell built and installed from source!" } -# 4. Copying and Linking Configurations +# 4. Wallust & Lutgen Binary Check / Installation +install_wallust_lutgen() { + info "Checking wallust and lutgen installation..." + + ensure_cargo() { + if ! command -v cargo &>/dev/null && [ ! -f "$HOME/.cargo/bin/cargo" ]; then + info "Installing Cargo package manager for Rust tools..." + case "$PM" in + dnf) sudo dnf install -y cargo rust || true ;; + pacman) sudo pacman -S --needed --noconfirm rust cargo || true ;; + apt) sudo apt-get install -y cargo rustc || true ;; + esac + fi + } + + # Install wallust + if command -v wallust &>/dev/null || [ -f "$HOME/.cargo/bin/wallust" ]; then + success "wallust binary found!" + else + info "Installing wallust..." + if [ "$PM" = "pacman" ] && command -v yay &>/dev/null; then + yay -S --needed --noconfirm wallust || { ensure_cargo; cargo install wallust; } || warn "Could not install wallust" + elif [ "$PM" = "pacman" ] && command -v paru &>/dev/null; then + paru -S --needed --noconfirm wallust || { ensure_cargo; cargo install wallust; } || warn "Could not install wallust" + else + ensure_cargo + cargo install wallust || warn "Could not install wallust" + fi + fi + + # Install lutgen + if command -v lutgen &>/dev/null || [ -f "$HOME/.cargo/bin/lutgen" ] || command -v lutgen-cli &>/dev/null; then + success "lutgen binary found!" + else + info "Installing lutgen..." + if [ "$PM" = "pacman" ] && command -v yay &>/dev/null; then + yay -S --needed --noconfirm lutgen-cli || { ensure_cargo; cargo install lutgen; } || warn "Could not install lutgen" + elif [ "$PM" = "pacman" ] && command -v paru &>/dev/null; then + paru -S --needed --noconfirm lutgen-cli || { ensure_cargo; cargo install lutgen; } || warn "Could not install lutgen" + else + ensure_cargo + cargo install lutgen || warn "Could not install lutgen" + fi + fi +} + +# 5. Copying and Linking Configurations deploy_configs() { info "Deploying QuickShell configuration to ${TARGET_CONFIG_DIR}..." mkdir -p "${TARGET_CONFIG_DIR}" @@ -278,6 +324,7 @@ run_initial_sync() { # Execution Flow install_dependencies install_quickshell +install_wallust_lutgen deploy_configs setup_bashrc setup_systemd_service diff --git a/quickshell/theme/Theme.qml b/quickshell/theme/Theme.qml index 4741c18..62fa928 100644 --- a/quickshell/theme/Theme.qml +++ b/quickshell/theme/Theme.qml @@ -8,7 +8,7 @@ Item { id: root property string currentVariant: "Pro" - property string wallpaperPath: "file:///home/sho/Pictures/Wallpapers/Pro/lutgen_Pro_wallhaven.png" + property string wallpaperPath: "file://" + Quickshell.env("HOME") + "/Pictures/Wallpapers/Pro/lutgen_Pro_wallhaven.png" readonly property var themeCategories: [ "All", "Zoey Pink", "Dracula Pro", "Gruvbox", "Rosé Pine", "Catppuccin", "Everforest", "Tokyo Night", "Nord", "Solarized", "One Theme", "Monokai", "Cyberpunk" @@ -168,7 +168,7 @@ Item { wallpaperPath = imgPath.startsWith("file://") ? imgPath : "file://" + imgPath let rawPath = imgPath.replace("file://", "") Quickshell.execDetached(["plasma-apply-wallpaperimage", rawPath]) - Quickshell.execDetached(["/home/sho/.cargo/bin/wallust", "run", rawPath]) + Quickshell.execDetached(["sh", "-c", "wallust run '" + rawPath + "' || ~/.cargo/bin/wallust run '" + rawPath + "' 2>/dev/null || true"]) // Persist selected theme variant to disk Quickshell.execDetached(["sh", "-c", "echo '" + v.name + "' > ~/.config/quickshell_current_theme.txt"]) @@ -202,7 +202,7 @@ Item { } } } - return "/home/sho/Pictures/Wallpapers/" + varName + "/wallhaven-yqg6r7_1920x1080.png" + return Quickshell.env("HOME") + "/Pictures/Wallpapers/" + varName + "/wallhaven-yqg6r7_1920x1080.png" } function cycleVariant() {