From f5745aa4d999b4936c3a8449d77d51e9cdf9bd97 Mon Sep 17 00:00:00 2001 From: yage Date: Fri, 5 Nov 2021 23:42:38 -0600 Subject: [PATCH] background application monitor for tmux --- bin/tmux/bg-apps/apps | 11 +++++++++++ bin/tmux/bg-apps/midi | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100755 bin/tmux/bg-apps/apps create mode 100755 bin/tmux/bg-apps/midi diff --git a/bin/tmux/bg-apps/apps b/bin/tmux/bg-apps/apps new file mode 100755 index 0000000..af4bfee --- /dev/null +++ b/bin/tmux/bg-apps/apps @@ -0,0 +1,11 @@ +#!/usr/bin/zsh + +tmux new -d -s apps -n 'foreman' 'htop' \; \ + split-window -d -t apps:foreman "while true; do clear; ${0:a:h}/apps; echo 'Keeping apps fresh...'; sleep 30; done" \ + 2>/dev/null + +for APP in $(ls ${0:a:h} | grep -v 'apps') +do + tmux list-windows -t apps: | awk '{print $2;}' | grep -q $APP \ + || tmux new-window -dn $APP -t apps: "${0:a:h}/$APP" +done diff --git a/bin/tmux/bg-apps/midi b/bin/tmux/bg-apps/midi new file mode 100755 index 0000000..3f3c137 --- /dev/null +++ b/bin/tmux/bg-apps/midi @@ -0,0 +1,8 @@ +#!/usr/bin/zsh + +cd $HOME/Projects/gizmos/xorg-midi/code +source ../env/bin/activate + +./midi-controller + +deactivate