blob: 0631513d1de4be016096b01c6b851060f8d694cf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 &
|