Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce analogue clock time icon #698

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Conversation

tecosaur
Copy link
Contributor

@tecosaur tecosaur commented Mar 6, 2024

With the SVG library (bundled as part of Emacs), we can generate an analogue clock for the current time to-the-minute, instead of using the nearest-hour nerdicon.

I've personally been running this variant of the time segment since #577 (comment), and so am pretty confident this works as we'd hope.

The one thing I wonder about is whether we can make the svg library be required only when doom-modeline--generate-clock is first called?

Sample screenshot:
image

@tecosaur tecosaur force-pushed the master branch 2 times, most recently from e742ed7 to 661a448 Compare March 6, 2024 15:23
@tecosaur
Copy link
Contributor Author

tecosaur commented Mar 6, 2024

Following a suggestion from @elken, the svg requirement is now soft and baked into the doom-modeline--generate-clock call.

With the SVG library (bundled as part of Emacs), we can generate an
analogue clock for the current time to-the-minute, instead of using the
nearest-hour nerdicon.

This relies on a graphical display, and so a new variable is introduced,
`doom-modeline-time-analogue-clock' and the behaviour is gated
on (display-graphic-p).

There are a number of variables that affect the style of the displayed
clock. For now, I've chosen to be conservative and just expose
`doom-modeline-time-clock-minute-resolution' as a custom variable,
leaving the rest as constants. We may well want to revisit this in the
future.

I've personally been running this variant of the time segment for over a
year now, and as a result am pretty confident there are no behaviour or
performance issues with this implementation.

This implementation is originally sourced from
https://github.com/tecosaur/emacs-config/blob/a3c3b73a00f4e034ffeae11f20b00d1eb948a6e6/config.org#time.
@seagle0128 seagle0128 merged commit d066e7b into seagle0128:master Mar 7, 2024
6 checks passed
@seagle0128
Copy link
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants