Skip to content

Commit

Permalink
🚀 feat: add shell runner to execute shell
Browse files Browse the repository at this point in the history
  • Loading branch information
eshanized committed Jan 7, 2025
1 parent 2ec13ab commit a606fb5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions usr/bin/shellrunner
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a606fb5

Please sign in to comment.