aboutsummaryrefslogtreecommitdiff
path: root/.local/share
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-05-21 18:16:49 +0200
committerlonkaars <loek@pipeframe.xyz>2024-05-21 18:16:49 +0200
commite60c9ecf5bd8485704063cbec57cbbd47aedd79a (patch)
treed6399eb9649f09764145ffc2cd1504943548d15e /.local/share
parent6de02af61d34786b3653c00f8309e27876667b78 (diff)
add screenwatch script
Diffstat (limited to '.local/share')
-rwxr-xr-x.local/share/bin/screenwatch11
1 files changed, 11 insertions, 0 deletions
diff --git a/.local/share/bin/screenwatch b/.local/share/bin/screenwatch
new file mode 100755
index 0000000..d556fac
--- /dev/null
+++ b/.local/share/bin/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
+