more config files

This commit is contained in:
Cy Pokhrel 2024-10-22 11:53:19 -04:00
parent 1b28ec5ec1
commit 1a25393183
No known key found for this signature in database
GPG key ID: 1200FBE36C2ADE2E
22 changed files with 3628 additions and 1 deletions

View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
tmp_dir="/tmp/cliphist"
rm -rf "$tmp_dir"
if [[ -n "$1" ]]; then
cliphist decode <<<"$1" | wl-copy
exit
fi
mkdir -p "$tmp_dir"
read -r -d '' prog <<EOF
/^[0-9]+\s<meta http-equiv=/ { next }
match(\$0, /^([0-9]+)\s(\[\[\s)?binary.*(jpg|jpeg|png|bmp)/, grp) {
system("echo " grp[1] "\\\\\t | cliphist decode >$tmp_dir/"grp[1]"."grp[3])
print \$0"\0icon\x1f$tmp_dir/"grp[1]"."grp[3]
next
}
1
EOF
cliphist list | gawk "$prog"