org-mode에서 clock-in하는 작업을 Mac 메뉴 표시 줄에 표시
org-mode에는 훌륭한 태스크의 시간 계측 기능이 붙어 있습니다만,
태스크 자체는 Emacs 이외에서 하는 경우가 많다
clock-in하는 것을 잊고 작업에 걸려 버리거나,
반대로 clock-out하는 것을 잊어 다음 작업에 걸려 버리는 경우가 자주 있습니다.
거기서 현재 clock-in 하고 있는 태스크가 무엇인가 한눈에 알 수 있도록(듯이)
BitBar 라는 응용 프로그램을 사용하여
메뉴바에 현재의 태스크와 경과 시간을 표시시켜 보았습니다.

BitBar 설치
BitBar는 Mac 메뉴 바에 임의의 정보를 표시 할 수있는 응용 프로그램입니다.
brew cask를 사용하여 설치할 수 있습니다.
$ brew cask install bitbar
설치가 완료되고 앱이 실행되면 메뉴 바에서
BitBar를 클릭하고,Change Plugin Folder 에서 임의의 디렉토리를 지정합니다.BitBar 플러그인 추가
방금 지정한 디렉토리에 다음 플러그인을 추가합니다.
BitBar 플러그인 이름의 명명 규칙은 다음과 같습니다.
{任意の名前}.{更新間隔}.{拡張子}
이번에는 5초 간격으로 실행하도록 설정해 보았습니다.
org_clockin_task_bitbar_plugin.5s.sh
#!/bin/bash
if [ -e ~/.clockin_task ]; then
  task_name=`cat ~/.clockin_task | cut -f 2`
  start_time=`cat ~/.clockin_task | cut -f 1`
  elapsed=$(expr `date +%s` - $start_time)
  h=$(expr $elapsed / 3600)
  m=$(expr $elapsed % 3600 / 60)
  disph=`printf %02d $h`
  dispm=`printf %02d $m`
  echo ":hourglass_flowing_sand: [$disph:$dispm] $task_name"
else
  echo ":coffee: Break Time"
fi
나중에 설명하지만 org-mode로 clockin 한 작업의 시작 시간 (unixtime)과 작업 이름
~/.clockin_task에 출력하려고합니다.org-clock-hook 설정
clock-in했을 때에 태스크명과 태스크의 개시 시간을
~/.clockin_task 에 출력해,clock-out 또는 clock-cancel 할 때
~/.clockin_task를 삭제하도록 설정합니다.  (defvar clockin-task-file "~/.clockin_task")
  (defun write-clockin-task-file ()
    (with-temp-buffer
      (insert (concat (format-time-string "%s" org-clock-start-time)
                      "\t"
                      org-clock-heading))
      (write-region (point-min) (point-max) clockin-task-file))
    )
  (defun delete-clockin-task-file ()
    (delete-file clockin-task-file))
  (add-hook 'org-clock-in-hook 'write-clockin-task-file)
  (add-hook 'org-clock-out-hook 'delete-clockin-task-file)
  (add-hook 'org-clock-cancel-hook 'delete-clockin-task-file)
적절한 함수를 만들고
org-clock-*-hook에 추가했습니다.미래의 과제
태스크를 클릭하면 오늘 할 예정인 태스크 목록이나 늘어놓으면 좋겠다고 생각하거나
Reference
이 문제에 관하여(org-mode에서 clock-in하는 작업을 Mac 메뉴 표시 줄에 표시), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/tamanugi/items/ef43056d5c9709e4f7ab텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)