summaryrefslogtreecommitdiff
path: root/bin/scripts/linkhandler_store
blob: 49b85163c45281c20eb62fdc67fa803f09b3f201 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env sh

# Store the provided links in linkhandler's store_file.
# The stored links will be prefixed next time linkhandler is run.

cache_dir="${XDG_CACHE_DIR:-$HOME/.cache}/linkhandler"
store_file="$cache_dir/store"
[ -d "$cache_dir" ] || mkdir -p "$cache_dir"
for url in "$@";
do printf "%s\0" "$url"
done >> "$store_file"