From 9ff8e472cc8b1973e1ebd98e3d6c39d1e69015b3 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Fri, 14 Jul 2023 19:01:30 -0400 Subject: [PATCH] Added yambar-launcher --- dot_local/bin/executable_yambar-launcher.tmpl | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 dot_local/bin/executable_yambar-launcher.tmpl diff --git a/dot_local/bin/executable_yambar-launcher.tmpl b/dot_local/bin/executable_yambar-launcher.tmpl new file mode 100644 index 0000000..83e277d --- /dev/null +++ b/dot_local/bin/executable_yambar-launcher.tmpl @@ -0,0 +1,21 @@ +#!/bin/bash + +START_TIME=`date +"%b %d, %Y %T"` +LOG_FILE_BAR1="${XDG_STATE_HOME}"/yambar1.log +echo "--- ${START_TIME} ---" > "$LOG_FILE_BAR1" +{{- if eq .chezmoi.hostname "hydrus" }} +LOG_FILE_BAR2="${XDG_STATE_HOME}"/yambar2.log +echo "--- ${START_TIME} ---" > "$LOG_FILE_BAR2" +{{- end }} + +# Terminate already running bar instances +killall -q yambar + +# Wait until the processes have been shut down +while pgrep -u $UID -x yambar >/dev/null; do sleep 1; done + +# Launch Yambar +yambar -s 2>&1 | tee -a "$LOG_FILE_BAR1" & disown +{{- if eq .chezmoi.hostname "hydrus" }} +yambar -s -c "${XDG_CONFIG_HOME}/yambar/bar2.yml" 2>&1 | tee -a "$LOG_FILE_BAR2" & disown +{{- end }}