Customize

To customize the calendar (without altering installation files), you can start with a copy of them in the user config folder:

Manually :

# Themes
cp -r /usr/share/naivecalendar/themes/* ~/.config/naivecalendar/themes/

# Events
cp -r /usr/share/naivecalendar/global/events.cfg  ~/.config/naivecalendar/global/events.cfg

# Scripts
cp -r /usr/share/naivecalendar/global/custom_actions.cfg  ~/.config/naivecalendar/global/custom_actions.cfg
cp -r /usr/share/naivecalendar/scripts/*  ~/.config/naivecalendar/scripts/

With subcommand:

naivecalendar configure --clone <config file>

Themes

A theme consist of two files :

  • theme.cfg : an ini file, configure calendar content

  • theme.rasi : a rofi theme file, configure apperance (color, size, layout…)

Warning

Number of rows in rofi (.rasi) should match content configuration (.cfg)! See more details in .cfg files.

Some themes are avaibles, set them by typing theme in rofi prompt or temporarily load them with --theme argument. To create your own theme, create a rasi file and a cfg file in ~/.config/naivecalendar/themes.

You can start from a copy of “officials” themes, with configure subcommand or manually:

cp -r /usr/share/naivecalendar/themes/* ~/.config/naivecalendar/themes/

Note

If it exist two themes with the same name in differents folders, the one in $HOME/.config/… will be prevalent over the others

Then modify themes one by one with your favourite editor or use naivecalendar subcommand to update multiples themes at once (cfg files only)

naivecalendar update-themes -h

Author

Proposed themes are more examples than official. I intented this calendar to easily match all user configurations and to be easily configurable. There is no specific tool to update .rasi files, but they (almost all) share some ressources in themes/common/, commonly:

  • a color theme : theme_<color_name>.rasi

  • a position on the screen : position.rasi

  • a shape (contain number of row) : shape_<kind>.rasi

So you can easily mix them to customize calendar aspect or modify independently colors and shapes.

Events

Events files names should contain strftime directives (%d, %m …) to appear in the calendar.

note_%Y-%m-%d.txt

Not giving it a year directive will make it occur every year (usefull for birthday isn’t it?)

birthday_on_%d-%m.txt

The calendar handle multiple events types (that are simply differents folders), you can define new event type by adding an entry in [EVENTS] section in .config/naivecalendar/global/event.cfg. Paths are relative to user’s home.

[EVENTS]

Notes = .naivecalendar_events/MyNotes/note_%Y-%m-%d.txt
Birthday = .naivecalendar_events/Birthdays/birthday_on_%d-%m.txt

Notes support a very light format to be parsed when displaying “events of the month” :

  • show section : if you create sections (format : [section]) all lines containing a section will be displayed

    [9H30 -> 10H] short description <---- will be displayed
    Long
    multilines
    description...
    [14H30] rdv with bidulle <----- will be displayed
    Some text again again
    
  • show header : if the event/note don’t contain section, only first line will be displayed

    # Note Title  <---- only first line is displayed
    Some text
    Some text again...
    

if you interact with the event file name, it will open the note again, other rows will bring you back to calendar

notes_2021-01-05 : <---- reopen editor
[9H30 -> 10H] short description  <--- do nothing : back to calendar
[14H30] rdv with bidulle

Custom actions

User can also create is own custom action i.e. create a button that launch user’s script. To add a custom action please, put your script in ~/.config/naivecalendar/script/, then, edit ~/.config/naivecalendar/global/custom_actions.cfg to configure the button/shortcut:

[Shortcut Name] <--- used as id for other conf file
SYM = Icon, [shortcut_1, shortcut_2], long description   <--- Icon : displayed on calendar
CMD = path/to/script <--- script or system command            long description : displayed in menu

In brief

Here is an overview of properties that can be edited in .cfg and .rasi files :

_images/theming.png

Example

theme.cfg:

# THis is the configuration of naivecalendar contents
#
#         ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┓              ━┓
#         ┃ sept. 2021 :              ┃  <= PROMPT    ┃
#         ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━┫               ┃
#         ┃ ┏━╸ SUNDAY                ┃               ┃ <= HEADER
#         ┃ ┣━┓                       ┃  <= HEAD_MSG  ┃
#         ┃ ┗━┛                       ┃   (optional)  ┃
#    ┏━━  ┣━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┫              ━┛
#    ┃ 0  ┃ ⚀ │ ⚁ │ ⚂ │ ⚃ │   │   │   ┃  <= BAR_2 (optional)
#    ┃ ─  ┣━━━┿━━━┿━━━┿━━━┿━━━┿━━━┿━━━┫
#  R ┃ 1  ┃Mon│Tue│Wed│Thu│Fri│Sat│Sun┃  <= DAY_NAMES
#  O ┃ ─  ┣━━━┿━━━┿━━━┿━━━┿━━━┿━━━┿━━━┫
#  w ┃ 2  ┃   │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 ┃ <▲= CAL_START
#    ┃ ─  ┠───┼───┼───┼───┼───┼───┼───┨  │   
#  N ┃ 3  ┃ 7 │ 8 │ 9 │10 │11 │12 │13 ┃  │ 
#  U ┃ ─  ┠───┼───┼───┼───┼───┼───┼───┨  │
#  M ┃ 4  ┃14 │15 │16 │17 │18 │19 │20 ┃  │   CAL
#  B ┃ ─  ┠───┼───┼───┼───┼───┼───┼───┨  │ 6 weeks
#  E ┃ 5  ┃21 │22 │23 │24 │25 │26 │27 ┃  │
#  R ┃ ─  ┠───┼───┼───┼───┼───┼───┼───┨  │
#  S ┃ 6  ┃28 │29 │30 │31 │   │   │   ┃  │
#    ┃ ─  ┠───┼───┼───┼───┼───┼───┼───┨  │
#    ┃ 7  ┃   │   │   │   │   │   │   ┃  ▼
#    ┃ ─  ┣━━━┿━━━┿━━━┿━━━┿━━━┿━━━┿━━━┫
#    ┃ 8  ┃◀  │◀◀ │   │ ◆ │   │▶  │▶▶ ┃  <= BAR_1 (optional)
#    ┗━━  ┗━━━┷━━━┷━━━┷━━━┷━━━┷━━━┷━━━┛
#
#         ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
#          up to 7 icon/button per bar
#


[LOCALE]
# keep empty to get system locale, use 'locale -a' on your system to list locales
USER_LOCALE =



[HEADER]
# Prompt
#######
# date format in rofi prompt
PROMT_DATE_FORMAT = %b %Y

# Head message
##############
#  Show a strftime and pango markup formated string in rofi #message box

#  Set value to False to hide it
IS_TODAY_HEAD_MSG = True

# Make message update and follow displayed month instead of showing actual month
IS_LOOP_TODAY_HEAD_MSG = False

# The message could contain strftime directives
# You can use pango markup langage, see `<https://developer.gnome.org/pango/stable/pango-Markup.html>`_
# common properties :
#   size : 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'
#   rise : vertical displacement from the baseline, in ten thousandths of an em
#
# To insert a new line use the following character : &#x0a;
#
# Examples :
# without pango:
#    TODAY_HEAD_MSG_TXT = %d %A
#
# with pango markup:
#    TODAY_HEAD_MSG_TXT = <span rise="0" size="xx-large">%d</span> &#x0a;<span rise="12000" size="small">%A</span>
#
TODAY_HEAD_MSG_TXT = <span rise="0" size="xx-large">%d</span> <span rise="12000" size="small">%A</span>



[DAY NAMES]
# Set format of day name abbreviations
# day name lenght
DAY_ABBR_LENGHT = 3
# 0 = sunday, 1 = monday...
FIRST_DAY_WEEK = 1



[CONTROL]
# Symbols to navigate between months and years
# 1st symbol is displayed, others are simply shortcuts to enter in rofi prompt
SYM_NEXT_MONTH = ▶,  >,  +,  n
SYM_NEXT_YEAR = ▶▶, >>, ++, nn
SYM_PREV_MONTH = ◀,  <,  -,  p
SYM_PREV_YEAR = ◀◀, <<, --, pp



[CONTENT]

# Rows
######
# Row number where to display symbols (see Symbols in this section)
# rows count start at 0
# keep empty to desactivate the row display

# row number where to display calendar day names
ROW_DAY_NAMES = 0

# row number where days of the month display start
# Calendar always show 6 weeks, so next row start at ROW_CAL_START + 6
ROW_CAL_START = 1

# row number for customizable bar, those are optional, just keep empty to desactivate
ROW_BAR_1 = 7
ROW_BAR_2 = 

# Please make ROW number match calendar *-lines* parameter in rasi theme file
# Just count 1 line for each activated ROW_* except ROW_CAL_START that count for 6 (6 week per month)
#
# Go further :
# the given number is used for row relative position and highligthing some row
# if your calendar shape looks good but rows seem badly higlighted, please re-check positions


# bar_1 and bar_2 can hold some text or fontawesome icons 
# that, when pressed, can trigger an action.
#
# Available actions can be found in  [SHORTCUTS], [CONTROL] sections and
# in global/custom_actions.cfg file.
#
# bars will display first element of lists provided in those sections
#
# Using next table, fill the bars by filling next list 
# (SYMS_BAR_1, SYMS_BAR_2) with actions ids 
# /!\ don't forget to activate the row (see ROW_* variables above in 
# this section, otherwise it won't be displayed
#
# ID table :
# ================== ====================
#  Action             id
# ================== ====================
# SYM_NEXT_MONTH      pp
# SYM_NEXT_YEAR       p
# SYM_PREV_MONTH      n
# SYM_PREV_YEAR       nn
# SYM_SHOW_HELP       h
# SYM_SWITCH_THEME    t
# SYM_SHOW_EVENTS     e
# SYM_SWITCH_EVENT    s
# SYM_SHOW_MENU       m
# SYM_GO_TODAY        bb
# ================== ===============
#
# for custom actions (in global/custom_actions.cfg), use the section name 
# you entered as id.
#
# (keep empty to use default)
# (should contains 7 element (as number of days in a week :P))
#
#SYMS_BAR_1 = pp, p,  , m,  , n, nn
SYMS_BAR_1 = pp, p,  , m,  , n, nn

#SYMS_BAR_2 = h, t, s, e,  ,  , m
SYMS_BAR_2 =



[SHORTCUTS]
# those are shortcuts to open popup windows
# It's not mandatory but
#  - first symbols to display on the calendar (see [CONTENT] section)
#  - last is a more descriptive sentence to be selected in rofi popup
#  - others are just shortcuts to be enter in rofi prompt

# Display a simple help message
SYM_SHOW_HELP = , help, hh,  display help
# Change calendar theme for one in theme folder
SYM_SWITCH_THEME = , theme, tt,  switch theme
# show events of the current month
SYM_SHOW_EVENTS = , event, ee,  show month events
# Switch to another "event" folder (see [EVENTS] section above)
SYM_SWITCH_EVENT = , switch, ss,  switch event type
# Popup that display all these shortcuts options
SYM_SHOW_MENU = ☰ , menu, mm, ☰ show this menu
# Factice event (just continue programm loop)
SYM_BACK_TO_CALENDAR = ,  back to calendar
# Go back to current date
SYM_GO_TODAY = , bb,  back to current month

theme.rasi:

/************************************************
 * ROFI Color theme
 * User: Daguhh
 * Copyright: 2020 Daguhh
 ***********************************************/

@import "common/theme_dark.rasi"
@import "common/position.rasi"
@import "common/shape_classic.rasi"