Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tristancacqueray/gnome-org-next-schedule
A gnome extension to show the next schedule event
https://github.com/tristancacqueray/gnome-org-next-schedule
Last synced: 14 days ago
JSON representation
A gnome extension to show the next schedule event
- Host: GitHub
- URL: https://github.com/tristancacqueray/gnome-org-next-schedule
- Owner: TristanCacqueray
- License: apache-2.0
- Created: 2024-01-15T03:05:56.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-05-15T16:05:55.000Z (6 months ago)
- Last Synced: 2024-10-11T01:47:43.814Z (27 days ago)
- Language: PureScript
- Size: 47.9 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
gnome-org-next-schedule
=======================A gnome-shell extension to display your next schedule.
This adds a new widget to the status bar with a countdown until the next event
and triggers a notification five minutes before.![screenshot](./screenshot.png)
This extension is best used with [org-mode][org-mode] superior scheduling capabilities,
for regular gnome calendar, see .# Usage
The extension loads a list of events from `~/.local/share/org-gnome-next-schedule/events`
using the following format: ` `.The events list can be generated using [org-ql][org-ql]:
```emacs-lisp
(defun tc/mk-next-meeting-query ()
"The next meeting query."
'(and (not (done)) (not (habit)) (scheduled :from ,(ts-now))));; see: https://github.com/alphapapa/org-ql/issues/397
(defun tc/compare-entry (b a)
"Order entry A and B so that they appears from newest to oldest.
This is like org-ql--date< but considering closed date too."
(cl-macrolet ((ts (item)
`(or (org-element-property :closed ,item)
(org-element-property :deadline ,item)
(org-element-property :scheduled ,item))))
(org-ql--org-timestamp-element< (ts a) (ts b))))(defun tc/sched-format (item)
(let* ((properties (cadr item))
(title (plist-get properties :raw-value))
(scheduled (plist-get properties :scheduled))
(ts (format-time-string "%FT%T%z" (org-timestamp-to-time scheduled))))
(format "%s %s" ts title)))(defvar tc/schedule-events ""
"The last schedule render to update the files when it changes.")(defun tc/render-schedule-events ()
(let* ((entries (org-ql-select '("~/org/projects.org")
(tc/mk-next-meeting-query)
:action 'element-with-markers
:sort 'tc/compare-entry
))
(formated (mapcar 'tc/sched-format (seq-filter 'not-habits entries)))
(report (s-join "\n" (reverse formated))))
(when (not (string= report tc/schedule-events))
(setq tc/schedule-events report)
(f-write-text report 'utf-8 "~/.local/share/gnome-org-next-schedule/events"))));; Update schedule events when the agenda is displayed
(add-hook 'org-agenda-mode-hook 'tc/render-schedule-events)
```… which produces such a file:
```
2024-01-16T10:00:00-0500 Team Daily
```# Contribute
Contributions are most welcome.
To modify gnome-org-next-schedule, you will need a [PureScript][purescript] toolchain
and the gnome developper tool.
Run the `nix develop` command to setup.Checkout the [purescript-gjs][purescript-gjs] bindings too.
# Changes
## 0.1
- Initial release.
[purescript]: https://www.purescript.org/
[purescript-gjs]: https://github.com/purescript-gjs/purescript-gjs
[org-mode]: https://orgmode.org/
[org-ql]: https://github.com/alphapapa/org-ql