-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdnks
More file actions
executable file
·34 lines (30 loc) · 801 Bytes
/
dnks
File metadata and controls
executable file
·34 lines (30 loc) · 801 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
32
33
34
#!/usr/bin/env bash
set -o nounset -o pipefail
cols=$(tput cols)
num_thingies=$(((cols + 1) / 6))
extra_space=$((cols - (num_thingies * 6 - 1)))
extra_space_left=$((extra_space / 2))
if ((num_thingies == 0)); then
exit
fi
printf '\n\n\n%*s * ' $((extra_space_left)) ''
for ((i = 1; i < num_thingies; ++i)); do
printf ' * '
done
printf '\n%*s * * ' $((extra_space_left)) ''
for ((i = 1; i < num_thingies; ++i)); do
printf ' * * '
done
printf '\n%*s* *' $((extra_space_left)) ''
for ((i = 1; i < num_thingies; ++i)); do
printf ' * *'
done
printf '\n%*s * * ' $((extra_space_left)) ''
for ((i = 1; i < num_thingies; ++i)); do
printf ' * * '
done
printf '\n%*s * ' $((extra_space_left)) ''
for ((i = 1; i < num_thingies; ++i)); do
printf ' * '
done
printf '\n\n\n\n'