Files
illogical-impulse/early/.config/eww/scripts/scrollmonth
T
2024-02-22 15:35:06 +07:00

21 lines
528 B
Bash
Executable File

#!/usr/bin/env bash
# Get month diff
diffmonth=$(eww get monthshift)
if [[ "$1" == "up" ]]; then
diffmonth=$(( $diffmonth - 1 ))
else
diffmonth=$(( $diffmonth + 1 ))
fi
eww update monthshift="$diffmonth" &
# Get dates
dates=$(scripts/getfirstdayofmonth "$diffmonth")
dateSplitted=( $dates )
newTitle=$(date -d "${dateSplitted[3]}-${dateSplitted[2]}-${dateSplitted[1]}" "+%B %Y")
if [[ "$diffmonth" == "0" ]]; then
dates=''
fi
eww update calendartitle="$newTitle" &
eww update calendar="$(scripts/calendarlayout $dates)"