nix/home/shell/bin/b
2025-06-07 21:33:23 -07:00

20 lines
360 B
Bash
Executable file

#!/usr/bin/env sh
# https://github.com/soulim/bookmarks.txt/blob/main/bin/bookmarks
set -o errexit
set -o nounset
url=${1:-}
title=${2:-}
global="$HOME/Personal/bookmarks.txt"
if [ -n "$url" ]
then
echo "$url $title" >> $global
else
local="$PWD/bookmarks.txt"
(cat "$global" "$local" 2>/dev/null || true) | fzf | cut -d ' ' -f 1 | xargs open
fi