From 93496b65890b0dcc0b400f7ebdc695a65d3d83c7 Mon Sep 17 00:00:00 2001 From: Drew Daniels Date: Sat, 21 Oct 2023 12:26:10 -0500 Subject: [PATCH] make changes from feedback --- segments/gcalcli.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/segments/gcalcli.sh b/segments/gcalcli.sh index 83025c6d..8e4e5c02 100755 --- a/segments/gcalcli.sh +++ b/segments/gcalcli.sh @@ -1,18 +1,18 @@ # Print next Google Calendar Event -TMUX_POWERLINE_SEG_GCALCLI_MILITARY_TIME_DEFAULT=1 +TMUX_POWERLINE_SEG_GCALCLI_24HR_TIME_FORMAT_DEFAULT=1 generate_segmentrc() { read -d '' rccontents << EORC -gcalcli uses military time by default - if you want to see 12 hour time format, set TMUX_POWERLINE_SEG_GCALCLI_MILITARY_TIME_DEFAULT to 0 -export TMUX_POWERLINE_SEG_GCALCLI_MILITARY_TIME="${TMUX_POWERLINE_SEG_GCALCLI_MILITARY_TIME_DEFAULT}" +# gcalcli uses 24hr time format by default - if you want to see 12hr time format, set TMUX_POWERLINE_SEG_GCALCLI_MILITARY_TIME_DEFAULT to 0 +export TMUX_POWERLINE_SEG_GCALCLI_24HR_TIME_FORMAT="${TMUX_POWERLINE_SEG_GCALCLI_24HR_TIME_FORMAT_DEFAULT}" EORC echo "$rccontents" } __process_settings() { - if [ -z "$TMUX_POWERLINE_SEG_GCALCLI_MILITARY_TIME" ]; then - export TMUX_POWERLINE_SEG_GCALCLI_MILITARY_TIME="${TMUX_POWERLINE_SEG_GCALCLI_MILITARY_TIME_DEFAULT}" + if [ -z "$TMUX_POWERLINE_SEG_GCALCLI_24HR_TIME_FORMAT" ]; then + export TMUX_POWERLINE_SEG_GCALCLI_24HR_TIME_FORMAT="${TMUX_POWERLINE_SEG_GCALCLI_24HR_TIME_FORMAT_DEFAULT}" fi } @@ -24,7 +24,7 @@ run_segment() { fi __process_settings gcmd=(gcalcli agenda) - if [[ $TMUX_POWERLINE_SEG_GCALCLI_MILITARY_TIME == 0 ]]; then + if [[ $TMUX_POWERLINE_SEG_GCALCLI_24HR_TIME_FORMAT == 0 ]]; then gcmd+=(--no-military) fi "${gcmd[@]}" | head -2 | tail -1 | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' | sed -E 's/ +/ /g'