diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-12-31 17:32:32 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-12-31 17:32:32 +0100 |
commit | cddf3eac2caf831d3a5e8519d396f67cefc520c0 (patch) | |
tree | 9a257367231c56742a39f7d6ace07c9890398eeb /src | |
parent | bbe4d09ac0b4045dfdad43cea58ab781867d83ea (diff) |
Correct XDG_DATA_HOME path for systemd service
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 0542b8a..321d640 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2790,7 +2790,9 @@ static gboolean on_click_switch_to_new_ui(GtkButton*, gpointer) { } bool service_install_successful = (system("flatpak-spawn --host -- pkexec rm /usr/lib/systemd/user/gpu-screen-recorder-ui.service") <= 1); - service_install_successful &= (system("flatpak-spawn --host -- install -Dm644 /var/lib/flatpak/app/com.dec05eba.gpu_screen_recorder/current/active/files/share/gpu-screen-recorder/gpu-screen-recorder-ui.service \"${XDG_DATA_HOME:-$HOME/.local/share}/systemd/user/gpu-screen-recorder-ui.service\"") == 0); + service_install_successful &= (system( + "data_home=$(flatpak-spawn --host -- /bin/sh -c 'echo \"${XDG_DATA_HOME:-$HOME/.local/share}\"') && " + "flatpak-spawn --host -- install -Dm644 /var/lib/flatpak/app/com.dec05eba.gpu_screen_recorder/current/active/files/share/gpu-screen-recorder/gpu-screen-recorder-ui.service \"$data_home/systemd/user/gpu-screen-recorder-ui.service\"") == 0); service_install_successful &= (system("flatpak-spawn --host -- systemctl --user daemon-reload") == 0); service_install_successful &= (system("flatpak-spawn --host -- systemctl enable --now --user gpu-screen-recorder-ui") == 0); if(!service_install_successful) { |