fixed clipboard history menu copying the preview excerpt instead of the full entry
This commit is contained in:
@@ -4,15 +4,15 @@ pkgs.writeShellScriptBin "toolbelt" ''
|
|||||||
hostname=$(cat /etc/hostname)
|
hostname=$(cat /etc/hostname)
|
||||||
|
|
||||||
cliphistory() {
|
cliphistory() {
|
||||||
cliphist list | fzf --preview="
|
selection=$(cliphist list | fzf --preview="
|
||||||
index=\$(echo {} | awk '{print \$1}'); \
|
index=\$(echo {} | awk '{print \$1}'); \
|
||||||
mime=\$(cliphist decode \$index | file -i -); \
|
mime=\$(cliphist decode \$index | file -i -); \
|
||||||
if echo \"\$mime\" | grep -q 'image'; then \
|
if echo \"\$mime\" | grep -q 'image'; then \
|
||||||
echo \$(cliphist list | rg \"^\$index\" | cut -d ' ' -f 2- | fmt -w 30); \
|
echo \$(cliphist list | rg \"^\$index\" | cut -d ' ' -f 2- | fmt -w 30); \
|
||||||
else \
|
else \
|
||||||
cliphist decode \"\$index\" | fmt -w 30; \
|
cliphist decode \"\$index\" | fmt -w 30; \
|
||||||
fi
|
fi" --prompt="> " | awk '{print $1}')
|
||||||
" --prompt="> " | wl-copy
|
cliphist decode "$selection" | wl-copy
|
||||||
}
|
}
|
||||||
btop_cmd() {
|
btop_cmd() {
|
||||||
if [ "$hostname" = 'oganesson' ]; then
|
if [ "$hostname" = 'oganesson' ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user