copy by default, readme update

This commit is contained in:
Daniel Napora 2021-10-29 12:57:41 +02:00
parent 791be778ff
commit 80c59cba74
2 changed files with 6 additions and 6 deletions

View File

@ -10,6 +10,7 @@ A menu to quickly pick, paste and organize colors (palettes)
- gcolor3
- xdg-utils
- xclip
- notify-send or better notify-send.sh
## Installation

View File

@ -1,11 +1,10 @@
#!/usr/bin/env bash
# Copyright (C) Daniel Napora 2021 <napcok@gmail.com>
# Dependencies: jgmenu, xdotool, xcolor, gcolor3, xdg-utils, xclip
# TODO do not copy not needed files to ~./config/$ME
# Dependencies: jgmenu, xdotool, xcolor, gcolor3, xdg-utils, xclip, notify-send
# TODO Imagick colors - separate menu big around 700 named colors
# TODO export to .gpl (GIMP,Inkscape)
VERSION="0.2.2"
VERSION="0.2.3"
TEMP_DIR=/tmp/colormenu
ME=${0##*/}
@ -15,13 +14,13 @@ CNF_FILE="$CNF_DIR/mbxcolors.cfg"
RECENT="$CNF_DIR/recent.clr"
USED="$CNF_DIR/.used"
LASTPAL="$CNF_DIR/.palette"
[ ! -d "$CNF_DIR" ] && mkdir -p "$CNF_DIR" #&& cp -r /usr/share/mbxcolors/* "$CNF_DIR"/
[ ! -d "$CNF_DIR" ] && mkdir -p "$CNF_DIR"
if [ ! -f $CNF_FILE ]; then
cat <<EOF > ${CNF_FILE}
# Paste mode: hex,rgb or rgba
format=hex
#Action when color is clicked: paste (imadietely) or copy (to clipboard)
action=paste
action=copy
#What thing to expose on top of main menu: recently picked colors, last used colors or last used palette
expose=picked
#Show HTML colors? yes|no
@ -124,7 +123,7 @@ getcolorcode() {
mkdir -p $TEMP_DIR
FNAME="$TEMP_DIR/${1:1:6}.png"
convert -size 100x100 xc:"$1" "$FNAME"
notify-send ColorMenu "$clr" --icon="$FNAME" --expire-time=10000
notify-send ColorMenu "$clr" --icon="$FNAME" --expire-time=120000
fi
echo "$1" > "$USED".tmp
# add on top and deduplicate