Displaying current focus in i3
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
> cat ~/.i3/blocks/focus #!/usr/bin/env bash test -f /tmp/focus && cat /tmp/focus
It will simply output the content of the
/tmp/focus file if it exists.
Wire it into i3blocks by adding a section to
[focus] min_width=700 align=left color=#ffffff label= interval=2
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
# set the task you want to focus on bindsym $mod+space exec --no-startup-id ~/.i3/change-focus.sh
The end result looks something like this: