Created
January 12, 2024 22:40
-
-
Save johnlindquist/c225e34990a8c129df217a6cc244526b to your computer and use it in GitHub Desktop.
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
// Name: Bookmarks | |
// Trigger: bm | |
// Shortcut: opt b | |
import "@johnlindquist/kit" | |
let bookmarks = await readFile(kenvPath("bookmarks.txt"), "utf8") | |
let choices = bookmarks | |
.split("\n") | |
.filter(Boolean) | |
.map(bookmark => { | |
let [url, name, trigger] = bookmark.split(" - ") | |
return { | |
name, | |
value: url, | |
trigger, | |
tag: trigger, | |
} | |
}) | |
let url = await arg("Open Bookmark", choices) | |
focusTab(url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment