-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop
More file actions
executable file
·33 lines (29 loc) · 716 Bytes
/
loop
File metadata and controls
executable file
·33 lines (29 loc) · 716 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
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
line() {
local color=$1; shift
local reset="\e[0m"
local width=$(tput cols)
printf "$(printf "%$((width-1))s\r")" # handle missing newline
printf "$color%*s$reset" "$width" | sed 's/ /━/g'
}
main() {
local green="\e[1;92m"
local red="\e[1;91m"
local gray="\e[38;5;238m"
while true; do
echo "$(line "$gray")"
if "$@"; then
echo "$(line "$green")"
else
echo "$(line "$red")"
fi
fd \
--hidden \
--exclude .git \
--exec-batch inotifywait --quiet --quiet --event modify,delete,move_self,delete_self
done
}
main "$@"