Created
July 6, 2023 01:39
-
-
Save plskz/cf2cdc4ae467b6238c21fe94589e4c55 to your computer and use it in GitHub Desktop.
Raycast script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env PATH=$PATH:/opt/homebrew/opt/node@18/bin node | |
// Required parameters: | |
// @raycast.schemaVersion 1 | |
// @raycast.title Open Logseq Today's JW | |
// @raycast.mode fullOutput | |
// Optional parameters: | |
// @raycast.icon ๐ | |
// Documentation: | |
// @raycast.description Open Logseq Today Journal | |
// @raycast.author Zai Santillan | |
// @raycast.authorURL https://github.com/plskz | |
const { exec } = require('child_process') | |
const date = new Date() | |
const today = date.toISOString().split('T')[0] | |
const [year, month, day] = today.split('-') | |
let uri = `logseq://graph/.life-archive?page=${year}/${month}/${day}` | |
console.log(uri); | |
console.log(`Opening Logseq JW Today: ${today}`); | |
exec(`open "${uri}"`) // doesn't work. that's why i'm using shell script instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Required parameters: | |
# @raycast.schemaVersion 1 | |
# @raycast.title Open Logseq Today's JW | |
# @raycast.mode silent | |
# Optional parameters: | |
# @raycast.icon ๐ | |
# Documentation: | |
# @raycast.author Zai Santillan | |
# @raycast.authorURL https://github.com/plskz | |
today=$(date +%Y-%m-%d) | |
IFS='-' read -r year month day <<< "$today" | |
uri="logseq://graph/.life-archive?page=${year}/${month}/${day}" | |
echo "$uri" | |
echo "Opening Logseq JW Today: $today" | |
open "$uri" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment