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.
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.
First, add a new block script under
~/.i3/blocks. Let's call it
It will simply output the content of the
/tmp/focus file if it exists.
Wire it into i3blocks by adding a section to
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
The end result looks something like this:
Last update: 2023-01-02