mirror of
https://codeberg.org/andyscott/dotfiles.git
synced 2024-12-22 01:43:10 -05:00
25 lines
654 B
Bash
25 lines
654 B
Bash
#!/bin/sh
|
|
|
|
user=$(id -u)
|
|
time=$(date +"%b %d, %Y %T")
|
|
bar1_log=$XDG_STATE_HOME/yambar1.log
|
|
{{- if eq .chezmoi.hostname "hydrus" }}
|
|
bar2_log=$XDG_STATE_HOME/yambar2.log
|
|
{{- end }}
|
|
|
|
echo "--- $time ---" > "$bar1_log"
|
|
{{- if eq .chezmoi.hostname "hydrus" }}
|
|
echo "--- $time ---" > "$bar2_log"
|
|
{{- end }}
|
|
|
|
# Terminate already running bar instances
|
|
killall -q yambar
|
|
|
|
# Wait until the processes have been shut down
|
|
while pgrep -u "$user" -x yambar >/dev/null; do sleep 1; done
|
|
|
|
# Launch Yambar
|
|
yambar -s 2>&1 | tee -a "$bar1_log" &
|
|
{{- if eq .chezmoi.hostname "hydrus" }}
|
|
yambar -s -c "$XDG_CONFIG_HOME/yambar/bar2.yml" 2>&1 | tee -a "$bar2_log" &
|
|
{{- end }}
|