(defpoll notes_list :interval "3600s"
  'scripts/home/notes')
(defwidget notes [json]
  (box
    :class "notes"
    :orientation "v"
    :halign "baseline"
    :width 300
    :height 150
    :space-evenly true
    (for note in json
      (button :onclick "kate -n '${note.filepath}'"
        (box 
          :orientation "v"
          (label
            :xalign 0
            :wrap false
            :truncate true
            :text "${replace(note.filepath,"${get_env("HOME")}/Documents/Notes/",'')}")
          (label
            :xalign 0.5
            :class "timestamp"
            :text "${formattime("${note.date}","%F %R")}"))))
    ))
