use xcolor as picker, added delete color option
parent
b7f55fd725
commit
c332f0f21e
|
@ -6,8 +6,7 @@
|
|||
# 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)
|
||||
# DONE quicly remove colors from picked (with sed)
|
||||
|
||||
|
||||
ME=${0##*/}
|
||||
|
@ -59,7 +58,12 @@ hex2rgba() {
|
|||
echo "rgba($r, $g, $b, 1.0)"
|
||||
}
|
||||
pickcolor() {
|
||||
color=$(colorpicker --short --one-shot --preview)
|
||||
#color=$(colorpicker --short --one-shot --preview)
|
||||
#color=$(xcolor --preview-size "${preview-size:-255}" --scale "${scale:-8}")
|
||||
size=${xcolor_preview_size:-255}
|
||||
scale=${xcolor_scale:-8}
|
||||
command="xcolor --preview-size ${size} --scale ${scale}"
|
||||
color="$(${command})"
|
||||
echo "$color " > "$RECENT".tmp
|
||||
# add on top deduplicate
|
||||
awk '!x[$0]++' "$RECENT" >> "$RECENT".tmp
|
||||
|
@ -175,9 +179,9 @@ position() {
|
|||
mkconfigfile() {
|
||||
if [[ -f /usr/share/mbxtools/configure.inc ]];then
|
||||
. /usr/share/mbxtools/configure.inc
|
||||
#elif [[ -f /usr/share/mb-jgtools/pipemenu-standalone.cfg ]];then
|
||||
#. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
#. $HOME/.config/mabox/mabox.conf
|
||||
elif [[ -f /usr/share/mb-jgtools/pipemenu-standalone.cfg ]];then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
else
|
||||
MENU_ITEMS=$(mktemp)
|
||||
CONFIG_FILE=$(mktemp)
|
||||
|
@ -298,20 +302,28 @@ case "$expose" in
|
|||
;;
|
||||
picked|*)
|
||||
out+=("^sep(<i><small>Recently picked colors:</small></i>)")
|
||||
# for clear/delete
|
||||
out2+=("^tag(pickeddel)")
|
||||
out2+=("^sep(Clear All)")
|
||||
out2+=("<b>Clear</b> all,echo > $RECENT;$ME")
|
||||
out2+=("^sep(Just remove one color...)")
|
||||
while read -r color name;do
|
||||
# name=$(printf "%22s %s\n" "$name")
|
||||
# fg=$(fgcolor $color)
|
||||
# out+=("<tt><span bgcolor='$color' fgcolor='$fg'><sub> </sub>$color<sup>$name</sup></span></tt>,$ME getcolorcode '$color'")
|
||||
out+=("<tt><small>$color</small> <span bgcolor='$color'><sub> </sub> <sup> </sup></span></tt> ,$ME getcolorcode '$color'")
|
||||
out2+=("<tt><small>$color</small> <span bgcolor='$color'><sub> </sub> <sup> </sup></span></tt> ,sed -i '/${color:1:6}/d' $RECENT;$ME")
|
||||
#echo "<tt><small>$color</small> <span bgcolor='$color'><sub> </sub> <sup> </sup></span></tt> ,sed '/${color:1:6}/d' $RECENT;$ME"
|
||||
done < <(grep ^# $RECENT)
|
||||
|
||||
|
||||
|
||||
|
||||
out+=("^sep()")
|
||||
|
||||
out+=("<b>New palette</b> from recently picked,$ME recent2palette;$ME")
|
||||
out+=("<b>Clear</b> recently picked,echo > $RECENT;$ME")
|
||||
#out+=("<b>Clear</b> recently picked,echo > $RECENT;$ME")
|
||||
out+=("<b>Clear</b> recently picked,^checkout(pickeddel)")
|
||||
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -350,7 +362,7 @@ out2+=("<tt>$(printf "%-20s %20s" "Built-in palettes:" "[<b>$builtin_palettes</b
|
|||
out2+=("^sep()")
|
||||
out2+=("<tt>$(printf "%-20s %20s" "Position:" "[<b>$position</b>]")</tt>,^checkout(position)")
|
||||
out2+=("^sep()")
|
||||
out2+=("Reset to defaults,rm $CNF_FILE,$ME")
|
||||
out2+=("Reset to defaults,rm $CNF_FILE;$ME")
|
||||
out2+=("^sep()")
|
||||
out2+=("Edit config file,xdg-open $CNF_FILE")
|
||||
out2+=("Open config directory,xdg-open $CNF_DIR")
|
||||
|
|
Loading…
Reference in New Issue