#!/bin/zsh TRM_COLS="225" TRM_LINES="55" SESSION="Goals" CURRENT_MONTH=$(date +%m) case $CURRENT_MONTH in 01|04|07|10) CAL_ARGS="-n 3" ;; *) CAL_ARGS="-3" ;; esac CAL="cal -c 3 $CAL_ARGS" if [[ "$1" == "-a" ]]; then TAGOALS="fypm ta-ls-date ALARM alarms -- -w" else TAGOALS="fypm ta-ls-date GOAL goals -- -m" fi PROJS="task projects" open_session() { if ! tmux has-session -t "$SESSION"; then tmux new-session -d -s "$SESSION" -x "$TRM_COLS" -y "$TRM_LINES" tmux split-window -t "$SESSION" -h -l 10% tmux split-window -t "$SESSION":0.0 -v -l 20% tmux split-window -t "$SESSION":0.1 -h -l 33% tmux split-window -t "$SESSION":0.0 -h -l 50% tmux send-keys -t "$SESSION":0.1 "perpetue_cmd $TAGOALS" C-m tmux send-keys -t "$SESSION":0.3 "perpetue_cmd $CAL" C-m tmux send-keys -t "$SESSION":0.4 "perpetue_cmd $PROJS" C-m tmux select-pane -t "$SESSION":0.2 tmux attach-session -t "$SESSION" fi } open_session