From c6b5ff05ecf4072ab83d5618eb41937b0db489c8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 27 Oct 2024 14:08:47 +0100 Subject: Add systemd service --- README.md | 3 +++ extra/gpu-screen-recorder-ui.service | 11 +++++++++++ meson.build | 6 +++++- meson_options.txt | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 extra/gpu-screen-recorder-ui.service create mode 100644 meson_options.txt diff --git a/README.md b/README.md index 49c15cc..8dfdb15 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # GPU Screen Recorder UI A fullscreen overlay UI for [GPU Screen Recorder](https://git.dec05eba.com/gpu-screen-recorder/about/) in the style of ShadowPlay. +# Usage +Run `gsr-ui` and press `Alt+Z` to show/hide the UI. You can start the overlay UI at system startup by running `systemctl enable --now --user gpu-screen-recorder-ui`. + # Dependencies GPU Screen Recorder UI uses meson build system so you need to install `meson` to build GPU Screen Recorder UI. diff --git a/extra/gpu-screen-recorder-ui.service b/extra/gpu-screen-recorder-ui.service new file mode 100644 index 0000000..8abb3de --- /dev/null +++ b/extra/gpu-screen-recorder-ui.service @@ -0,0 +1,11 @@ +[Unit] +Description=GPU Screen Recorder UI Service + +[Service] +ExecStart=gsr-ui +KillSignal=SIGINT +Restart=on-failure +RestartSec=5s + +[Install] +WantedBy=default.target \ No newline at end of file diff --git a/meson.build b/meson.build index 82b00ca..edd90b8 100644 --- a/meson.build +++ b/meson.build @@ -58,4 +58,8 @@ executable( ) install_subdir('images', install_dir : gsr_ui_resources_path) -install_subdir('fonts', install_dir : gsr_ui_resources_path) \ No newline at end of file +install_subdir('fonts', install_dir : gsr_ui_resources_path) + +if get_option('systemd') == true + install_data(files('extra/gpu-screen-recorder-ui.service'), install_dir : 'lib/systemd/user') +endif \ No newline at end of file diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..9d0b960 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1 @@ +option('systemd', type : 'boolean', value : true, description : 'Install systemd service file') -- cgit v1.2.3