From a606fb5ce57099eb4a666b902165118957a6e354 Mon Sep 17 00:00:00 2001 From: eshanized Date: Tue, 7 Jan 2025 21:52:28 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20feat:=20add=20shell=20runner=20t?= =?UTF-8?q?o=20execute=20shell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/bin/shellrunner | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 usr/bin/shellrunner diff --git a/usr/bin/shellrunner b/usr/bin/shellrunner new file mode 100755 index 0000000..feececb --- /dev/null +++ b/usr/bin/shellrunner @@ -0,0 +1,32 @@ +#!/bin/bash + +# List of common terminal emulators +terminals=("gnome-terminal" "konsole" "xfce4-terminal" "lxterminal" "mate-terminal" "tilix" "alacritty" "urxvt" "xterm" "kitty" "terminator" "st" "cool-retro-term" "tilda" "guake") + +# Function to open a terminal +open_terminal() { + for term in "${terminals[@]}"; do + if command -v "$term" &> /dev/null; then + case "$term" in + "gnome-terminal"|"mate-terminal"|"tilix"|"terminator") + "$term" & + ;; + "konsole") + "$term" & + ;; + "xfce4-terminal"|"lxterminal"|"alacritty"|"urxvt"|"xterm"|"kitty"|"st"|"cool-retro-term"|"tilda"|"guake") + "$term" & + ;; + *) + echo "Unsupported terminal: $term" + ;; + esac + exit 0 + fi + done + echo "No supported terminal emulator found." + exit 1 +} + +# Execute the function +open_terminal