mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Flatpak improvement: add command to add xdg autostart, add startup command string
This commit is contained in:
@@ -1353,8 +1353,10 @@ namespace gsr {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(exit_status == 67) {
|
if(exit_status == 67) {
|
||||||
|
const bool is_flatpak = getenv("FLATPAK_ID") != nullptr;
|
||||||
|
const char *startup_command = is_flatpak ? "flatpak run com.dec05eba.gpu_screen_recorder gsr-ui" : "gsr-ui launch-daemon";
|
||||||
show_notification(
|
show_notification(
|
||||||
TR("To enable autorun: install and configure 'dex' (recommended), or manually add 'gsr-ui launch-daemon' to your desktop autostart entries."),
|
TRF("To enable autorun: install and configure 'dex' (recommended), or manually add '%s' to your desktop autostart entries.", startup_command).c_str(),
|
||||||
10.0,
|
10.0,
|
||||||
mgl::Color(255, 255, 255),
|
mgl::Color(255, 255, 255),
|
||||||
mgl::Color(255, 0, 0),
|
mgl::Color(255, 0, 0),
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ namespace gsr {
|
|||||||
|
|
||||||
const bool is_flatpak = getenv("FLATPAK_ID") != nullptr;
|
const bool is_flatpak = getenv("FLATPAK_ID") != nullptr;
|
||||||
const char *exec_line = is_flatpak
|
const char *exec_line = is_flatpak
|
||||||
? "Exec=flatpak run com.dec05eba.gpu_screen_recorder gsr-ui launch-daemon"
|
? "Exec=flatpak run com.dec05eba.gpu_screen_recorder gsr-ui"
|
||||||
: "Exec=gsr-ui launch-daemon";
|
: "Exec=gsr-ui launch-daemon";
|
||||||
|
|
||||||
std::string content =
|
std::string content =
|
||||||
|
|||||||
12
src/main.cpp
12
src/main.cpp
@@ -149,7 +149,8 @@ enum class LaunchAction {
|
|||||||
LAUNCH_SHOW,
|
LAUNCH_SHOW,
|
||||||
LAUNCH_HIDE,
|
LAUNCH_HIDE,
|
||||||
LAUNCH_HIDE_ANNOUNCE,
|
LAUNCH_HIDE_ANNOUNCE,
|
||||||
LAUNCH_DAEMON
|
LAUNCH_DAEMON,
|
||||||
|
INSTALL_STARTUP
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
@@ -190,6 +191,8 @@ int main(int argc, char **argv) {
|
|||||||
launch_action = LaunchAction::LAUNCH_HIDE_ANNOUNCE;
|
launch_action = LaunchAction::LAUNCH_HIDE_ANNOUNCE;
|
||||||
} else if(strcmp(launch_action_opt, "launch-daemon") == 0) {
|
} else if(strcmp(launch_action_opt, "launch-daemon") == 0) {
|
||||||
launch_action = LaunchAction::LAUNCH_DAEMON;
|
launch_action = LaunchAction::LAUNCH_DAEMON;
|
||||||
|
} else if(strcmp(launch_action_opt, "install-startup") == 0) {
|
||||||
|
launch_action = LaunchAction::INSTALL_STARTUP;
|
||||||
} else {
|
} else {
|
||||||
printf("error: invalid action \"%s\", expected \"launch-show\", \"launch-hide\", \"launch-hide-announce\" or \"launch-daemon\".\n", launch_action_opt);
|
printf("error: invalid action \"%s\", expected \"launch-show\", \"launch-hide\", \"launch-hide-announce\" or \"launch-daemon\".\n", launch_action_opt);
|
||||||
usage();
|
usage();
|
||||||
@@ -198,6 +201,9 @@ int main(int argc, char **argv) {
|
|||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(launch_action == LaunchAction::INSTALL_STARTUP)
|
||||||
|
return gsr::set_xdg_autostart(true);
|
||||||
|
|
||||||
set_display_server_environment_variables();
|
set_display_server_environment_variables();
|
||||||
|
|
||||||
const std::string gsr_icon_path = resources_path + "images/gpu_screen_recorder_logo.png";
|
const std::string gsr_icon_path = resources_path + "images/gpu_screen_recorder_logo.png";
|
||||||
@@ -306,8 +312,10 @@ int main(int argc, char **argv) {
|
|||||||
if(gsr::is_systemd_service_enabled(deprecated_systemd_service_name)) {
|
if(gsr::is_systemd_service_enabled(deprecated_systemd_service_name)) {
|
||||||
const int autostart_result = gsr::set_xdg_autostart(true);
|
const int autostart_result = gsr::set_xdg_autostart(true);
|
||||||
if(autostart_result == 67) {
|
if(autostart_result == 67) {
|
||||||
|
const bool is_flatpak = getenv("FLATPAK_ID") != nullptr;
|
||||||
|
const char *startup_command = is_flatpak ? "flatpak run com.dec05eba.gpu_screen_recorder gsr-ui" : "gsr-ui launch-daemon";
|
||||||
overlay->show_notification(
|
overlay->show_notification(
|
||||||
TR("GPU Screen Recorder UI autostart via systemd is deprecated.\nTo migrate: install and configure 'dex' (recommended),\nor manually add 'gsr-ui launch-daemon' to your desktop autostart entries."),
|
TRF("GPU Screen Recorder UI autostart via systemd is deprecated.\nTo migrate: install and configure 'dex' (recommended),\nor manually add '%s' to your desktop autostart entries.", startup_command).c_str(),
|
||||||
10.0, mgl::Color(255, 255, 255), mgl::Color(255, 0, 0),
|
10.0, mgl::Color(255, 255, 255), mgl::Color(255, 0, 0),
|
||||||
gsr::NotificationType::NOTICE, nullptr, gsr::NotificationLevel::ERROR);
|
gsr::NotificationType::NOTICE, nullptr, gsr::NotificationLevel::ERROR);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -98,9 +98,9 @@ Failed to launch gpu-screen-recorder to take a screenshot=Fallo al lanzar gpu-sc
|
|||||||
# System startup notifications
|
# System startup notifications
|
||||||
Failed to add GPU Screen Recorder to system startup=Fallo al añadir GPU Screen Recorder al inicio del sistema
|
Failed to add GPU Screen Recorder to system startup=Fallo al añadir GPU Screen Recorder al inicio del sistema
|
||||||
Failed to remove GPU Screen Recorder from system startup=Fallo al eliminar GPU Screen Recorder del inicio del sistema
|
Failed to remove GPU Screen Recorder from system startup=Fallo al eliminar GPU Screen Recorder del inicio del sistema
|
||||||
To enable autorun: install and configure 'dex' (recommended), or manually add 'gsr-ui launch-daemon' to your desktop autostart entries.=Para activar el inicio automático: instala y configura 'dex' (recomendado) o añade manualmente 'gsr-ui launch-daemon' a las entradas de inicio automático del escritorio.
|
To enable autorun: install and configure 'dex' (recommended), or manually add '%s' to your desktop autostart entries.=Para activar el inicio automático: instala y configura 'dex' (recomendado) o añade manualmente '%s' a las entradas de inicio automático del escritorio.
|
||||||
GPU Screen Recorder UI startup has been switched from systemd service to XDG autostart.=El inicio de GPU Screen Recorder UI ha cambiado del servicio systemd al inicio automático XDG.
|
GPU Screen Recorder UI startup has been switched from systemd service to XDG autostart.=El inicio de GPU Screen Recorder UI ha cambiado del servicio systemd al inicio automático XDG.
|
||||||
GPU Screen Recorder UI autostart via systemd is deprecated.\nTo migrate: install and configure 'dex' (recommended),\nor manually add 'gsr-ui launch-daemon' to your desktop autostart entries.=El inicio automático de GPU Screen Recorder UI mediante systemd está obsoleto.\nPara migrar: instala y configura 'dex' (recomendado)\no añade manualmente 'gsr-ui launch-daemon' a las entradas de inicio automático del escritorio.
|
GPU Screen Recorder UI autostart via systemd is deprecated.\nTo migrate: install and configure 'dex' (recommended),\nor manually add '%s' to your desktop autostart entries.=El inicio automático de GPU Screen Recorder UI mediante systemd está obsoleto.\nPara migrar: instala y configura 'dex' (recomendado)\no añade manualmente '%s' a las entradas de inicio automático del escritorio.
|
||||||
|
|
||||||
# Wayland warning
|
# Wayland warning
|
||||||
Wayland doesn't support GPU Screen Recorder UI properly,\nthings may not work as expected. Use X11 if you experience issues.=Wayland no ofrece soporte adecuado para GPU Screen Recorder UI;\nes posible que el funcionamiento no sea el esperado. Si experimentas problemas, utiliza X11.
|
Wayland doesn't support GPU Screen Recorder UI properly,\nthings may not work as expected. Use X11 if you experience issues.=Wayland no ofrece soporte adecuado para GPU Screen Recorder UI;\nes posible que el funcionamiento no sea el esperado. Si experimentas problemas, utiliza X11.
|
||||||
|
|||||||
@@ -101,9 +101,9 @@ Failed to launch gpu-screen-recorder to take a screenshot=Échec du lancement de
|
|||||||
# System startup notifications
|
# System startup notifications
|
||||||
Failed to add GPU Screen Recorder to system startup=Échec de l’ajout de GPU Screen Recorder au démarrage du système
|
Failed to add GPU Screen Recorder to system startup=Échec de l’ajout de GPU Screen Recorder au démarrage du système
|
||||||
Failed to remove GPU Screen Recorder from system startup=Échec de la suppression de GPU Screen Recorder du démarrage du système
|
Failed to remove GPU Screen Recorder from system startup=Échec de la suppression de GPU Screen Recorder du démarrage du système
|
||||||
To enable autorun: install and configure 'dex' (recommended), or manually add 'gsr-ui launch-daemon' to your desktop autostart entries.=Pour activer le démarrage automatique : installez et configurez 'dex' (recommandé) ou ajoutez manuellement 'gsr-ui launch-daemon' aux entrées de démarrage automatique du bureau.
|
To enable autorun: install and configure 'dex' (recommended), or manually add '%s' to your desktop autostart entries.=Pour activer le démarrage automatique : installez et configurez 'dex' (recommandé) ou ajoutez manuellement '%s' aux entrées de démarrage automatique du bureau.
|
||||||
GPU Screen Recorder UI startup has been switched from systemd service to XDG autostart.=Le démarrage de GPU Screen Recorder UI a été basculé du service systemd vers le démarrage automatique XDG.
|
GPU Screen Recorder UI startup has been switched from systemd service to XDG autostart.=Le démarrage de GPU Screen Recorder UI a été basculé du service systemd vers le démarrage automatique XDG.
|
||||||
GPU Screen Recorder UI autostart via systemd is deprecated.\nTo migrate: install and configure 'dex' (recommended),\nor manually add 'gsr-ui launch-daemon' to your desktop autostart entries.=Le démarrage automatique de GPU Screen Recorder UI via systemd est obsolète.\nPour migrer : installez et configurez 'dex' (recommandé)\nou ajoutez manuellement 'gsr-ui launch-daemon' aux entrées de démarrage automatique du bureau.
|
GPU Screen Recorder UI autostart via systemd is deprecated.\nTo migrate: install and configure 'dex' (recommended),\nor manually add '%s' to your desktop autostart entries.=Le démarrage automatique de GPU Screen Recorder UI via systemd est obsolète.\nPour migrer : installez et configurez 'dex' (recommandé)\nou ajoutez manuellement '%s' aux entrées de démarrage automatique du bureau.
|
||||||
|
|
||||||
# Wayland warning
|
# Wayland warning
|
||||||
Wayland doesn't support GPU Screen Recorder UI properly,\nthings may not work as expected. Use X11 if you experience issues.=Wayland ne supporte pas correctement l’UI de GPU Screen Recorder,\ncertains éléments peuvent mal fonctionner. Utilisez X11 si vous rencontrez des problèmes.
|
Wayland doesn't support GPU Screen Recorder UI properly,\nthings may not work as expected. Use X11 if you experience issues.=Wayland ne supporte pas correctement l’UI de GPU Screen Recorder,\ncertains éléments peuvent mal fonctionner. Utilisez X11 si vous rencontrez des problèmes.
|
||||||
|
|||||||
@@ -98,9 +98,9 @@ Failed to launch gpu-screen-recorder to take a screenshot=Не удалось з
|
|||||||
# System startup notifications
|
# System startup notifications
|
||||||
Failed to add GPU Screen Recorder to system startup=Не удалось добавить GPU Screen Recorder в автозагрузку системы
|
Failed to add GPU Screen Recorder to system startup=Не удалось добавить GPU Screen Recorder в автозагрузку системы
|
||||||
Failed to remove GPU Screen Recorder from system startup=Не удалось удалить GPU Screen Recorder из автозагрузки системы
|
Failed to remove GPU Screen Recorder from system startup=Не удалось удалить GPU Screen Recorder из автозагрузки системы
|
||||||
To enable autorun: install and configure 'dex' (recommended), or manually add 'gsr-ui launch-daemon' to your desktop autostart entries.=Для включения автозапуска: установите и настройте 'dex' (рекомендуется) или вручную добавьте 'gsr-ui launch-daemon' в записи автозапуска рабочего стола.
|
To enable autorun: install and configure 'dex' (recommended), or manually add '%s' to your desktop autostart entries.=Для включения автозапуска: установите и настройте 'dex' (рекомендуется) или вручную добавьте '%s' в записи автозапуска рабочего стола.
|
||||||
GPU Screen Recorder UI startup has been switched from systemd service to XDG autostart.=Автозапуск GPU Screen Recorder UI переключён с сервиса systemd на XDG-автозапуск.
|
GPU Screen Recorder UI startup has been switched from systemd service to XDG autostart.=Автозапуск GPU Screen Recorder UI переключён с сервиса systemd на XDG-автозапуск.
|
||||||
GPU Screen Recorder UI autostart via systemd is deprecated.\nTo migrate: install and configure 'dex' (recommended),\nor manually add 'gsr-ui launch-daemon' to your desktop autostart entries.=Автозапуск GPU Screen Recorder UI через systemd устарел.\nДля миграции: установите и настройте 'dex' (рекомендуется)\nили вручную добавьте 'gsr-ui launch-daemon' в записи автозапуска рабочего стола.
|
GPU Screen Recorder UI autostart via systemd is deprecated.\nTo migrate: install and configure 'dex' (recommended),\nor manually add '%s' to your desktop autostart entries.=Автозапуск GPU Screen Recorder UI через systemd устарел.\nДля миграции: установите и настройте 'dex' (рекомендуется)\nили вручную добавьте '%s' в записи автозапуска рабочего стола.
|
||||||
|
|
||||||
# Wayland warning
|
# Wayland warning
|
||||||
Wayland doesn't support GPU Screen Recorder UI properly,\nthings may not work as expected. Use X11 if you experience issues.=Wayland не поддерживает интерфейс GPU Screen Recorder должным образом,\nнекоторые функции могут не работать. Используйте X11, если возникнут проблемы.
|
Wayland doesn't support GPU Screen Recorder UI properly,\nthings may not work as expected. Use X11 if you experience issues.=Wayland не поддерживает интерфейс GPU Screen Recorder должным образом,\nнекоторые функции могут не работать. Используйте X11, если возникнут проблемы.
|
||||||
|
|||||||
@@ -101,9 +101,9 @@ Failed to launch gpu-screen-recorder to take a screenshot=
|
|||||||
# System startup notifications
|
# System startup notifications
|
||||||
Failed to add GPU Screen Recorder to system startup=
|
Failed to add GPU Screen Recorder to system startup=
|
||||||
Failed to remove GPU Screen Recorder from system startup=
|
Failed to remove GPU Screen Recorder from system startup=
|
||||||
To enable autorun: install and configure 'dex' (recommended), or manually add 'gsr-ui launch-daemon' to your desktop autostart entries.=
|
To enable autorun: install and configure 'dex' (recommended), or manually add '%s' to your desktop autostart entries.=
|
||||||
GPU Screen Recorder UI startup has been switched from systemd service to XDG autostart.=
|
GPU Screen Recorder UI startup has been switched from systemd service to XDG autostart.=
|
||||||
GPU Screen Recorder UI autostart via systemd is deprecated.\nTo migrate: install and configure 'dex' (recommended),\nor manually add 'gsr-ui launch-daemon' to your desktop autostart entries.=
|
GPU Screen Recorder UI autostart via systemd is deprecated.\nTo migrate: install and configure 'dex' (recommended),\nor manually add '%s' to your desktop autostart entries.=
|
||||||
|
|
||||||
# Wayland warning
|
# Wayland warning
|
||||||
Wayland doesn't support GPU Screen Recorder UI properly,\nthings may not work as expected. Use X11 if you experience issues.=
|
Wayland doesn't support GPU Screen Recorder UI properly,\nthings may not work as expected. Use X11 if you experience issues.=
|
||||||
|
|||||||
@@ -98,9 +98,9 @@ Failed to launch gpu-screen-recorder to take a screenshot=Не вдалося з
|
|||||||
# System startup notifications
|
# System startup notifications
|
||||||
Failed to add GPU Screen Recorder to system startup=Не вдалося додати GPU Screen Recorder до автозавантаження системи
|
Failed to add GPU Screen Recorder to system startup=Не вдалося додати GPU Screen Recorder до автозавантаження системи
|
||||||
Failed to remove GPU Screen Recorder from system startup=Не вдалося видалити GPU Screen Recorder з автозавантаження системи
|
Failed to remove GPU Screen Recorder from system startup=Не вдалося видалити GPU Screen Recorder з автозавантаження системи
|
||||||
To enable autorun: install and configure 'dex' (recommended), or manually add 'gsr-ui launch-daemon' to your desktop autostart entries.=Для увімкнення автозапуску: встановіть та налаштуйте 'dex' (рекомендовано) або вручну додайте 'gsr-ui launch-daemon' до записів автозапуску робочого столу.
|
To enable autorun: install and configure 'dex' (recommended), or manually add '%s' to your desktop autostart entries.=Для увімкнення автозапуску: встановіть та налаштуйте 'dex' (рекомендовано) або вручну додайте '%s' до записів автозапуску робочого столу.
|
||||||
GPU Screen Recorder UI startup has been switched from systemd service to XDG autostart.=Автозапуск GPU Screen Recorder UI переключено зі служби systemd на XDG-автозапуск.
|
GPU Screen Recorder UI startup has been switched from systemd service to XDG autostart.=Автозапуск GPU Screen Recorder UI переключено зі служби systemd на XDG-автозапуск.
|
||||||
GPU Screen Recorder UI autostart via systemd is deprecated.\nTo migrate: install and configure 'dex' (recommended),\nor manually add 'gsr-ui launch-daemon' to your desktop autostart entries.=Автозапуск GPU Screen Recorder UI через systemd застарів.\nДля міграції: встановіть та налаштуйте 'dex' (рекомендовано)\nабо вручну додайте 'gsr-ui launch-daemon' до записів автозапуску робочого столу.
|
GPU Screen Recorder UI autostart via systemd is deprecated.\nTo migrate: install and configure 'dex' (recommended),\nor manually add '%s' to your desktop autostart entries.=Автозапуск GPU Screen Recorder UI через systemd застарів.\nДля міграції: встановіть та налаштуйте 'dex' (рекомендовано)\nабо вручну додайте '%s' до записів автозапуску робочого столу.
|
||||||
|
|
||||||
# Wayland warning
|
# Wayland warning
|
||||||
Wayland doesn't support GPU Screen Recorder UI properly,\nthings may not work as expected. Use X11 if you experience issues.=Wayland не підтримує інтерфейс GPU Screen Recorder належним чином,\nдеякі функції можуть не працювати. Використовуйте X11, якщо виникнуть проблеми.
|
Wayland doesn't support GPU Screen Recorder UI properly,\nthings may not work as expected. Use X11 if you experience issues.=Wayland не підтримує інтерфейс GPU Screen Recorder належним чином,\nдеякі функції можуть не працювати. Використовуйте X11, якщо виникнуть проблеми.
|
||||||
|
|||||||
Reference in New Issue
Block a user