aboutsummaryrefslogtreecommitdiff
path: root/insel-run
diff options
context:
space:
mode:
authorfrosty <gabriel@bwaaa.monster>2026-02-23 00:37:47 -0500
committerfrosty <gabriel@bwaaa.monster>2026-02-23 00:37:47 -0500
commit3add5ed8899a8f4a442c249913602de6b7d60732 (patch)
treee4f864b1f4d41aa258c8b678b00a7d9ed69640f7 /insel-run
downloadinsel-3add5ed8899a8f4a442c249913602de6b7d60732.tar.gz
billions must commit
Diffstat (limited to 'insel-run')
-rw-r--r--insel-run48
1 files changed, 48 insertions, 0 deletions
diff --git a/insel-run b/insel-run
new file mode 100644
index 0000000..b4c0b88
--- /dev/null
+++ b/insel-run
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+INSEL=$(command -v insel)
+if [ -z "$INSEL" ]; then
+ echo "Error: insel not found in PATH" >&2
+ exit 1
+fi
+
+if [ -t 1 ]; then
+ exec "$INSEL" "$@"
+fi
+
+run_in_term() {
+ term="$1"
+ shift
+ if ! command -v "$term" >/dev/null 2>&1; then
+ return 1
+ fi
+ export TERM
+ case "$term" in
+ kitty)
+ "$term" -- "$INSEL" "$@"
+ ;;
+ alacritty|wezterm|st)
+ "$term" -e "$INSEL" "$@"
+ ;;
+ *)
+ "$term" -e sh -c "exec $INSEL" "$@"
+ ;;
+ esac
+ [ $? -eq 0 ] && exit 0
+}
+
+run_in_term kitty "$@"
+run_in_term alacritty "$@"
+run_in_term wezterm "$@"
+run_in_term gnome-terminal "$@"
+run_in_term konsole "$@"
+run_in_term xfce4-terminal "$@"
+run_in_term lxterminal "$@"
+run_in_term mate-terminal "$@"
+run_in_term terminator "$@"
+run_in_term tilix "$@"
+run_in_term xterm "$@"
+run_in_term st "$@"
+
+echo "Error: No terminal emulator found" >&2
+exit 1