# \[Linux\] Quick Capture using AutoKey

**URL:** <https://forum.obsidian.md/t/linux-quick-capture-using-autokey/22784>\
**Category:** Workflows & Templates\
**Created:** [August 18, 2021, 5:45pm UTC](https://forum.obsidian.md/t/linux-quick-capture-using-autokey/22784 "2021-08-18T17:45:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggmate](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/g/da6949/32.png) [@ggmate](https://forum.obsidian.md/u/ggmate)\
**Post date:** [August 18, 2021, 5:45pm UTC](https://forum.obsidian.md/t/linux-quick-capture-using-autokey/22784/1 "2021-08-18T17:45:07Z")

</div>

AutoKey is a Linux application that is very much similar to AutoHotKey. The below code can be used to launch a small popup window where you can quickly write/paste down information for later processing. You can also bind this script to any hotkey.

Just change `INBOX_LOCATION` to any markdown file in your vault. This is the file where the contents are appended.

```auto
# Capture info to inbox quickly 
import subprocess
import sys
from datetime import datetime
INBOX_LOCATION = "/path/to/vault/inbox.md"

dialog_op = dialog.input_dialog(title="Quick Capture", message="Enter anything")
if dialog_op[0] != 0:
    #subprocess.Popen(['notify-send',f"Error getting input."])
    sys.exit(0)
else:
    message = dialog_op[1]

today = datetime.today().strftime("%Y-%m-%d")
stored_date = store.get_global_value("date")

# if not same, write the H2 heading in the file and the append message
# else append the message alone
if today != stored_date:
    store.set_global_value("date", today)
    with open(INBOX_LOCATION, "a") as inbox:
        inbox.write(f"\n\n### {today}" + f"\n- {message}")
else:
    with open(INBOX_LOCATION, "a") as inbox:
        inbox.write(f"\n- {message}")
        
subprocess.Popen(['notify-send',f"Note captured!"])

```
