Add clipbook

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-02-13 13:41:03 +00:00
parent 97a042adcd
commit c907cdeca6
11 changed files with 203 additions and 31 deletions

View File

@@ -0,0 +1,23 @@
list() {
echo -en "\0keep-selection\x1ftrue\n"
jq -r 'keys[]' "$BOOKMARKS"
}
handle() {
key="$1"
data=$(jq -r --arg key "$key" '.[$key]' "$BOOKMARKS")
type=$(echo "$data" | jq -r '.type')
content=$(echo "$data" | jq -r '.content')
if [[ "$type" == "file" ]]; then
wl-copy < "$content"
elif [[ "$type" == "text" ]]; then
echo -n "$content" | wl-copy
fi
}
case ${ROFI_RETV} in
0) list ;;
1) handle "$@" ;;
esac