diff options
| author | spv <spv@spv.sh> | 2025-10-02 18:47:49 -0400 |
|---|---|---|
| committer | spv <spv@spv.sh> | 2025-10-02 18:47:49 -0400 |
| commit | 5eb78c5fc8ee50707f3c18ab60b57fd89f1d489e (patch) | |
| tree | ec0ce6b83b5a2a508ba6b4611fe70d4b4f9a468d /src/dock_checker.sh | |
mein klein dockd
Diffstat (limited to 'src/dock_checker.sh')
| -rwxr-xr-x | src/dock_checker.sh | 34 |
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 |
