aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-12-29 22:03:46 +0100
committerdec05eba <dec05eba@protonmail.com>2024-12-29 22:03:46 +0100
commit3505c77d31be2940e06e22d619f7be5fa71184fc (patch)
tree21b8bf44e70a17d9130e5c2eb76e5faa899b0258 /src
parent1dd7ed9f413f637eddf63a26542f9615c435a1d0 (diff)
Start service immediately after gsr-ui install
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 97820fd..cf0a48a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2789,7 +2789,7 @@ static gboolean on_click_switch_to_new_ui(GtkButton*, gpointer) {
bool service_install_successful = system("flatpak-spawn --host -- pkexec install -Dm644 /var/lib/flatpak/app/com.dec05eba.gpu_screen_recorder/current/active/files/share/gpu-screen-recorder/gpu-screen-recorder-ui.service /usr/lib/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 --user gpu-screen-recorder-ui") == 0);
+ service_install_successful &= (system("flatpak-spawn --host -- systemctl enable --now --user gpu-screen-recorder-ui") == 0);
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"
@@ -2802,7 +2802,9 @@ 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();
- launch_gsr_ui(true);
+ if(!service_install_successful)
+ launch_gsr_ui(true);
+
exit(0);
return true;
}