-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfaff
More file actions
executable file
·31 lines (26 loc) · 709 Bytes
/
faff
File metadata and controls
executable file
·31 lines (26 loc) · 709 Bytes
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
27
28
29
30
31
#!/bin/bash
# Sleeps for the given number of seconds, showing a progress bar.
if echo "$*" | grep -Eq -- '--help\b|-h\b' || [[ -z $1 ]]; then
echo "usage: ${0##*/} SECONDS [-h|--help]" 1>&2
echo "Sleeps for the given number of seconds, showing a progress bar." 1>&2
exit 1
fi
set -ue
max="$1"
width="$(tput cols)"
start=$(vramsteg --now)
while :; do
now=$(vramsteg --now)
current=$((now - start))
vramsteg --start="$start" \
--estimate \
--label sleeping \
--style mono \
--width "$width" \
--min 0 \
--max "$max" \
--current "$current"
sleep 1
[[ $current -ge $1 ]] && break
done
vramsteg --remove --width "$width"