summaryrefslogtreecommitdiff
path: root/home/wayland/pkgs/wayland-scripts/src/bin
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-07-16 13:57:09 +0530
committersinanmohd <sinan@sinanmohd.com>2024-07-16 14:03:12 +0530
commit3eb462c992e9612e3571b17269dda290f391cda6 (patch)
treefb45c60e7e047e86118ec6fd8ff7de22b8e46d73 /home/wayland/pkgs/wayland-scripts/src/bin
parent33b833758f44f94ee9c69ffc7b235cfb8a4d49a5 (diff)
home/wayland/ttyasrt: init
Diffstat (limited to 'home/wayland/pkgs/wayland-scripts/src/bin')
-rwxr-xr-xhome/wayland/pkgs/wayland-scripts/src/bin/ttyasrt23
1 files changed, 23 insertions, 0 deletions
diff --git a/home/wayland/pkgs/wayland-scripts/src/bin/ttyasrt b/home/wayland/pkgs/wayland-scripts/src/bin/ttyasrt
new file mode 100755
index 0000000..5148faf
--- /dev/null
+++ b/home/wayland/pkgs/wayland-scripts/src/bin/ttyasrt
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+die()
+{
+ printf "\033[31;1merr: %b\033[0m\n" "$1"
+ command -v notify-send > /dev/null &&
+ notify-send " ttyasrt" "$1"
+ exit "${2:-1}"
+}
+
+########
+# MAIN #
+########
+
+if [ -z "$TERMINAL" ]; then
+ die "\$TERMIANL must be set"
+fi
+
+if tty --silent; then
+ exec "$@"
+else
+ exec "$TERMINAL" -- "$@"
+fi