From e94781ef3fa75acc4bd594ef4c751039ea782a72 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Mon, 30 Jun 2025 19:59:46 +0100 Subject: [PATCH] Add lab-sensible-terminal Related-to: #2843 #2842 --- clients/lab-sensible-terminal | 57 +++++++++++++++++++++++++++++++++++ meson.build | 4 +++ 2 files changed, 61 insertions(+) create mode 100755 clients/lab-sensible-terminal diff --git a/clients/lab-sensible-terminal b/clients/lab-sensible-terminal new file mode 100755 index 00000000..49d5ad42 --- /dev/null +++ b/clients/lab-sensible-terminal @@ -0,0 +1,57 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-only + +# X11 terminals are at the back of the list in case the script is run +# without XWayland support +terminals="\ + x-terminal-emulator \ + alacritty \ + foot \ + kitty \ + xfce4-terminal \ + lxterminal \ + qterminal \ + mate-terminal \ + gnome-terminal \ + konsole \ + sakura \ + terminator \ + terminology \ + tilix \ + color-xterm \ + termit \ + aterm \ + roxterm \ + termite \ + lilyterm \ + terminix \ + guake \ + tilda \ + hyper \ + wezterm \ + rio \ + kgx \ + xterm \ + uxterm \ + dtterm \ + st \ + nxterm \ + Eterm \ + rxvt \ + urxvt" + +if [ -n "${TERMINAL}" ]; then + # ${TERMINAL} is not quoted here, so things like + # TERMINAL="foot -T my-terminal" work as expected. + exec ${TERMINAL} "$@" +fi + +for terminal in $terminals +do + if command -v "${terminal}" >/dev/null 2>&1 + then + exec "$terminal" "$@" + fi +done + +exit 1 diff --git a/meson.build b/meson.build index c20eb6e7..c46307ab 100644 --- a/meson.build +++ b/meson.build @@ -198,6 +198,10 @@ install_data('data/labwc.desktop', install_dir: get_option('datadir') / 'wayland install_data('data/labwc-portals.conf', install_dir: get_option('datadir') / 'xdg-desktop-portal') +# TODO: move this to clients/meson.build after the labnag PR +clients = files('clients/lab-sensible-terminal') +install_data(clients, install_dir: get_option('bindir')) + icons = ['labwc-symbolic.svg', 'labwc.svg'] foreach icon : icons icon_path = join_paths('data', icon)