Displaying current focus in i3
I've set up i3 to display the task I'm currently focusing on in the top bar by hacking together a simple solution using i3blocks, zenity and a bunch of shell scripts.
Motivation🔗
This is especially good for procrastinators since you'll constantly be reminded of what you should focus on and have no excuses to veer off into doing something else.
Implementation🔗
First, add a new block script under ~/.i3/blocks
. Let's call it focus
.
It will simply output the content of the /tmp/focus
file if it exists.
Wire it into i3blocks by adding a section to ~/.i3/i3blocks.conf
Next, we'll need a script that prompts us for input when we want to change the focus text:
> cat ~/.i3/change-focus.sh
#!/usr/bin/env bash
out=$(zenity --entry --title="Change focus" --text="Focus on: ")
if [[ "$?" == "0" ]];
then
echo "$out" > /tmp/focus
fi
Finally, we'll want to add a keybinding in ~/.i3/config
:
Demo🔗
The end result looks something like this:
Last update: 2023-01-02