hotkey-add-journal is a small Bash utility for adding structured entries to an Obsidian daily note from a keyboard shortcut.
It opens a graphical menu and can record events, sleep times, activities, energy and mood, ideas, reminders, todo items, and optional Markdown tags. The script safely updates the note and refuses to overwrite it when its structure is not what the configuration expects.
The script expects daily notes named like Journal/2026-10-08.md. It inserts normal entries below an exact heading, normally ## Log. Sleep entries are inserted directly after YAML frontmatter.
The script edits Markdown files directly; it does not use the Obsidian API and Obsidian does not need to be open. Keep your normal backup or Git workflow enabled.
The script needs Bash, standard command-line tools, ripgrep, one menu program, yad, and zenity.
sudo apt update
sudo apt install bash coreutils gawk grep sed findutils ripgrep yad zenity wofiIf wofi is unavailable on your Ubuntu release, install rofi instead and set MENU_TOOL="rofi" in the script:
sudo apt install bash coreutils gawk grep sed findutils ripgrep yad zenity rofisudo pacman -Syu
sudo pacman -S bash coreutils gawk grep sed findutils ripgrep yad zenity wofiFor an X11 desktop, install rofi instead and set MENU_TOOL="rofi":
sudo pacman -S rofiFrom this project directory:
mkdir -p "$HOME/.local/bin"
cp hotkey-add-journal "$HOME/.local/bin/hotkey-add-journal"
chmod +x "$HOME/.local/bin/hotkey-add-journal"If $HOME/.local/bin is not in your PATH, add this to ~/.bashrc and/or ~/.zshrc:
export PATH="$HOME/.local/bin:$PATH"Open a new terminal afterwards, or run source "$HOME/.bashrc".
Open hotkey-add-journal and edit only the block marked USER CONFIGURATION — EDIT THIS BLOCK.
Example:
VAULT_DIR="$HOME/Documents/MyObsidianVault"
JOURNAL_SUBDIR="Journal"
TEMPLATE_RELATIVE_PATH="_Templates/Journal - Daily Note.md"
LOG_HEADING="## Log"
TAG_INDEX_RELATIVE_PATH="TAGS_COUNT.md"
MENU_TOOL="wofi"| Setting | Meaning |
|---|---|
VAULT_DIR |
Absolute path to your Obsidian vault. $HOME is allowed. |
JOURNAL_SUBDIR |
Folder containing YYYY-MM-DD.md daily notes. |
TEMPLATE_RELATIVE_PATH |
Template path relative to the vault. |
LOG_HEADING |
Exact heading where normal entries are inserted. |
TAG_INDEX_RELATIVE_PATH |
Optional tag-count file. Set it to an empty value if you do not have one. |
MENU_TOOL |
wofi for Wayland or rofi for X11/Wayland. |
Linux paths are case-sensitive: Journal and journal are different folders.
Your template must contain the exact heading configured in LOG_HEADING. The smallest usable template is:
---
date: {{date:YYYY-MM-DD}}
---
# {{date:dddd D MMMM YYYY}}
## Log
## NotesAn example is included in examples/daily-note-template.md. If your template uses another heading, either change it to ## Log or change LOG_HEADING in the script.
Run this before using the hotkey:
hotkey-add-journal --checkThe check verifies the vault, Journal folder, template, log heading and required programs. It does not create or modify a journal note.
Then try it manually:
hotkey-add-journalRun it inside your graphical desktop session. A plain SSH session normally cannot display wofi, rofi, yad or zenity.
In ~/.config/niri/config.kdl:
binds {
Mod+J { spawn "/home/YOUR_USER/.local/bin/hotkey-add-journal"; }
}Replace YOUR_USER with your Linux username and reload Niri.
In ~/.config/hypr/hyprland.conf:
bind = SUPER, J, exec, /home/YOUR_USER/.local/bin/hotkey-add-journalReload Hyprland afterwards.
Open Settings → Keyboard → View and Customize Shortcuts → Custom Shortcuts, add a shortcut named Add journal entry, and use /home/YOUR_USER/.local/bin/hotkey-add-journal as the command.
Open System Settings → Keyboard Shortcuts → Add New → Command or Script, choose the script and assign a shortcut.
The tag dialog searches tags found in the vault. It reads the optional tag index and also scans Markdown files with ripgrep. The displayed name does not need a leading #; the script adds it when saving. New tag allows a tag that is not yet present. Tags may not contain spaces.
Install the package named by --check, using apt on Ubuntu or pacman on Arch, then run the check again.
Check that the script is started from a graphical session. Use MENU_TOOL="wofi" for Wayland or MENU_TOOL="rofi" for X11. Test the script manually before assigning a hotkey.
Check VAULT_DIR, JOURNAL_SUBDIR, capitalization and the date filename. The script expects exactly YYYY-MM-DD.md for today.
Make the heading in the template exactly match LOG_HEADING, including the number of # characters and spaces.
- The script does not modify its own source file.
- A lock directory prevents simultaneous updates.
- Temporary files are used while updating an existing note.
- A SHA-256 check prevents replacing the note if another program changed it during the update.
- The script does not delete journal content.