• Emacs 番茄钟 pomidor


    Windows 10

    pomidor:https://github.com/TatriX/pomidor

    alert :https://github.com/jwiegley/alert

    toaster:https://github.com/nels-o/toaster

    在Emacs里可以使用番茄工作法,这里用的是pomidor,因为这个可以记录一共用了多少个番茄钟。

    当25分钟到了之后可以用声音和弹出框进行提示,声音文件可以自定义,弹出框默认是在minibuffer里显示,当然也是可以用其他更醒目的方式的,例如toaster。

    toaster下载后需要添加到操作系统的环境变量PATH里,在Path后面加上:

    F:home	oaster	oastinRelease

    根据实际情况更改位置。

    以下是配置:

    ;;; init-pomidor.el --- pomidor
    ;;; https://github.com/TatriX/pomidor
    ;;; Commentary:
    ;;; Code:
    
    (use-package pomidor
      :ensure t
      :defer t
      :init
      (global-set-key "M-p" #'pomidor)
      :config
      (setq
       ;;pomidor-sound-tick nil ;; nil取消声音
       ;;pomidor-sound-tack nil ;; nil取消声音
       pomidor-sound-tick (expand-file-name (concat (getenv "HOME") "/myemacs/resource/tick.wav"))
       pomidor-sound-tack (expand-file-name (concat (getenv "HOME") "/myemacs/resource/tack.wav"))
       pomidor-sound-overwork (expand-file-name (concat (getenv "HOME") "/myemacs/resource/ring.wav"))
       pomidor-sound-break-over (expand-file-name (concat (getenv "HOME") "/myemacs/resource/rest.wav"))
       )
    
      ;; log
      ;; https://github.com/TatriX/pomidor/issues/20
      (defadvice pomidor-stop (before pomidor-save-log activate)
        "Log pomidor data to the ~/pomidor-log.csv file.
         Columns: date,work,overwork,break"
        (write-region (format "%s,%d,%d,%d
    "
                              (format-time-string "%Y/%m/%d")
                              (/ (time-to-seconds (pomidor-work-duration)) 60)
                              (/ (time-to-seconds (or (pomidor-overwork-duration) 0)) 60)
                              (/ (time-to-seconds (or (pomidor-break-duration) 0)) 60))
                      nil
                      "~/pomidor-log.csv"
                      'append))
    
      (cond
       ((eq system-type 'windows-nt)
        (setq alert-default-style 'toaster)
        )
       ((eq system-type 'gnu/linux)
        (setq alert-default-style 'libnotify)
        ))
      )
    (provide 'init-pomidor)
    ;;; init-pomidor.el ends here

    toaster下载:https://files.cnblogs.com/files/ibgo/toaster-master.zip

    -- END --

  • 相关阅读:
    Java:如何正确地使用异常详解
    操作系统:基于页面置换算法的缓存原理详解(下)
    php 分页
    修改css
    /Home/Tpl/Equipment/rangeIndex.html 里调用魔板
    logstash 处理各种时间格式
    MySQL 没有索引 锁全表
    nginx 配置多个主机
    RR 插入不影响
    根据div 标签 查看数组@class=modulwrap 下面的/table/tbody/tr/td
  • 原文地址:https://www.cnblogs.com/ibgo/p/10229891.html
Copyright © 2020-2023  润新知