Use clipboard manager with image support

This commit is contained in:
coolneng 2025-10-04 19:24:15 +02:00
parent 572854dbd0
commit 3bc57b4593
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 25 additions and 2 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"

View File

@ -284,7 +284,7 @@ bindsym XF86Favorites exec mpc next
# Program keybindings # Program keybindings
# #
# clipman # clipman
bindsym $mod+c exec clipman pick -t rofi --max-items=50 bindsym $mod+c exec rofi -modi clipboard:~/.local/share/scripts/cliphist-rofi-img -show clipboard -show-icons
# grim # grim
bindsym Print exec grim bindsym Print exec grim
# slurp + grim to clipboard # slurp + grim to clipboard
@ -326,7 +326,8 @@ output eDP-1 color_profile icc ~/.config/colord/E14-G3.icm
# Autostart programs # Autostart programs
# #
# clipman # clipman
exec wl-paste -t text --watch clipman store --max-items=50 exec wl-paste -t text --watch cliphist store
exec wl-paste -t image --watch cliphist store
# kanshi # kanshi
exec kanshi exec kanshi
# easyeffects # easyeffects