From b7f55fd7259e54fa86f3b36c6a8266b9d42a42ca Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Wed, 27 Oct 2021 02:39:14 +0200 Subject: [PATCH] speed improvements --- bin/mbxcolors | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/bin/mbxcolors b/bin/mbxcolors index 61b7c5c..8d286e0 100755 --- a/bin/mbxcolors +++ b/bin/mbxcolors @@ -1,8 +1,13 @@ #!/usr/bin/env bash # Copyright (C) Daniel Napora 2021 # Dependencies: jgmenu, xdotool, colorpicker, xdg-utils, xclip +# TODO Built-in palettes read-only pre-generated like HTML colors amd not copied to ~/.../palettes +# TODO self made palettes in ~/.../palettes # TODO notifications when copying to clipboard (imagick needed to create icon) # TODO check for other color-tools like gpick,gcolor2 and add launchers to menu +# TODO export to .gpl (GIMP,Inkscape) +# TODO use xcolor as picker +# TODO quicly remove colors from picked (with sed) ME=${0##*/} @@ -105,9 +110,10 @@ palettes() { out2+=("^sep(${pal^})") while read -r color name; do - name=$(printf "%22s %s\n" "$name") - fg=$(fgcolor $color) - out2+=(" $color$name ,$ME getcolorcode '$color' '$file',,,#${palette}") + #name=$(printf "%22s %s\n" "$name") + #fg=$(fgcolor $color) + #out2+=(" $color$name ,$ME getcolorcode '$color' '$file',,,#${palette}") + out2+=("$color ,$ME getcolorcode '$color' '$file',,,#${palette}") done < "$file" out2+=("^sep()") out2+=("Add color... (colorpicker),$ME pickcolor '$file'") @@ -284,18 +290,24 @@ case "$expose" in palette=${filename%.*} out+=("^sep(Last used palette ${palette^})") while read -r color name;do - name=$(printf "%22s %s\n" "$name") - fg=$(fgcolor $color) - out+=(" $color$name,$ME getcolorcode '$color'") + #name=$(printf "%22s %s\n" "$name") + #fg=$(fgcolor $color) + #out+=(" $color$name,$ME getcolorcode '$color'") + out+=("$color ,$ME getcolorcode '$color'") done < "${pal}" ;; picked|*) out+=("^sep(Recently picked colors:)") while read -r color name;do - name=$(printf "%22s %s\n" "$name") - fg=$(fgcolor $color) - out+=(" $color$name,$ME getcolorcode '$color'") + # name=$(printf "%22s %s\n" "$name") + # fg=$(fgcolor $color) + # out+=(" $color$name,$ME getcolorcode '$color'") + out+=("$color ,$ME getcolorcode '$color'") done < <(grep ^# $RECENT) + + + + out+=("^sep()") out+=("New palette from recently picked,$ME recent2palette;$ME")