aboutsummaryrefslogtreecommitdiff
path: root/src/dock_checker.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/dock_checker.sh')
-rwxr-xr-xsrc/dock_checker.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/dock_checker.sh b/src/dock_checker.sh
new file mode 100755
index 0000000..5b4f1f8
--- /dev/null
+++ b/src/dock_checker.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env zsh
+
+SCRIPT_DIR=$(dirname $(realpath $0))
+cd $SCRIPT_DIR
+
+rm .{un,}docked
+
+while true; do
+ if [ "$(./check_docked.sh)" = "docked" ]; then
+ if [ -e .docked ]; then
+ continue
+ fi
+
+ echo docking...
+
+ rm -f .undocked
+ sh/docked.sh
+
+ touch .docked
+ else
+ if [ -e .undocked ]; then
+ continue
+ fi
+
+ echo undocking...
+
+ rm -f .docked
+ sh/undocked.sh
+
+ touch .undocked
+ fi
+
+ sleep 5
+done