Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

gcalcli script (goocle calendar)

Off-Topic discussions about science, technology, and non Debian specific topics.
Post Reply
Message
Author
User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

gcalcli script (goocle calendar)

#1 Post by bester69 »

Hi Pig, :o

Pig, I made this script to create events with everyday reminders.. It works pretty nice.

The script alerts you in advance around 20 days before event by sending you a mail alert and also a coventional alert .. first days it only alert you each two days, and last seven days It alerts you everyday at 11am.,, If alert is very near It truncates to create only reiterative alerts since the day you set the alert on..
The script set description to title if its empty and set add a code number to end title for deleting the loop of alerts for that coded event.

this way, you can delete easily all alerts associaded to event by using the code number description event:
gcalcli delete <<NumberCodedEvent>>

You can give it a try, Im using it to set reminders :o

reminder.sh

Code: Select all

#!/bin/bash
#
calen="--calendar=mymail@gmail.com"

read -p "Title: " title
if [ -z  "$title" ]
then
echo "título no puede ser null"
    exit
fi

read -p "Descripción: " description
if [ -z  "$description" ]
then
    description="$title"
fi

read -p "When: " choice
if [ -z  "$choice" ]
then
echo "fecha de entrada vacia"
    exit
fi
NEXT_DATE=$(date +%Y/%m/%d -d "$choice")
#############Codigo bara borrarlas
##>>>>>>>>> gcalcli delete $coddaydel
coddaydel=$(date +%j -d "$choice")
############
title="$title ($coddaydel)"
#description="($coddaydel) $description" 
if [  -z  "$NEXT_DATE" ]
then
echo "fecha de entrada incorrecta"
    exit
fi
#NEXT_DATE=$(date +%d/%m/%Y -d "$NEXT_DATE")


for i in {15..0}
do
NUMERO=$i
let RESTO=NUMERO%2
if [ $RESTO -eq 0 ]; then
echo “El número $NUMERO es par”
else
echo “El número $NUMERO es impar”
if [ $i -gt 6 ]; then
        continue 
        
  fi
fi

when=$(date +%Y-%m-%d -d "$NEXT_DATE -$i day")
   
fechahoy=$(date "+%s")
unix_cond=$(date -d "${when}" "+%s")
if [ ${fechahoy} -ge ${unix_cond} ]; then
   echo "over condition"
   continue
fi

   echo "es $when" 
 
 gcalcli $calen add --reminder "10m"  --reminder "12m email" --description="$description" \
--when="$when at 11am" \
--title="$title" --where="" --duration="600"
done

gcalcli  calm

And here the final resulting of setting an alert on 25 Nov.:
Image
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: gcalcli script (goocle calendar)

#2 Post by sickpig »

Good on you and I am glad it meets your use case. For me a simple one liner to add an event does the job. I used to use google keep to set reminders to notes but now gcalcli has completely replaced that.

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: gcalcli script (goocle calendar)

#3 Post by bester69 »

sickpig wrote:Good on you and I am glad it meets your use case. For me a simple one liner to add an event does the job. I used to use google keep to set reminders to notes but now gcalcli has completely replaced that.
I used INBOX, but they shutted down.. then Google OK (Android).. and gcalcli cant set reminders, these ones are events with notifiers...

Ive three tools for reminders..:
Google OK (Android), Kalarm and To Do Reminder (android)... I usually use kalarm, but when is something important I use all or two of tree just in case I get mislead

If you dont know you should try Kalarm, its wondefull this app.
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: gcalcli script (goocle calendar)

#4 Post by sickpig »

bester69 wrote:If you dont know you should try Kalarm, its wondefull this app.
Thanks but won't it pull 2 tonnes of KDE dependencies? Also, I try to avoid resource hungry gui apps as far as possible except browsers.
I use systemd transient timers for reminders. Provides all the functionalities minus the bloat.

Post Reply