From 6b3e2bbd678b27d40c603e709a80b1760ffca139 Mon Sep 17 00:00:00 2001 From: blueingreen68 Date: Fri, 12 Jan 2024 18:34:25 +0500 Subject: update pkglist.txt --- foote.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 foote.sh (limited to 'foote.sh') diff --git a/foote.sh b/foote.sh new file mode 100755 index 0000000..0631513 --- /dev/null +++ b/foote.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Set foot's title to the command supplied after -e. +# Note: Option -e is mandatory for this wrapper script. +# Скрипт для запуска cli программ с именованным заголовком напрямую из терминала + +unset title +arg_i=0 +for arg; do + arg_i=$((arg_i+1)) + if [[ "$arg" != "-e" ]]; then + continue + else + arg_i=$((arg_i+1)) + title="${*:$arg_i}" + break + fi +done + +if ! [[ -v title ]]; then + printf 'error: option -e is mandatory\n' + exit 1 +fi + +set -e + +exec foot --title="$title" "$@" 2> /dev/null & -- cgit