From efc3984df30d353827db8aebd6ff8208c77515b9 Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Fri, 7 Jun 2024 15:27:44 +0200 Subject: [PATCH] feat: allow terminal and file manager choice The gnome-terminal can't start as root, related to dbus. --- salt/dom0/files/bin/qvm-terminal | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/salt/dom0/files/bin/qvm-terminal b/salt/dom0/files/bin/qvm-terminal index 7c49352..21ead77 100755 --- a/salt/dom0/files/bin/qvm-terminal +++ b/salt/dom0/files/bin/qvm-terminal @@ -1,6 +1,6 @@ #!/bin/sh -# SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. +# SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. # # SPDX-License-Identifier: AGPL-3.0-or-later @@ -9,17 +9,20 @@ set -eu me="${0##*/}" usage(){ - printf '%s\n' "Usage: ${me} [QVM-RUN_OPTIONS] QUBE + printf '%s\n' "Usage: ${me} [QVM-RUN_OPTIONS] Examples: - ${me} --dispvm=DVM_TEMPLATE - ${me} -u root QUBE - ${me} QUBE" >&2 + ${me} --dispvm= + ${me} -u root + ${me} +The application to open can be specified with environment variables: + QVM_TERMINAL=xterm ${me} -u root + QVM_FILE_MANAGER=thunar ${me} -u root " >&2 exit "${1-"1"}" } case "${me}" in - *-terminal) service=qubes-run-terminal ;; - *-file-manager) service=qubes-open-file-manager ;; + *-terminal) service="${QVM_TERMINAL:-"qubes-run-terminal"}";; + *-file-manager) service="${QVM_FILE_MANAGER:-"qubes-open-file-manager"}";; *) printf '%s\n' "Invalid script name: ${me}" exit 1 ;; esac