Skip to content

Custom scripts and extensions

ANtlord edited this page Jun 22, 2026 · 1 revision

A collection of scripts and extensions of Khal

To add a script:

  • check it runs on bash and zsh
  • add it under an appropriate category in the ToC

Table of Contents

Logging work

The following allows you quickly to add an entry to the calendar about the past activity

selected_calendar=$(khal printcalendars| tac | fzf -1 --prompt 'Calendar > ')
echo "$selected_calendar"
if test -z "$selected_calendar"; then
    exit 1
fi

frequent_summaries="<put your the most frequent activities here>"
# frequent_summaries="Arbeit
# Work
# Trabajo
# Работа
# Praca
# მუშაობა"

selected_summary=$(echo "$frequent_summaries" | fzf -1 --prompt 'Summary > ')

if test -z "$selected_summary"; then
    read -ep "Input summary: " selected_summary
fi
if test -z "$selected_summary"; then
    exit 2
fi
echo "$selected_summary"

khal list $(date -d yesterday +%Y-%m-%d)

read -ep "Input the time of the start (): " start
if test -z "$start"; then
    exit 4
fi

default_end=$(date +%H:%M)
read -ep "Input the time of the end or the duration ($default_end): " end
if test -z "$end"; then
    end="$default_end"
fi

khal new -a "$selected_calendar" "$start" "$end" $selected_summary

Clone this wiki locally