dotfiles/dot_local/bin/executable_yambar-launcher.tmpl

26 lines
654 B
Cheetah
Raw Permalink Normal View History

2024-02-19 20:49:12 -05:00
#!/bin/sh
2023-07-14 19:01:30 -04:00
2024-02-19 20:49:12 -05:00
user=$(id -u)
time=$(date +"%b %d, %Y %T")
bar1_log=$XDG_STATE_HOME/yambar1.log
2023-07-14 19:01:30 -04:00
{{- if eq .chezmoi.hostname "hydrus" }}
2024-02-19 20:49:12 -05:00
bar2_log=$XDG_STATE_HOME/yambar2.log
{{- end }}
echo "--- $time ---" > "$bar1_log"
{{- if eq .chezmoi.hostname "hydrus" }}
echo "--- $time ---" > "$bar2_log"
2023-07-14 19:01:30 -04:00
{{- end }}
# Terminate already running bar instances
killall -q yambar
# Wait until the processes have been shut down
2024-02-19 20:49:12 -05:00
while pgrep -u "$user" -x yambar >/dev/null; do sleep 1; done
2023-07-14 19:01:30 -04:00
# Launch Yambar
2024-02-19 20:49:12 -05:00
yambar -s 2>&1 | tee -a "$bar1_log" &
2023-07-14 19:01:30 -04:00
{{- if eq .chezmoi.hostname "hydrus" }}
2024-02-19 20:49:12 -05:00
yambar -s -c "$XDG_CONFIG_HOME/yambar/bar2.yml" 2>&1 | tee -a "$bar2_log" &
2023-07-14 19:01:30 -04:00
{{- end }}