]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Add lab-sensible-terminal
authorJohan Malm <jgm323@gmail.com>
Mon, 30 Jun 2025 18:59:46 +0000 (19:59 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 1 Jul 2025 21:27:33 +0000 (22:27 +0100)
Related-to: #2843 #2842
clients/lab-sensible-terminal [new file with mode: 0755]
meson.build

diff --git a/clients/lab-sensible-terminal b/clients/lab-sensible-terminal
new file mode 100755 (executable)
index 0000000..49d5ad4
--- /dev/null
@@ -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
index c20eb6e7aabce3723e18c2b96a27f249c3500d3c..c46307ab5d2d07eaae0571d5810237157c69f9ee 100644 (file)
@@ -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)