diff options
Diffstat (limited to 'home/dot_local/share/bin/executable_screenwatch')
| -rw-r--r-- | home/dot_local/share/bin/executable_screenwatch | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/home/dot_local/share/bin/executable_screenwatch b/home/dot_local/share/bin/executable_screenwatch new file mode 100644 index 0000000..d556fac --- /dev/null +++ b/home/dot_local/share/bin/executable_screenwatch @@ -0,0 +1,11 @@ +#!/bin/sh +# repeatedly open terminal at $dev, even when $dev temporarily dissapears +dev="$1" +while inotifywait -qq -e create --include "$dev" "$(dirname "$dev")"; do + sleep 0.1 # wait until device is initialized + screen "$@" + + # break out of loop if device still exists when screen exits (manual screen exit) + [ -e "$dev" ] && break +done + |