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