Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Created January 12, 2024 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnlindquist/c225e34990a8c129df217a6cc244526b to your computer and use it in GitHub Desktop.
Save johnlindquist/c225e34990a8c129df217a6cc244526b to your computer and use it in GitHub Desktop.
// 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