i3 Desktop Part 7: Notes and a Scratchpad Terminal
Two features make this i3 setup feel much more comfortable day to day: notes and a scratchpad terminal.
Neither is complicated. That is why they work.
The notes are Markdown files under ~/.local/share/notes. The scratchpad terminal is a floating kitty window managed by i3’s scratchpad. Both are wrapped in scripts so they behave like parts of the desktop rather than separate habits I have to remember.
Markdown notes
Notes are handled by .local/bin/i3-notes.
The menu has a small set of actions:
- quick note
- open today
- open scratch
- search notes
- recent notes
- browse notes
- open notes folder
Quick note is the one I use when I want to capture something without switching context. It opens a rofi input prompt, then appends the note to today’s daily Markdown file with a timestamp.
Daily notes live under daily/YYYY-MM-DD.md. If the file does not exist, the script creates it with a heading like the current day and date.
That gives me a lightweight log without needing a full journaling app.
Opening notes in the terminal
When opening a note, the script prefers a terminal editor: nvim, then vim, then vi, unless I3_NOTES_EDITOR is set. If kitty is available, it opens a kitty window in the note’s directory and runs the editor there.
This fits the rest of the desktop. Notes are plain files. Editing happens in tools I already use. There is no sync service, database, or custom format.
Search uses rg when available and falls back to grep. Results are shown in rofi. Selecting a result opens the file at the matching line for vim-style editors.
Recent notes are based on file modification time. Browse notes lists Markdown and text files under the notes directory.
This is not a knowledge management system. It is fast capture and fast retrieval.
The scratchpad terminal
The scratchpad terminal is .local/bin/i3-scratchpad-terminal.
The i3 config marks windows with instance scratchpad-terminal as floating, sticky, centred, resized to 1200 by 720, and moved to the scratchpad. Mod+Shift+Return toggles it.
The useful detail is where it opens.
When launching a new scratchpad terminal, the script tries to find the working directory of the focused window. It asks i3 for the focused window ID, uses xprop to get the window PID, walks descendant processes with ps, and reads /proc/<pid>/cwd.
If it can find a useful directory that is not just home, kitty opens there. If not, it falls back to $HOME.
That means if I am working in a terminal inside a project and hit the scratchpad shortcut, the scratchpad starts in that project. It feels like a temporary command layer over the current work rather than a random terminal.
Why use i3 scratchpad
The scratchpad is one of the best i3 features because it gives a window a different lifecycle.
Most terminal windows belong to a workspace. The scratchpad terminal belongs to the desktop. It can appear on top of whatever I am doing, then disappear again without changing workspace layout.
That makes it ideal for:
- quick commands
- checking a file
- running a one-off search
- testing a command before putting it into a script
- taking a note while staying in the same workspace
It is not a replacement for normal terminals. It is a pressure valve.
Plain files, fast entry
The notes script and scratchpad terminal are connected by the same philosophy.
Do not add a big app when a plain file and a good shortcut are enough. Do not make capture depend on a browser tab or a cloud service. Do not make quick commands disturb the workspace layout.
The desktop should make small actions cheap.
For me, notes and scratchpad are exactly that: low-friction tools that make it easier to keep working without losing context.