diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-12-29 19:34:37 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-12-29 19:34:37 +0100 |
commit | 9dd20e29165a44993ec64b7074b52d134f4dfcd9 (patch) | |
tree | 38e34329f76c5b296788fdd04a02eb1fb51d1631 /src/gui/GlobalSettingsPage.cpp | |
parent | b865f5cae3c503be65ce55b58fae09589cff3b0f (diff) |
Revert "Change name of flatpak systemd service"
This reverts commit b865f5cae3c503be65ce55b58fae09589cff3b0f.
Diffstat (limited to 'src/gui/GlobalSettingsPage.cpp')
-rw-r--r-- | src/gui/GlobalSettingsPage.cpp | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/gui/GlobalSettingsPage.cpp b/src/gui/GlobalSettingsPage.cpp index 04c2874..7e79c16 100644 --- a/src/gui/GlobalSettingsPage.cpp +++ b/src/gui/GlobalSettingsPage.cpp @@ -75,17 +75,9 @@ namespace gsr { else return; + const char *args[] = { "systemctl", enable ? "enable" : "disable", "--user", "gpu-screen-recorder-ui", nullptr }; std::string stdout_str; - int exit_status = 0; - const bool inside_flatpak = getenv("FLATPAK_ID") != NULL; - if(inside_flatpak) { - const char *args[] = { "flatpak-spawn", "--host", "--", "systemctl", enable ? "enable" : "disable", "--user", "gpu-screen-recorder-ui-flatpak", nullptr }; - exit_status = exec_program_get_stdout(args, stdout_str); - } else { - const char *args[] = { "systemctl", enable ? "enable" : "disable", "--user", "gpu-screen-recorder-ui", nullptr }; - exit_status = exec_program_get_stdout(args, stdout_str); - } - + const int exit_status = exec_program_on_host_get_stdout(args, stdout_str); if(on_startup_changed) on_startup_changed(enable, exit_status); }; @@ -115,17 +107,9 @@ namespace gsr { else tint_color_radio_button_ptr->set_selected_item(config.main_config.tint_color); + const char *args[] = { "systemctl", "is-enabled", "--quiet", "--user", "gpu-screen-recorder-ui", nullptr }; std::string stdout_str; - int exit_status = 0; - const bool inside_flatpak = getenv("FLATPAK_ID") != NULL; - if(inside_flatpak) { - const char *args[] = { "flatpak-spawn", "--host", "--", "systemctl", "is-enabled", "--quiet", "--user", "gpu-screen-recorder-ui", nullptr }; - exit_status = exec_program_get_stdout(args, stdout_str); - } else { - const char *args[] = { "systemctl", "is-enabled", "--quiet", "--user", "gpu-screen-recorder-ui", nullptr }; - exit_status = exec_program_get_stdout(args, stdout_str); - } - + const int exit_status = exec_program_on_host_get_stdout(args, stdout_str); startup_radio_button_ptr->set_selected_item(exit_status == 0 ? "start_on_system_startup" : "dont_start_on_system_startup", false, false); } |