hook for day view
This commit is contained in:
parent
aaf3c56565
commit
08adcd2f98
12
src/main.sh
12
src/main.sh
@ -168,6 +168,12 @@ if [ -z "${WEEKLY_DATA_FILE:-}" ]; then
|
|||||||
export WEEKLY_DATA_FILE
|
export WEEKLY_DATA_FILE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${1:-}" = "--day" ]; then
|
||||||
|
DISPLAY_DAY="$2"
|
||||||
|
echo "Jumping to day $DISPLAY_DAY!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
DISPLAY_DATE="today"
|
DISPLAY_DATE="today"
|
||||||
if [ "${1:-}" = "--date" ]; then
|
if [ "${1:-}" = "--date" ]; then
|
||||||
DISPLAY_DATE="$2"
|
DISPLAY_DATE="$2"
|
||||||
@ -178,7 +184,6 @@ DISPLAY_DATE_PREV=$(date -d "$DISPLAY_DATE -1 week" +"%D")
|
|||||||
DISPLAY_DATE_NEXT=$(date -d "$DISPLAY_DATE +1 week" +"%D")
|
DISPLAY_DATE_NEXT=$(date -d "$DISPLAY_DATE +1 week" +"%D")
|
||||||
|
|
||||||
selection=$( (
|
selection=$( (
|
||||||
#cut -d '|' -f 3 "$APPROX_DATA_FILE"
|
|
||||||
cat "$APPROX_DATA_FILE"
|
cat "$APPROX_DATA_FILE"
|
||||||
yes " " | head -n 50
|
yes " " | head -n 50
|
||||||
__list
|
__list
|
||||||
@ -190,7 +195,8 @@ selection=$( (
|
|||||||
--ellipsis='' \
|
--ellipsis='' \
|
||||||
--delimiter='|' \
|
--delimiter='|' \
|
||||||
--with-nth='{4}' \
|
--with-nth='{4}' \
|
||||||
--accept-nth=1,2,3,5 \
|
--accept-nth=1,2 \
|
||||||
|
--no-info \
|
||||||
--ansi \
|
--ansi \
|
||||||
--no-clear \
|
--no-clear \
|
||||||
--bind="ctrl-p:become($0 --date '$DISPLAY_DATE_PREV')" \
|
--bind="ctrl-p:become($0 --date '$DISPLAY_DATE_PREV')" \
|
||||||
@ -204,8 +210,6 @@ fi
|
|||||||
|
|
||||||
sign=$(echo "$selection" | cut -d '|' -f 1)
|
sign=$(echo "$selection" | cut -d '|' -f 1)
|
||||||
startdate=$(echo "$selection" | cut -d '|' -f 2)
|
startdate=$(echo "$selection" | cut -d '|' -f 2)
|
||||||
endate=$(echo "$selection" | cut -d '|' -f 3)
|
|
||||||
files=$(echo "$selection" | cut -d '|' -f 4)
|
|
||||||
if [ "$sign" = "~" ]; then
|
if [ "$sign" = "~" ]; then
|
||||||
exec $0 --date "$startdate"
|
exec $0 --date "$startdate"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user