feat(emacs+polybar): add org clock :D

This commit is contained in:
Flinner Yuu 2022-04-17 07:04:20 +03:00
parent 298851f455
commit 04a7755cb9
Signed by: flinner
GPG Key ID: 95CE0DA7F0E58CA6
3 changed files with 49 additions and 1 deletions

View File

@ -2159,6 +2159,25 @@ ivy bibtex
(keyfreq-autosave-mode 1))
#+end_src
** Polybar
*** org clock
#+begin_src emacs-lisp
(defun my/polybar/org-clock ()
"Gets polybar formatted message"
(let ((message nil)
(icon nil)
(icon-color nil))
(if (org-clock-is-active)
(setq message (substring-no-properties (org-clock-get-clock-string))
icon ""
icon-color "#BA68C8")
(setq message ""
icon ""
icon-color "#FDD835"))
(concat "%{F" icon-color "}" icon "%{F-}" message)))
#+end_src
* Elfeed org
=;; (setq rmh-elfeed-org-files (list "~/Documents/private.el/elfeed.org"))=
** Elfeed-org

View File

@ -144,7 +144,7 @@ font-1 = "waffle:size=10;3"
;modules-right = color-switch sep mail sep network sep keyboard battery volume backlight sep sysmenu try
#modules-right = color-switch sep network sep keyboard battery volume backlight sep sysmenu try
modules-left = launcher sep workspaces sep memory_bar cpu_bar sep temperature sep title
modules-left = launcher sep workspaces sep memory_bar cpu_bar sep temperature sep org-clock
modules-center = date sep mu4e_edu mu4e ssh keepassxc
modules-right = color-switch sep network sep keyboard sep volume brightness sep filesystem_bar sep battery sep sysmenu tray
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

View File

@ -72,6 +72,35 @@ label-padding = 1
format-prefix = ""
format-prefix-foreground = ${color.green}
[module/org-clock]
type = custom/script
## At time of writing:
# (defun my/polybar/org-clock ()
# "Gets polybar formatted message"
# (let ((message nil)
# (icon nil)
# (icon-color nil))
# (if (org-clock-is-active)
# (setq message (substring-no-properties (org-clock-get-clock-string))
# icon ""
# icon-color "#BA68C8")
# (setq message ""
# icon ""
# icon-color "#FDD835"))
# (concat "%{F" icon-color "}" icon "%{F-}" message)))
exec = emacsclient --eval '(my/polybar/org-clock)' | sed 's/"//g'
interval = 5
format = <label>
label-padding = 1
format-prefix = ""
format-prefix-foreground = ${color.purple}
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
[module/updates]