fix: update setup_systemd_service in install.sh to dynamically resolve binary location and append environment PATH

This commit is contained in:
Sho 2026-08-01 23:54:59 +09:00
parent afc1871c2c
commit a24624108a
2 changed files with 15 additions and 8 deletions

View File

@ -124,10 +124,12 @@ After=graphical-session.target
PartOf=graphical-session.target PartOf=graphical-session.target
[Service] [Service]
ExecStart=/usr/bin/quickshell -p %h/.config/quickshell Type=simple
ExecStart=/usr/bin/env quickshell -p %h/.config/quickshell
Restart=always Restart=always
RestartSec=2 RestartSec=3
Environment=QT_QPA_PLATFORM=wayland Environment=QT_QPA_PLATFORM=wayland
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:%h/.local/bin:%h/.cargo/bin
[Install] [Install]
WantedBy=graphical-session.target WantedBy=graphical-session.target

View File

@ -322,9 +322,12 @@ setup_bashrc() {
# 6. Systemd User Service Setup # 6. Systemd User Service Setup
setup_systemd_service() { setup_systemd_service() {
info "Setting up Systemd User Service for QuickShell..." info "Setting up Systemd User Service for QuickShell..."
SERVICE_DIR="${TARGET_CONFIG_DIR}/systemd/user" SERVICE_DIR="${HOME}/.config/systemd/user"
mkdir -p "$SERVICE_DIR" mkdir -p "$SERVICE_DIR"
# Dynamically detect quickshell binary on target machine or fallback to /usr/bin/env
QUICKSHELL_BIN="$(command -v quickshell 2>/dev/null || echo '/usr/bin/env quickshell')"
cat << EOF > "${SERVICE_DIR}/quickshell.service" cat << EOF > "${SERVICE_DIR}/quickshell.service"
[Unit] [Unit]
Description=QuickShell Desktop Shell Ecosystem Description=QuickShell Desktop Shell Ecosystem
@ -332,20 +335,22 @@ After=graphical-session.target
PartOf=graphical-session.target PartOf=graphical-session.target
[Service] [Service]
ExecStart=/usr/bin/quickshell -p %h/.config/quickshell Type=simple
ExecStart=${QUICKSHELL_BIN} -p %h/.config/quickshell
Restart=always Restart=always
RestartSec=2 RestartSec=3
Environment=QT_QPA_PLATFORM=wayland Environment=QT_QPA_PLATFORM=wayland
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:%h/.local/bin:%h/.cargo/bin
[Install] [Install]
WantedBy=graphical-session.target WantedBy=graphical-session.target
EOF EOF
systemctl --user daemon-reload systemctl --user daemon-reload
systemctl --user enable quickshell.service || warn "Could not enable quickshell service automatically" systemctl --user enable quickshell.service 2>/dev/null || warn "Could not enable quickshell service automatically"
info "Starting QuickShell systemd service..." info "Starting QuickShell systemd service..."
systemctl --user restart quickshell.service || warn "Could not start quickshell service automatically (is a Wayland session running?)" systemctl --user restart quickshell.service 2>/dev/null || warn "Could not start quickshell service automatically (is a Wayland session running?)"
success "Systemd user service configured!" success "Systemd user service configured at ${SERVICE_DIR}/quickshell.service!"
} }
# 7. Run Theme Sync Engine # 7. Run Theme Sync Engine