Obsidian URI desktop shortcut to create new datetime-stamped note in your Inbox

Inspired by Shortcut Obsidian's file in desktop, here is a way to have a desktop shortcut that creates a new date- and time-stamped note in your vault’s “Inbox”. This is for Linux users, but maybe it also works on MacOS (someone to try?).

Note: You must have xdg-open on your system for this to work. My Linux Mint has it. (Hint: Try xdg-open --help in a terminal.)

First, create a new .desktop file on your desktop, using a text editor. Let’s call it Quicknote.desktop.

[Desktop Entry]
Name=New Inbox Note
Exec=sh -c 'xdg-open "obsidian://new?vault=Schreiben&file=+Inbox/$(date +"%%Y-%%m-%%d %%H.%%M").md"'
Comment=Creates a new date/time-stamped inbox note in Obsidian
Terminal=false
Icon=obsidian
Type=Application

My vault is called Schreiben, and my Inbox folder +Inbox. Replace these with yours in the Exec= line in above file. I use a date/time format of YYYY-MM-DD HH.MM since a colon : isn’t allowed on Mac and Windows machines.

You should now get a new icon (or “starter”) on your desktop that looks like this:

obsidian-uri-new-inbox-note-starter

Double-clicking it should open Obsidian and create a new file in your vault’s “Inbox” folder:

Easy and useful.

Note: If this fails, it might be that the obsidian: protocol isn’t registered correctly in your system. This sometimes happens when using the .AppImage version of Obsidian, and not creating a correct .desktop file for it. See Meta Post - Linux tips, tricks & solutions to common problems - #8 by Moonbase59


Notes for the curious

  • Change the name by editing the Name= line, or by simply right-clicking the icon on the desktop and renaming it.
  • If needed, you could also use bash instead of sh in the Exec= line.
  • You cannot leave out the shell chain in the Exec= line, because otherwise the date command wouldn’t be executed.
  • The date command needs double percent signs %% (not like in the terminal) because the percent sign has a special meaning in desktop files and must be escaped.
  • The date command needs the apostrophes " around the format string because it can contain blanks.
  • Use man date or date --help to find out more about the available format options.

Have fun making your own Obsidian desktop starters!

4 Likes