2014-11-02

In contrast to popular opinion about work interruptions, I've found that being interrupted with a simple prompt to explain what I'm doing is actually often helpful.

Explicitly articulating how I'm spending my time helps me to remember the big picture and notice when I've drifted off course.

To this end, I've set up a graphical prompt for maintaining regular jrnl entries in the style of the old Facebook status line:

Prompt: Andrew is…

The prompt only appears while the computer is in use, gives notice before stealing focus, and permits alarm clock–style snoozing to accommodate time-sensitive tasks.

#!/bin/bash
set -o errtrace

prompt() {
notify-send --hint 'int:transient:1' \
--icon 'appointment-new' \
'Upcoming journal entry'
sleep 4s
yad --center \
--entry \
--entry-label "$1" \
--no-buttons \
--on-top \
--sticky \
--timeout '60' \
--timeout-indicator 'left' \
--title 'Journal' \
--undecorated \
--width '600'
}

while sleep '5m'; do
if (( $(xprintidle) < 60000 )) && status="$(prompt 'Andrew is')"; then
jrnl "@prompt Andrew is $status"
sleep '15m'
fi
done