#!/bin/bash # # mbclr current polecenie funkcja argument backprg [config_file] # mbclr main () { #read WALLPAPER<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) WALLPALDIR="$HOME/.config/mbxcolors/palettes/wallp" mkdir -p "$WALLPALDIR" read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) WALLPAPER=${WALLPATH##*/} if [ ! -f "$WALLPALDIR/$WALLPAPER.clr" ]; then convert ${WALLPATH} -resize 25% -colors 16 -unique-colors txt:- |grep -v '^#'| awk '{print $3}' |pastel sort-by brightness |pastel format hex > "$WALLPALDIR/$WALLPAPER.clr" fi mapfile -t wallcolors < "$WALLPALDIR/$WALLPAPER.clr" dark=("#000000" "#111111" "#222222" "#333333" "#444444" "#555555" "#666666") light=("#FFFFFF" "#EEEEEE" "#DDDDDD" "#CCCCCC" "#BBBBBB" "#AAAAAA" "#999999") yt=("#181818" "#212121" "#3d3d3d" "#FFFFFF" "#AAAAAA") plasma=("#e93a9a" "#e93d58" "#e9643a" "#e8cb2d" "#3dd425" "#00d3b8" "#3daee9" "#b875dc" "#926ee4" "#686b6f",) #ubuntu ubuntu=("#E95420" "#18b0b0" "#3584e4" "#0e8420" "#c748ba" "#77216f" "#c7162b" "#f4a100") #linuxmint mint+=("#6cabcd" "#5b73c4" "#aa876a" "#9d9d9d" "#db9d61" "#c76199" "#8c6ec9" "#c15b58" "#c8ac69" "#5aaa9a") w8+=("#a4c400" "#60a917" "#008a00" "#00aba9" "#1ba1e2" "#3e65ff" "#0050ef" "#6a00ff" "#aa00ff" "#f472d0" "#d80073" "#a20025" "#e51400" "#fa6800" "#f0a30a" "#e3c800" "#825a2c" "#6d8764" "#647687" "#76608a" "#87794e" "#a0522d") #for i in $(theme.sh -p |cut -d':' -f2) #do #colors+=("$i") #done out+=("^sep($4)") if [[ "$2" == "jgctl" ]]; then . $HOME/.config/mabox/mabox.conf case "$jgmenu_theme" in obtheme) OBTHEME=$(awk '// {while (getline n) {if (match(n, //)) {l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$HOME/.config/openbox/rc.xml"); THEMERC="$HOME/.config/mabox/jgobthemes/${OBTHEME}.colorrc";; *) THEMERC="$HOME/.config/mabox/jgobthemes/${jgmenu_theme}.colorrc";; esac read COLOR OP<<< $(grep "${3}" ${THEMERC} | cut -d'=' -f2) out+=("^sep(OPACITY)") out+=("OPACITY [ $OP ],^checkout(opacity)") out2+=("^tag(opacity)") out2+=("^sep(OPACITY [ $OP ]") out2+=("100 ,jgctl $3 100;${5}") out2+=(" 95 ,jgctl $3 95 ;${5}") out2+=(" 90 ,jgctl $3 90 ;${5}") out2+=(" 80 ,jgctl $3 80 ;${5}") out2+=(" 70 ,jgctl $3 70 ;${5}") out2+=(" 60 ,jgctl $3 60 ;${5}") out2+=(" 50 ,jgctl $3 50 ;${5}") out2+=(" 40 ,jgctl $3 40 ;${5}") out2+=(" 30 ,jgctl $3 30 ;${5}") out2+=(" 20 ,jgctl $3 20 ;${5}") out2+=(" 10 ,jgctl $3 10 ;${5}") out2+=(" 5 ,jgctl $3 5 ;${5}") out2+=(" 0 ,jgctl $3 0 ;${5}") fi #Current out+=("^sep(SELECT_COLOR)") out+=(" Select or pick from screen,mbclr pick $2 $3 ${5}") out+=("^sep()") out+=(" shades of current,^checkout(curshades)") out+=("^sep(Wallpaper colors)") for i in "${wallcolors[@]}" do out+=("$i ,$2 $3 '${i}' ${6};${5}") done out+=("^sep(ACCENT COLORS)") out+=("Ubuntu,^checkout(ubuntu)") out2+=("^tag(ubuntu)" "^sep(Ubuntu)") for i in ${ubuntu[@]};do out2+=("$i ,$2 $3 '${i}' ${6};${5}");done out+=("Mint,^checkout(mint)") out2+=("^tag(mint)" "^sep(Mint)") for i in ${mint[@]};do out2+=("$i ,$2 $3 '${i}' ${6};${5}");done out+=("Plasma,^checkout(plasma)") out2+=("^tag(plasma)" "^sep(Plasma)") for i in ${plasma[@]};do out2+=("$i ,$2 $3 '${i}' ${6};${5}");done out+=("W8,^checkout(w8)") out2+=("^tag(w8)" "^sep(W8)") for i in ${w8[@]};do out2+=("$i ,$2 $3 '${i}' ${6};${5}");done out+=("^sep()") out+=(" Light colors..,^checkout(light)") out2+=("^tag(light)") out2+=("^sep(LIGHT)") for i in "${light[@]}" do out2+=("$i ,$2 $3 '${i}' ${6};${5}") done out+=("^sep()") out+=(" Dark colors..,^checkout(dark)") out2+=("^tag(dark)") out2+=("^sep(DARK)") for i in "${dark[@]}" do out2+=("$i ,$2 $3 '${i}' ${6};${5}") done out+=("^sep()") out+=(" YT colors..,^checkout(yt)") out2+=("^tag(yt)") out2+=("^sep(yt)") for i in "${yt[@]}" do out2+=("$i ,$2 $3 '${i}' ${6};${5}") done #Shades out2+=("^tag(curshades)") out2+=("^sep(Shades of $1)") for i in 3 25 2 15 1 05; do clr=$(pastel lighten 0.$i "${1}" | pastel format hex) if [ "${clr}" != "#ffffff" ];then out2+=("$clr ,$2 $3 '${clr}' ${6};${5}") fi done out2+=("^sep()") out2+=("$1 ,$2 $3 '${1}' ${6};${5}") out2+=("^sep()") for i in 05 1 15 2 25 3; do clr=$(pastel darken 0.$i "${1}" | pastel format hex) if [ "${clr}" != "#000000" ];then out2+=("$clr ,$2 $3 '${clr}' ${6};${5}") fi done printf '%s\n' "${out[@]}" printf '%s\n' "${out2[@]}" } pickcolor () { color=$(gcolor3 2>/dev/null) if [ "$color" ]; then mycmd=("$1 $2 '${color}';${3} -s") fi eval "${mycmd[@]}" #notify-send.sh "Qpa $1" "${mycmd[@]}" } case "$1" in pick) pickcolor "$2" "${3}" "${5}";; *) main "$@" ;; esac