aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-12-31 17:56:16 +0100
committerdec05eba <dec05eba@protonmail.com>2024-12-31 17:56:16 +0100
commit1f672b118eb84eec82da891dd4e8f13d2f025a40 (patch)
tree6f846d72046ffc9d5a9c65b6062e322418487ec7
parent4647f0fff28a4cb6d6d63a345bef2e53179e92d6 (diff)
Fix service install showing error when successfuly
-rw-r--r--src/main.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 3bbcbf2..2614a65 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2793,16 +2793,11 @@ static gboolean on_click_switch_to_new_ui(GtkButton*, gpointer) {
config.main_config.installed_gsr_global_hotkeys_version = GSR_CURRENT_GLOBAL_HOTKEYS_CODE_VERSION;
save_configs();
- bool service_install_successful = (system("flatpak-spawn --host -- pkexec rm /usr/lib/systemd/user/gpu-screen-recorder-ui.service") <= 1);
- fprintf(stderr, "1 success: %s\n", service_install_successful ? "yes" : "no");
- service_install_successful &= (system(
+ bool 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);
- fprintf(stderr, "2 success: %s\n", service_install_successful ? "yes" : "no");
service_install_successful &= (system("flatpak-spawn --host -- systemctl --user daemon-reload") == 0);
- fprintf(stderr, "3 success: %s\n", service_install_successful ? "yes" : "no");
service_install_successful &= (system("flatpak-spawn --host -- systemctl enable --now --user gpu-screen-recorder-ui") == 0);
- fprintf(stderr, "4 success: %s\n", service_install_successful ? "yes" : "no");
if(!service_install_successful) {
GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK,
"Failed to add GPU Screen Recorder to system startup. If you want the new UI to start on system startup then you need to add this command to system startup:\n"