Use clipboard manager with image support
This commit is contained in:
parent
572854dbd0
commit
3bc57b4593
22
scripts/.local/share/scripts/cliphist-rofi-img
Executable file
22
scripts/.local/share/scripts/cliphist-rofi-img
Executable 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"
|
@ -284,7 +284,7 @@ bindsym XF86Favorites exec mpc next
|
||||
# Program keybindings
|
||||
#
|
||||
# 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
|
||||
bindsym Print exec grim
|
||||
# slurp + grim to clipboard
|
||||
@ -326,7 +326,8 @@ output eDP-1 color_profile icc ~/.config/colord/E14-G3.icm
|
||||
# Autostart programs
|
||||
#
|
||||
# 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
|
||||
exec kanshi
|
||||
# easyeffects
|
||||
|
Loading…
x
Reference in New Issue
Block a user