diary

Text-based journaling program
git clone https://git.in0rdr.ch/diary.git
Log | Files | Refs | Pull requests |Archive | README | LICENSE

diary.1.html (24486B)


      1 <!DOCTYPE html>
      2 <html>
      3 <!-- This is an automatically generated file.  Do not edit.
      4    Generated by scdoc 1.11.3
      5    Complete documentation for this program is not available as a GNU info page
      6  -->
      7 <head>
      8   <meta charset="utf-8"/>
      9   <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
     10   <link rel="stylesheet" href="style.css" type="text/css" media="all"/>
     11   <title>DIARY(1)</title>
     12 </head>
     13 <body>
     14 <table class="head">
     15   <tr>
     16     <td class="head-ltitle">DIARY(1)</td>
     17     <td class="head-vol">General Commands Manual</td>
     18     <td class="head-rtitle">DIARY(1)</td>
     19   </tr>
     20 </table>
     21 <div class="manual-text">
     22 <section class="Sh">
     23 <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
     24 <p class="Pp">diary - text-based journaling program</p>
     25 </section>
     26 <section class="Sh">
     27 <h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
     28 <p class="Pp"><b>diary</b> [OPTION]... [DIARY_DIR]...</p>
     29 </section>
     30 <section class="Sh">
     31 <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
     32 <p class="Pp">Open the <b>diary</b> journal for entries stored in
     33     <b>DIARY_DIR</b>.</p>
     34 <p class="Pp"><b>DIARY_DIR</b> is required, if not set as environment variable
     35     or defined in the <b>CONFIGURATION FILE</b>.</p>
     36 </section>
     37 <section class="Sh">
     38 <h1 class="Sh" id="OPTIONS"><a class="permalink" href="#OPTIONS">OPTIONS</a></h1>
     39 <p class="Pp"><b>-v, --version</b></p>
     40 <p class="Pp"></p>
     41 <div class="Bd-indent">Print diary version</div>
     42 <p class="Pp"><b>-h, --help</b></p>
     43 <p class="Pp"></p>
     44 <div class="Bd-indent">Show diary help text</div>
     45 <p class="Pp"><b>-d, --dir</b>=DIARY_DIR</p>
     46 <p class="Pp"></p>
     47 <div class="Bd-indent">Directory with the journal text files</div>
     48 <p class="Pp"><b>-e, --editor</b>=EDITOR</p>
     49 <p class="Pp"></p>
     50 <div class="Bd-indent">Text editor used for opening the journal files</div>
     51 <p class="Pp"><b>-f, --fmt</b>=FMT</p>
     52 <p class="Pp"></p>
     53 <div class="Bd-indent">FMT is a custom date and file format. Change with care,
     54   because the diary reads and writes to files with file name FMT. The new FMT is
     55   only applied to newly saved entries. Existing entries with the old FMT are not
     56   automatically migrated to the new FMT and do not show up with a new FMT
     57   specifier.	Consequently, a change in FMT shows an empty diary at first. Rename
     58   all files in the <b>DIARY_DIR</b> to migrate to a new FMT.</div>
     59 <p class="Pp"><b>-F, --fmt-cmd</b>=FMT_CMD</p>
     60 <p class="Pp"></p>
     61 <div class="Bd-indent">Journal entries are formatted with this command. If not
     62   set (default), the characters are printed to the preview screen character by
     63   character (without word wrap). For example, to enable word wrap after 75
     64   characters, use &quot;fmt -s&quot; as FMT_CMD. To format markdown, use
     65   &quot;mdcat -c&quot; or similar, see <b>CUSTOM FORMATTING</b>.</div>
     66 <p class="Pp"><b>-p, --no-pty</b></p>
     67 <p class="Pp"></p>
     68 <div class="Bd-indent">No pseudo terminal (pty) for entry preview. Only
     69   effective in combination with <b>--fmt-cmd</b>. If set, the output of
     70   <b>--fmt-cmd</b> is displayed with Ncurses. If not set (default), the result
     71   of <b>--fmt-cmd</b> (journal entry preview) is printed on a pseudo-terminal
     72   (pty) and not processed with Ncurses. The pty supports the ANSI escape
     73   sequences (e.g. colors, font types, etc.) of the native terminal.</div>
     74 <p class="Pp"><b>-m, --no-mouse</b></p>
     75 <p class="Pp"></p>
     76 <div class="Bd-indent">Disable mouse, don't listen for mouse events. Mouse
     77   events are enabled by default. Without <b>--no-mouse</b> flag (default),
     78   native text selection and right-click in the preview window requires holding
     79   down the SHIFT key, see <b>MOUSE EVENTS</b>.</div>
     80 <p class="Pp"><b>-r, --range</b>=RANGE</p>
     81 <p class="Pp"></p>
     82 <div class="Bd-indent">The number of years to show before/after today. Defaults
     83   to 1 year.</div>
     84 <p class="Pp"><b>-w, --weekday</b>=DAY</p>
     85 <p class="Pp"></p>
     86 <div class="Bd-indent">First day of the week. DAY is an integer in range (0..6),
     87   interpreted as 0 or 7 = Sun, 1 = Mon, ..., 6 = Sat. If glibc is installed, the
     88   first day of the week is derived from the current locale setting ($LANG, see
     89   man locale). Without glibc, the first weekday defaults to 1 (Monday), unless
     90   specified otherwise with this option.</div>
     91 </section>
     92 <section class="Sh">
     93 <h1 class="Sh" id="NAVIGATION"><a class="permalink" href="#NAVIGATION">NAVIGATION</a></h1>
     94 <p class="Pp">Navigation is done using the following vim-inspired keyboard
     95     shortcuts:</p>
     96 <p class="Pp"></p>
     97 <table class="tbl" border="1" style="border-style: solid;">
     98   <tr>
     99     <td><b>Key(s)</b></td>
    100     <td>Action</td>
    101   </tr>
    102   <tr>
    103     <td><b>e, Enter</b></td>
    104     <td>edit current entry</td>
    105   </tr>
    106   <tr>
    107     <td><b>d, x</b></td>
    108     <td>delete current entry</td>
    109   </tr>
    110   <tr>
    111     <td><b>t</b></td>
    112     <td>jump to today</td>
    113   </tr>
    114   <tr>
    115     <td><b>f</b></td>
    116     <td>jump to or find specific day</td>
    117   </tr>
    118   <tr>
    119     <td><b>j, down</b></td>
    120     <td>go forward by 1 week</td>
    121   </tr>
    122   <tr>
    123     <td><b>k, up</b></td>
    124     <td>go backward by 1 week</td>
    125   </tr>
    126   <tr>
    127     <td><b>h, left</b></td>
    128     <td>go left by 1 day</td>
    129   </tr>
    130   <tr>
    131     <td><b>l, right</b></td>
    132     <td>go right by 1 day</td>
    133   </tr>
    134   <tr>
    135     <td><b>J</b></td>
    136     <td>go forward by 1 month</td>
    137   </tr>
    138   <tr>
    139     <td><b>K</b></td>
    140     <td>go backward by 1 month</td>
    141   </tr>
    142   <tr>
    143     <td><b>N</b></td>
    144     <td>go to the previous journal entry</td>
    145   </tr>
    146   <tr>
    147     <td><b>n</b></td>
    148     <td>go to the next journal entry</td>
    149   </tr>
    150   <tr>
    151     <td><b>g</b></td>
    152     <td>go to start of journal</td>
    153   </tr>
    154   <tr>
    155     <td><b>G</b></td>
    156     <td>go to end of journal</td>
    157   </tr>
    158   <tr>
    159     <td><b>s, S</b></td>
    160     <td>sync selected day/Month with CalDAV server</td>
    161   </tr>
    162   <tr>
    163     <td><b>i</b></td>
    164     <td>import entries from .ics file</td>
    165   </tr>
    166   <tr>
    167     <td><b>E</b></td>
    168     <td>export entries to .ics file</td>
    169   </tr>
    170   <tr>
    171     <td><b>q</b></td>
    172     <td>quit the program</td>
    173   </tr>
    174 </table>
    175 <p class="Pp"></p>
    176 </section>
    177 <section class="Sh">
    178 <h1 class="Sh" id="ENVIRONMENT"><a class="permalink" href="#ENVIRONMENT">ENVIRONMENT</a></h1>
    179 <p class="Pp"><b>DIARY_DIR</b></p>
    180 <div class="Bd-indent">If this variable is set to a directory that can be
    181   opened, diary will use it to store diary files. Diary files are simple text
    182   files named after their date, formatted according to <b>FMT</b> (see
    183   <b>--fmt</b> option). The format defaults to &quot;%Y-%m-%d&quot;, which is
    184   &quot;YYYY-MM-DD&quot; (see man strftime). All other files different from FMT
    185   are ignored.</div>
    186 <p class="Pp"><b>EDITOR</b></p>
    187 <div class="Bd-indent">The program used to edit journal entries inside
    188   <b>DIARY_DIR</b>.</div>
    189 <p class="Pp"><b>LANG</b></p>
    190 <div class="Bd-indent">The default locale used to display the first day of the
    191   week, see <b>--weekday</b> option.</div>
    192 </section>
    193 <section class="Sh">
    194 <h1 class="Sh" id="ARGUMENTS"><a class="permalink" href="#ARGUMENTS">ARGUMENTS</a></h1>
    195 <p class="Pp">If the argument <b>DIARY_DIR</b> is given, diary files are read
    196     from and stored to that directory, ignoring the $DIARY_DIR environment
    197     variable, any <b>--dir</b> option or the <b>dir</b> value set in the
    198     <b>CONFIGURATION FILE</b>.</p>
    199 </section>
    200 <section class="Sh">
    201 <h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
    202 <p class="Pp">${PREFIX:-/usr/local/bin}/<b>diary</b></p>
    203 <div class="Bd-indent">The diary binary</div>
    204 <p class="Pp">${XDG_CONFIG_HOME:-~/.config}/diary/<b>diary.cfg</b></p>
    205 <div class="Bd-indent">An optional diary <b>CONFIGURATION FILE</b></div>
    206 </section>
    207 <section class="Sh">
    208 <h1 class="Sh" id="CONFIGURATION_FILE"><a class="permalink" href="#CONFIGURATION_FILE">CONFIGURATION
    209   FILE</a></h1>
    210 <p class="Pp">The <b>diary.cfg</b> configuration file can optionally be used to
    211     persist diary configuration. Use the &quot;#&quot; or &quot;;&quot;
    212     characters to comment lines.</p>
    213 <p class="Pp">Create default configuration location:</p>
    214 <p class="Pp"></p>
    215 <div class="Bd-indent">
    216 <pre>mkdir -p ${XDG_CONFIG_HOME:-~/.config}/diary</pre>
    217 </div>
    218 <p class="Pp">Install an example configuration file with defaults:</p>
    219 <p class="Pp"></p>
    220 <div class="Bd-indent">
    221 <pre>tee ${XDG_CONFIG_HOME:-~/.config}/diary/diary.cfg &lt;&lt;EOF
    222 # https://code.in0rdr.ch/diary/file/config/diary.cfg.html
    223 # Path that holds the journal text files
    224 #dir = ~/diary
    225 # Number of years to show before/after todays date
    226 range = 1
    227 # 0 = Sunday, 1 = Monday, ..., 6 = Saturday
    228 weekday = 1
    229 # Date and file format, change with care
    230 fmt = %Y-%m-%d
    231 # Text format command for entry preview
    232 fmt_cmd =
    233 # Use pseudo terminal (pty) to view result of fmt_cmd
    234 #no_pty = false
    235 # Listen for mouse events
    236 #no_mouse = false
    237 # Editor to open journal files with
    238 editor =
    239 # CalDAV server URI
    240 #caldav_server =
    241 # Calendar name for CalDAV sync
    242 #caldav_calendar =
    243 # CalDAV server username
    244 #caldav_username =
    245 # CalDAV server password
    246 #caldav_password =
    247 # OAuth command to fetch access token. For example, &quot;oama access&quot;
    248 #oauth_eval_cmd =
    249 EOF</pre>
    250 </div>
    251 <p class="Pp">To copy the sample file from the source repository:</p>
    252 <p class="Pp"></p>
    253 <div class="Bd-indent">
    254 <pre>cp config/diary.cfg ${XDG_CONFIG_HOME:-~/.config}/diary/</pre>
    255 </div>
    256 <p class="Pp">The file &quot;${XDG_CONFIG_HOME:-~/.config}/diary/diary.cfg&quot;
    257     should adhere to a basic &quot;key = value&quot; format. The value is read
    258     until the end of the line '\n'. Lines can be commented with the special
    259     characters &quot;#&quot;or &quot;;&quot;.</p>
    260 <p class="Pp">The following configuration keys are currently supported:</p>
    261 <p class="Pp"></p>
    262 <table class="tbl" border="1" style="border-style: solid;">
    263   <tr>
    264     <td><b>Command Line Option</b></td>
    265     <td><b>Config Key</b></td>
    266     <td><b>Example Config Value</b></td>
    267     <td><b>Default Config Value</b></td>
    268     <td><b>Description</b></td>
    269   </tr>
    270   <tr>
    271     <td>&quot;--dir&quot;, &quot;-d&quot;, or first non-option argument</td>
    272     <td>dir</td>
    273     <td>~/diary</td>
    274     <td>n/a</td>
    275     <td>Diary directory. Path that holds the journal text files. If unset,
    276       defaults to environment variable &quot;$DIARY_DIR&quot;.</td>
    277   </tr>
    278   <tr>
    279     <td>&quot;--editor&quot; or &quot;-e&quot;</td>
    280     <td>editor</td>
    281     <td>vim </td>
    282     <td>(empty) </td>
    283     <td>Editor to open journal files with. If unset, defaults to environment
    284       variable &quot;$EDITOR&quot;. If no editor is provided, the diary is
    285       opened read-only.</td>
    286   </tr>
    287   <tr>
    288     <td>&quot;--fmt&quot; or &quot;-f&quot;</td>
    289     <td>fmt</td>
    290     <td>%d_%b_%y</td>
    291     <td>%Y-%m-%d</td>
    292     <td>Date format and file name for the files inside the &quot;dir&quot;. For
    293       the format specifiers, see &quot;man strftime&quot;. Be careful: If you
    294       change this, you might no longer find your existing diary entries, because
    295       the diary assumes to find the journal files under another file name.
    296       Hence, a change in FMT shows an empty diary, at first. Rename all files in
    297       the DIARY_DIR to migrate to a new FMT.</td>
    298   </tr>
    299   <tr>
    300     <td>&quot;--fmt-cmd&quot; or &quot;-F&quot;</td>
    301     <td>fmt_cmd</td>
    302     <td>&quot;fmt -w75 -s&quot;, &quot;mdcat -c&quot; or &quot;mdcat&quot;</td>
    303     <td>(empty)</td>
    304     <td>Journal entries are formatted with this command. If not set (default),
    305       the characters are printed to the preview screen character by character
    306       (without word wrap). For example, to enable word wrap after 75 characters,
    307       use &quot;fmt -s&quot; as FMT_CMD. See also [Custom
    308       Formatting](#Custom-Formatting).</td>
    309   </tr>
    310   <tr>
    311     <td>&quot;--no-pty&quot; or &quot;-p&quot;</td>
    312     <td>no_pty</td>
    313     <td>&quot;true&quot;</td>
    314     <td>false (or 0)</td>
    315     <td>No pseudo terminal (pty) for entry preview. Only effective in
    316       combination with &quot;--fmt-cmd&quot;. If set to true (or 1), the output
    317       of &quot;--fmt-cmd&quot; is displayed with Ncurses. If set to false (or
    318       0), the result of &quot;--fmt-cmd&quot; (journal entry preview) is printed
    319       on a pseudo-terminal (pty) and not processed with Ncurses. The pty
    320       supports the ANSI escape sequences (e.g. colors, font types, etc.) of the
    321       native terminal.</td>
    322   </tr>
    323   <tr>
    324     <td>&quot;--no-mouse&quot; or &quot;-m&quot;</td>
    325     <td>no_mouse</td>
    326     <td>&quot;true&quot;</td>
    327     <td>false (or 0)</td>
    328     <td>Don't listen for <b>MOUSE EVENTS</b>. With no_mouse=0 (default), native
    329       text selection and right-click in the preview window requires holding down
    330       the &quot;SHIFT&quot; key.</td>
    331   </tr>
    332   <tr>
    333     <td>&quot;--range&quot; or &quot;-r&quot;</td>
    334     <td>range</td>
    335     <td>10</td>
    336     <td>1</td>
    337     <td>Number of years to show before/after todays date</td>
    338   </tr>
    339   <tr>
    340     <td>&quot;--weekday&quot; or &quot;-w&quot;</td>
    341     <td>weekday</td>
    342     <td>0</td>
    343     <td>1</td>
    344     <td>First weekday, &quot;7&quot; = Sunday, &quot;1&quot; = Monday, ...,
    345       &quot;6&quot; = Saturday. Use &quot;7&quot; (or &quot;0&quot;) to display
    346       week beginning at Sunday (&quot;S-M-T-W-T-F-S&quot;), or &quot;1&quot; for
    347       &quot;M-T-W-T-F-S-S&quot;. If &quot;glibc&quot; is installed, the first
    348       day of the week is derived from the current locale setting
    349       (&quot;$LANG&quot;, see &quot;man locale&quot;). Without
    350       &quot;glibc&quot;, the first weekday defaults to 1 (Monday), unless
    351       specified otherwise with this option.</td>
    352   </tr>
    353   <tr>
    354     <td>n/a</td>
    355     <td>caldav_server</td>
    356     <td>Google calendar
    357       &quot;https://apidata.googleusercontent.com/caldav/v2&quot;, Yahoo
    358       calendar &quot;https://caldav.calendar.yahoo.com&quot;, GMX
    359       &quot;https://caldav.gmx.net&quot; or other CalDAV compatible
    360       provider.</td>
    361     <td>(empty)</td>
    362     <td>CalDAV server for <b>CALDAV SYNC</b> (required).</td>
    363   </tr>
    364   <tr>
    365     <td>n/a</td>
    366     <td>caldav_calendar</td>
    367     <td>diary </td>
    368     <td>(empty)</td>
    369     <td>Calendar name for <b>CALDAV SYNC</b> (required).</td>
    370   </tr>
    371   <tr>
    372     <td>n/a</td>
    373     <td>caldav_username</td>
    374     <td></td>
    375     <td>(empty)</td>
    376     <td>CalDAV server username for <b>CALDAV SYNC</b> (optional).</td>
    377   </tr>
    378   <tr>
    379     <td>n/a</td>
    380     <td>caldav_password</td>
    381     <td></td>
    382     <td>(empty)</td>
    383     <td>CalDAV server password for <b>CALDAV SYNC</b> (optional).</td>
    384   </tr>
    385   <tr>
    386     <td>n/a</td>
    387     <td>oauth_eval_cmd</td>
    388     <td>&quot;oama access &lt;email&gt;&quot; or &quot;pass&quot;</td>
    389     <td>(empty)</td>
    390     <td>OAuth command to fetch access token for <b>CALDAV SYNC</b>
    391       (optional).</td>
    392   </tr>
    393 </table>
    394 <p class="Pp"></p>
    395 </section>
    396 <section class="Sh">
    397 <h1 class="Sh" id="CUSTOM_FORMATTING"><a class="permalink" href="#CUSTOM_FORMATTING">CUSTOM
    398   FORMATTING</a></h1>
    399 <p class="Pp">The preview of the journal entries can be processed with a custom
    400     <b>--fmt-cmd</b>. The result of this formatting command is printed to a
    401     pseudo-terminal (pty) by default. This behavior can be changed with the
    402     <b>--no-pty</b> flag. The output processed on the pty (without Ncurses)
    403     includes all ANSI escape characters supported by the terminal (colors, font
    404     types, etc.). Thus, formatters like &quot;fmt&quot;, or any &quot;cat like
    405     program&quot; (&quot;mdcat&quot; to process Markdown) can be plugged in for
    406     <b>--fmt-cmd</b>.</p>
    407 </section>
    408 <section class="Sh">
    409 <h1 class="Sh" id="MOUSE_EVENTS"><a class="permalink" href="#MOUSE_EVENTS">MOUSE
    410   EVENTS</a></h1>
    411 <p class="Pp">Mouse events are listened for by default (<b>no_mouse</b>=false
    412     configuration). This behavior can be disabled with the <b>--no-mouse</b>
    413     flag or in the <b>CONFIGURATION</b> <b>FILE</b> (<b>no_mouse</b>=true). With
    414     <b>no_mouse</b>=false (default), use the SHIFT key for native text selection
    415     and right-click in the preview window.</p>
    416 </section>
    417 <section class="Sh">
    418 <h1 class="Sh" id="IMPORT"><a class="permalink" href="#IMPORT">IMPORT</a></h1>
    419 <p class="Pp">The import functionality can be triggered by pressing <b>i</b> and
    420     expects a path to an ics file. Files in the <b>DIARY_DIR</b> are overwritten
    421     with the entries from the imported ics file.</p>
    422 </section>
    423 <section class="Sh">
    424 <h1 class="Sh" id="EXPORT"><a class="permalink" href="#EXPORT">EXPORT</a></h1>
    425 <p class="Pp">The export functionality can be triggered by pressing <b>E</b> and
    426     asks for a file path to an ics file for storing the journal entries. The ics
    427     file will be created if it does not exist. Existing ics files are
    428     overwritten.</p>
    429 </section>
    430 <section class="Sh">
    431 <h1 class="Sh" id="CALDAV_SYNC"><a class="permalink" href="#CALDAV_SYNC">CALDAV
    432   SYNC</a></h1>
    433 <p class="Pp">The journal files can be synced via CalDAV by pressing <b>s</b>.
    434     Pressing <b>S</b> syncs all journal entries of the active month.</p>
    435 <p class="Pp">The most recently modified entry is considered up to date and is
    436     automatically replaced on the remote side. If the remote file is more
    437     recent, the local file can be replaced with the remote content after
    438     confirmation.</p>
    439 <p class="Pp">No sync is performed, when both files (local/remote) have the same
    440     modification timestamp or no files exists on the server and on disk at all
    441     (i.e., no entry for that date).</p>
    442 <p class="Pp">The diary creates a full-day calendar entry. It's advised to use a
    443     separate calendar for syncing purposes and not to have multiple events for a
    444     day on the remote calendar. The diary only considers the first event of a
    445     given day.</p>
    446 <p class="Pp">The calender for synchronization can be defined with the
    447     configuration key &quot;caldav_calendar&quot;. This key is empty by default.
    448     It is required to configure at least following parameters in the
    449     <b>CONFIGURATION FILE</b>:</p>
    450 <p class="Pp"></p>
    451 <ul class="Bl-bullet">
    452   <li>caldav_server: Calendar server API</li>
    453   <li>caldav_calendar: Calendar name for CalDAV sync</li>
    454 </ul>
    455 <p class="Pp">In addition, it is required to specifiy either
    456     &quot;caldav_username&quot; and &quot;caldav_password&quot; for basicauth
    457     (takes precedence) OR the &quot;oauth_eval_cmd&quot; to retreive an OAuth
    458     access token from a password manager or tool that prints the token to
    459     stdout. Leave username/password empty if you intend to use OAuth
    460     (&quot;oauth_eval_cmd&quot;).</p>
    461 <p class="Pp">Read GOOGLE CALENDAR OAUTH2 to setup authorization with the Google
    462     server. Other CalDAV servers and APIs that are secured with OAuth2 might
    463     work as well (untested).</p>
    464 <p class="Pp">Use the EXPORT/IMPORT functionality for more batch oriented
    465     processing. Making a network request and deciding the most recently modified
    466     entry (local/remote) takes quite some time for large batches.</p>
    467 </section>
    468 <section class="Sh">
    469 <h1 class="Sh" id="GOOGLE_CALENDAR_OAUTH2"><a class="permalink" href="#GOOGLE_CALENDAR_OAUTH2">GOOGLE
    470   CALENDAR OAUTH2</a></h1>
    471 <p class="Pp">To synchronize with the Google calendar, it is required to setup a
    472     project in the cloud console and enable the CalDAV API (not the Google
    473     Calendar API):</p>
    474 <p class="Pp">https://console.cloud.google.com/apis/api/caldav.googleapis.com</p>
    475 <p class="Pp">The Google Calendar CalDAV API is protected with OAuth2:</p>
    476 <p class="Pp">https://developers.google.com/identity/protocols/oauth2</p>
    477 <p class="Pp">The &quot;application&quot;, the &quot;consent screen&quot; and
    478     the &quot;credentials&quot; (client id and secret) need to be defined in the
    479     Google cloud console. Client id and secret should be stored in an utility
    480     application that can fetch and refresh the OAuth access token (e.g.,
    481     &quot;oama&quot;). The command to access the access token
    482     (&quot;oauth_eval_cmd&quot;) should be configured in the <b>CONFIGURATION
    483     FILE</b>.</p>
    484 <p class="Pp">The application requires two OAuth2 scopes
    485     (https://developers.google.com/calendar/api/auth) for CalDAV requests:</p>
    486 <p class="Pp"></p>
    487 <ul class="Bl-bullet">
    488   <li>&quot;https://www.googleapis.com/auth/calendar&quot;: read/share access to
    489       Calendars, required to discover the unique hyperlink/URI for the calendar
    490       specified by config key &quot;caldav_calendar&quot;</li>
    491   <li>&quot;https://www.googleapis.com/auth/calendar.events&quot;: read/write
    492       access to Events owned by the user, allows diary to
    493       create/read/update/delete events in &quot;caldav_calendar&quot;</li>
    494 </ul>
    495 <p class="Pp">The user is asked for consent during the first CALDAV SYNC.</p>
    496 </section>
    497 <section class="Sh">
    498 <h1 class="Sh" id="PRECEDENCE_RULES"><a class="permalink" href="#PRECEDENCE_RULES">PRECEDENCE
    499   RULES</a></h1>
    500 <p class="Pp">The default variables, for instance, for the configuration
    501     variables &quot;editor&quot;, &quot;dir&quot; and &quot;weekday&quot;, are
    502     populated with values in the following order, where earlier entries are
    503     overwritten by subsequent ones if they exist:</p>
    504 <p class="Pp"></p>
    505 <table class="tbl" border="1" style="border-style: solid;">
    506   <tr>
    507     <td></td>
    508     <td><b>Description</b></td>
    509   </tr>
    510   <tr>
    511     <td>1</td>
    512     <td>No default for <b>DIARY_DIR</b>. Defaults for &quot;range&quot;,
    513       &quot;weekday&quot;, &quot;fmt&quot; and &quot;editor&quot; are provided
    514       in &quot;diary.h&quot;. If <b>EDITOR</b> is unset and no editor is
    515       provided in the <b>CONFIGURATION FILE</b> or <b>--editor</b> option, the
    516       diary works read-only. Journal files cannot be opened. If <b>DIARY_DIR</b>
    517       is not provided, the diary won't open.</td>
    518   </tr>
    519   <tr>
    520     <td>2</td>
    521     <td><b>CONFIGURATION FILE</b> (empty default for &quot;editor&quot;, no
    522       default for &quot;dir&quot;)</td>
    523   </tr>
    524   <tr>
    525     <td>3</td>
    526     <td>Environment variables $DIARY_DIR, $EDITOR and $LANG for locale
    527       (&quot;weekday&quot;)</td>
    528   </tr>
    529   <tr>
    530     <td>4</td>
    531     <td>Option arguments, see section <b>OPTIONS</b></td>
    532   </tr>
    533   <tr>
    534     <td>5</td>
    535     <td>First non-option argument is interpreted as <b>DIARY_DIR</b></td>
    536   </tr>
    537 </table>
    538 <p class="Pp"></p>
    539 </section>
    540 <section class="Sh">
    541 <h1 class="Sh" id="PRECEDENCE_EXAMPLE:_LOCALE_AND_FIRST_DAY_OF_WEEK"><a class="permalink" href="#PRECEDENCE_EXAMPLE:_LOCALE_AND_FIRST_DAY_OF_WEEK">PRECEDENCE
    542   EXAMPLE: LOCALE AND FIRST DAY OF WEEK</a></h1>
    543 <p class="Pp">If glibc is installed, the first weekday defaults to the locale
    544     defined in the current shell environment ($LANG, see man locale), unless
    545     specified otherwise with the <b>--weekday</b> option.</p>
    546 <p class="Pp">Start with weekday=3(Wed), overrule any other configuration
    547   value:</p>
    548 <div class="Bd-indent">
    549 <pre>diary -w3</pre>
    550 </div>
    551 <p class="Pp">Start with glibc derived weekday=1, regardless of weekday in
    552     config file:</p>
    553 <div class="Bd-indent">
    554 <pre>LANG=de_CH diary</pre>
    555 </div>
    556 <p class="Pp">If glibc is installed, start with glibc derived base date
    557     (weekday=0):</p>
    558 <div class="Bd-indent">
    559 <pre>LANG= diary</pre>
    560 </div>
    561 <p class="Pp">Disable environment variable, default to value from config
    562   file:</p>
    563 <div class="Bd-indent">
    564 <pre>unset LANG</pre>
    565 </div>
    566 <p class="Pp">Start with weekday default from config file, if available:</p>
    567 <div class="Bd-indent">
    568 <pre>diary</pre>
    569 </div>
    570 <p class="Pp">Remove config file:</p>
    571 <div class="Bd-indent">
    572 <pre>rm ${XDG_CONFIG_HOME:-~/.config}/diary/diary.cfg</pre>
    573 </div>
    574 <p class="Pp">Start with weekday default value from source code (1=Mon):</p>
    575 <div class="Bd-indent">
    576 <pre>diary</pre>
    577 </div>
    578 </section>
    579 <section class="Sh">
    580 <h1 class="Sh" id="DEVELOPMENT_AND_SUPPORT"><a class="permalink" href="#DEVELOPMENT_AND_SUPPORT">DEVELOPMENT
    581   AND SUPPORT</a></h1>
    582 <p class="Pp">Contributions are always welcome! All source code is available at
    583     https://code.in0rdr.ch/diary.</p>
    584 <p class="Pp">For question and support visit
    585   https://web.libera.chat/gamja/#p0c.</p>
    586 </section>
    587 <section class="Sh">
    588 <h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
    589 <ul class="Bl-bullet">
    590   <li>Andreas Gruhler</li>
    591   <li>Matthias Beyer</li>
    592   <li>Johnathan Jenkins</li>
    593   <li>Yu-Jie Lin</li>
    594   <li>Balduin Dettling</li>
    595   <li>Avindra Goolcharan</li>
    596   <li>Oliver Blanthorn</li>
    597   <li>Jonny Burger</li>
    598 </ul>
    599 </section>
    600 <section class="Sh">
    601 <h1 class="Sh" id="LICENSE"><a class="permalink" href="#LICENSE">LICENSE</a></h1>
    602 <p class="Pp">MIT License, https://code.in0rdr.ch/diary/file/LICENSE.html</p>
    603 </section>
    604 </div>
    605 <table class="foot">
    606   <tr>
    607     <td class="foot-date">2024-09-14</td>
    608     <td class="foot-os"></td>
    609   </tr>
    610 </table>
    611 </body>
    612 </html>