Wire dms.service to hyprland-session.target -- DMS never actually launched
hyprland.conf's exec-once starts hyprland-session.target, but the installer never created that systemd user unit or wired dms.service to it, so Hyprland launched fine while DMS/quickshell (panel, dock, spotlight, all keybinds routed through it) silently never started. Added install_session_target(), which writes the unit file (same content already working on the reference machine) and runs daemon-reload + add-wants.
This commit is contained in:
1 parent
506eacb03e
commit
6c6258af9e
2 files changed
+54
No files matched your search
+17
@@ -205,6 +205,21 @@ build_package_list() {
|
||||
printf '%s\n' "${pkgs[@]}" | awk '!seen[$0]++' | tr '\n' ' '
|
||||
}
|
||||
|
||||
install_session_target() {
|
||||
mkdir -p "$CONFIG_HOME/systemd/user"
|
||||
cat > "$CONFIG_HOME/systemd/user/hyprland-session.target" <<'EOF'
|
||||
[Unit]
|
||||
Description=Hyprland Session Target
|
||||
Requires=graphical-session.target
|
||||
After=graphical-session.target
|
||||
Wants=xdg-desktop-autostart.target
|
||||
After=xdg-desktop-autostart.target
|
||||
EOF
|
||||
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user add-wants hyprland-session.target dms.service
|
||||
}
|
||||
|
||||
backup_if_exists() {
|
||||
local target="$1"
|
||||
[[ -e "$target" ]] || return 0
|
||||
@@ -241,6 +256,8 @@ apply() {
|
||||
build_extras_conf > "$CONFIG_HOME/hypr/extras.conf"
|
||||
terminal_desktop_id "$PICK_TERMINAL" > "$CONFIG_HOME/xdg-terminals.list"
|
||||
|
||||
install_session_target
|
||||
|
||||
if [[ " ${PICK_TOGGLES[*]} " == *" ScreenCapture "* ]]; then
|
||||
mkdir -p "$LOCAL_BIN"
|
||||
cp "$REPO_DIR/local-bin/capture-menu.sh" "$LOCAL_BIN/"
|
||||
|
||||
@@ -220,6 +220,38 @@ EOF
|
||||
[[ "$result" != *'$terminal = konsole'* ]]
|
||||
}
|
||||
|
||||
@test "install_session_target writes the unit file and wires dms.service to it" {
|
||||
source "${BATS_TEST_DIRNAME}/../install.sh"
|
||||
|
||||
local tmp_home
|
||||
tmp_home="$(mktemp -d)"
|
||||
local stub_bin
|
||||
stub_bin="$(mktemp -d)"
|
||||
|
||||
cat > "$stub_bin/systemctl" <<'EOF'
|
||||
#!/usr/bin/env bash
|
||||
echo "systemctl $*" >> "$HYPREVO_TEST_LOG"
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x "$stub_bin/systemctl"
|
||||
|
||||
export HYPREVO_TEST_LOG="$tmp_home/log"
|
||||
export PATH="$stub_bin:$PATH"
|
||||
export CONFIG_HOME="$tmp_home/.config"
|
||||
|
||||
install_session_target
|
||||
|
||||
local unit_file="$CONFIG_HOME/systemd/user/hyprland-session.target"
|
||||
[ -f "$unit_file" ]
|
||||
grep -q '^Requires=graphical-session.target$' "$unit_file"
|
||||
grep -q '^Wants=xdg-desktop-autostart.target$' "$unit_file"
|
||||
|
||||
grep -q 'daemon-reload' "$HYPREVO_TEST_LOG"
|
||||
grep -q 'add-wants hyprland-session.target dms.service' "$HYPREVO_TEST_LOG"
|
||||
|
||||
rm -rf "$tmp_home" "$stub_bin"
|
||||
}
|
||||
|
||||
@test "build_package_list combines core, slot, and toggle packages with no duplicates" {
|
||||
source "${BATS_TEST_DIRNAME}/../install.sh"
|
||||
PICK_TERMINAL=Konsole PICK_FILEMANAGER=Dolphin PICK_MAIL=Thunderbird PICK_CLOUDSYNC=Nextcloud
|
||||
@@ -299,6 +331,11 @@ EOF
|
||||
# Syncthing's systemd user service was enabled, since CloudSync=Syncthing.
|
||||
grep -q 'enable --now --user syncthing.service' "$HYPREVO_TEST_LOG"
|
||||
|
||||
# hyprland-session.target was written and dms.service wired to it, so
|
||||
# DMS actually launches on login (this was previously missing entirely).
|
||||
[ -f "$CONFIG_HOME/systemd/user/hyprland-session.target" ]
|
||||
grep -q 'add-wants hyprland-session.target dms.service' "$HYPREVO_TEST_LOG"
|
||||
|
||||
rm -rf "$tmp_home" "$stub_bin"
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user