/usr/bin/dr_watch is in draai 20160601-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 35 36 37 38 | #! /bin/sh
# This file is maintained at http://git.mdcc.cx/draai
# % DR_SLEEP=5 dr_watch draai peek
# Unlike watch as shipped with Linux procps << 3.3.3,
# it will deal sane with non-ascii output (like UTF-8). (See also
# http://bugs.debian.org/240989.) ( From: Craig Small
# Fixed in procps 3.2.8-3 Date: Fri, 5 Feb 2010 21:46:09 +1100 )
set -e
sleep=${DR_SLEEP:-2}
sleepcmd=${DR_SLEEP_CMD:-"mpc idle"}
nicewatch=${DR_NICE_WATCH:-true}
if test -n "$DR_WATCH"
then
exec $DR_WATCH "$@"
elif $nicewatch
then
term_cup=$(tput cup 0 0 2>/dev/null || echo -n "[H")
term_el=$(tput el 2>/dev/null || echo -n "[K")
term_ed=$(tput ed 2>/dev/null || echo -n "[J")
while exec
do
echo "$term_cup$("$@")$term_ed"
$sleepcmd
done | sed "s/$/$term_el/"
elif command -v watch >/dev/null
then
exec watch --no-title --interval $sleep "$@"
else
echo >&2 "dr_watch: no suitable watch-program found. either set DR_RUN_WATCH=true, assign something suitable to DR_WATCH or install a program called watch in your PATH. giving up."
exit 1
fi
|