From dd12e88b07222f324d248f2921b76e4b15293249 Mon Sep 17 00:00:00 2001 From: Yanase Yuki Date: Tue, 7 Nov 2023 11:28:56 +0900 Subject: [PATCH] qubes-run-terminal: add gnome-console support qubes-run-gnome-console is added for future proofness. from kgx --help --wait Wait until the child exits (TODO) --- app-menu/Makefile | 1 + app-menu/qubes-run-gnome-console | 11 +++++++++++ app-menu/qubes-run-terminal | 4 ++++ debian/qubes-core-agent.install | 1 + rpm_spec/core-agent.spec.in | 1 + 5 files changed, 18 insertions(+) create mode 100755 app-menu/qubes-run-gnome-console diff --git a/app-menu/Makefile b/app-menu/Makefile index 06bb9abcd..91680e2a8 100644 --- a/app-menu/Makefile +++ b/app-menu/Makefile @@ -12,6 +12,7 @@ install: install -d $(DESTDIR)$(BINDIR) install -t $(DESTDIR)$(BINDIR) \ qubes-desktop-run \ + qubes-run-gnome-console \ qubes-run-gnome-terminal \ qubes-run-terminal \ qubes-session-autostart diff --git a/app-menu/qubes-run-gnome-console b/app-menu/qubes-run-gnome-console new file mode 100755 index 000000000..3bf19424c --- /dev/null +++ b/app-menu/qubes-run-gnome-console @@ -0,0 +1,11 @@ +#!/bin/sh +# Wrapper around gnome-console that runs it with --wait option +# (if supoported). + +# Check if our gnome-console version supports --wait +# (we can't just run it and check exit code, because if it works, it will +# return the exit code of the child process) +case "$(kgx --help)" in + *--wait\ *) exec kgx --wait "$@" ;; + *) exec kgx "$@" ;; +esac diff --git a/app-menu/qubes-run-terminal b/app-menu/qubes-run-terminal index a7b5c44a2..d9defb79b 100755 --- a/app-menu/qubes-run-terminal +++ b/app-menu/qubes-run-terminal @@ -15,6 +15,10 @@ if is_command gnome-terminal; then exec qubes-run-gnome-terminal fi +if is_command kgx; then + exec qubes-run-gnome-console +fi + for terminal in xfce4-terminal konsole urxvt rxvt termit terminator Eterm aterm roxterm termite lxterminal mate-terminal terminology st xterm; do if is_command "$terminal" ; then exec "$terminal" diff --git a/debian/qubes-core-agent.install b/debian/qubes-core-agent.install index cc1aa97ea..ae713d5e5 100644 --- a/debian/qubes-core-agent.install +++ b/debian/qubes-core-agent.install @@ -120,6 +120,7 @@ usr/bin/qubes-desktop-run usr/bin/qubes-open usr/bin/qubes-session-autostart usr/bin/qubes-run-terminal +usr/bin/qubes-run-gnome-console usr/bin/qubes-run-gnome-terminal usr/bin/qubes-vmexec usr/bin/qvm-copy diff --git a/rpm_spec/core-agent.spec.in b/rpm_spec/core-agent.spec.in index b792e3d6a..cf7869874 100644 --- a/rpm_spec/core-agent.spec.in +++ b/rpm_spec/core-agent.spec.in @@ -896,6 +896,7 @@ rm -f %{name}-%{version} %_bindir/qvm-sync-clock %_bindir/qubes-desktop-run %_bindir/qubes-run-terminal +%_bindir/qubes-run-gnome-console %_bindir/qubes-run-gnome-terminal %_bindir/qubes-open %_bindir/qubes-session-autostart