Changeset 1611


Ignore:
Timestamp:
May 20, 2016, 11:53:01 AM (3 years ago)
Author:
daduve
Message:

Upated color selection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lliurex-conky/trunk/fuentes/lliurex-conky.install-files/usr/share/lliurex-conky/conkyrc_gui

    r1598 r1611  
    2121MSG_INICIAL=$(gettext "Do you want conky on desktop?")
    2222MSG_CONFIGURATOR=$(gettext "CONKY CONFIGUTATOR. SELECT THE FORMAT THAT YOU LIKE")
    23 MSG_SELECT_COLOUR=$(gettext "SELECT YOUR FAVOURITE COLOUR FOR YOUR INFO CONKY TEXT")
    24 MSG_SELECT_COLOUR2=$(gettext "SELECT YOUR FAVOURITE COLOUR FOR YOUR TITLE CONKY TEXT")
     23MSG_SELECT_COLOUR=$(gettext "<b><big>INFO </big></b>CONKY TEXT: <small>Select your favourite colour or personalice it</small>")
     24MSG_SELECT_COLOUR2=$(gettext "<b><big>TITLE </big></b>CONKY TEXT: <small>Select you favourite colour or personalice it</small>")
    2525MSG_SELECT_COLOUR_PREDEF=$(gettext "SELECT ONE COLOUR")
    26 MSG_SELECT_COLOUR_PERSONAL=$(gettext "ENTER YOU FAVOURITE COLOUR FOR INFO TEXT IN HEX MODE")
    27 MSG_SELECT_COLOUR_PERSONAL2=$(gettext "ENTER YOU FAVOURITE COLOUR FOR TITLE TEXT IN HEX MODE")
     26MSG_SELECT_COLOUR_PERSONAL=$(gettext "Select your favourite colour for the: TITLES")
     27MSG_SELECT_COLOUR_PERSONAL2=$(gettext "Select your favourite colour for the: INFO ")
    2828MSG_SELECCIONA=$(gettext "SELECT")
    2929MSG_ESTILO=$(gettext "STYLE")
     
    184184##QUEREMOS CONKY VISIBLE O NO##
    185185function avaiable (){
    186         zenity --title "$MSG_TITLE" --question --text "$MSG_INICIAL
     186        zenity --title "$MSG_TITLE" --question --text "<b>$MSG_INICIAL</b>
    187187        cancelar $?
    188188}
     
    267267        #SE QUIERE COLOR PERSONALIZADO
    268268        if [[  $? -eq  1 ]]; then
    269                 SELECTION_COLOUR=`zenity  --title "$MSG_TITLE" --entry --width 200 --height=130 --text "$MSG_SELECT_COLOUR_PERSONAL" `
     269                SELECTION_COLOUR=`zenity --title "$MSG_SELECT_COLOUR_PERSONAL2" --color-selection --show-palette `
    270270                cancelar $?
    271         fi
    272 }
     271                COL1=$( echo "$SELECTION_COLOUR" | cut -d "," -f1 | cut -d "(" -f2 )
     272                COL2=$( echo "$SELECTION_COLOUR" | cut -d "," -f2 )
     273                COL3=$( echo "$SELECTION_COLOUR" | cut -d "," -f3 | cut -d ")" -f2 )
     274                SELECTION_COLOUR=$( hexcolor COL1 COL2 COL3 )
     275                SELECTION_COLOUR=$( echo "$SELECTION_COLOUR" | cut -d "#" -f2 )
     276        fi
     277}
     278
     279##funcion para pasar a hexadecimal el rgb
     280function hexcolor() {
     281    local a b c=({0..9} {a..f}) d=\#
     282    for b ;do
     283        for a in / % ;do
     284            d+=${c[$b$a 0x10]}
     285        done
     286    done
     287    echo $d
     288}
     289
    273290
    274291function text_colour_server {
    275292
    276         SELECTION_COLOUR=`zenity  --title "$MSG_TITLE" --list  --width 400 --height=300 --text "$MSG_SELECT_COLOUR" --radiolist  --column "$MSG_SELECCIONA" --hide-column=2 --column "SELECCIONA" --column "$MSG_SELECT_COLOUR_PREDEF" --cancel-label="PERSONAL COLOUR"\
     293        SELECTION_COLOUR2=`zenity  --title "$MSG_TITLE" --list  --width 400 --height=300 --text "$MSG_SELECT_COLOUR2" --radiolist  --column "$MSG_SELECCIONA" --hide-column=2 --column "SELECCIONA" --column "$MSG_SELECT_COLOUR_PREDEF" --cancel-label="PERSONAL COLOUR"\
    277294                                        TRUE "BLACK" "black" \
    278295                                        FALSE "WHITE" "white" \
     
    285302        #SE QUIERE COLOR PERSONALIZADO
    286303        if [[  $? -eq  1 ]]; then
    287                 SELECTION_COLOUR=`zenity --title "$MSG_TITLE" --entry --width 200 --height=130 --text "$MSG_SELECT_COLOUR_PERSONAL" `
     304                SELECTION_COLOUR2=`zenity --title "$MSG_SELECT_COLOUR_PERSONAL" --color-selection --show-palette `
    288305                cancelar $?
     306                COL1=$( echo "$SELECTION_COLOUR2" | cut -d "," -f1 | cut -d "(" -f2 )
     307                COL2=$( echo "$SELECTION_COLOUR2" | cut -d "," -f2 )
     308                COL3=$( echo "$SELECTION_COLOUR2" | cut -d "," -f3 | cut -d ")" -f2 )
     309                SELECTION_COLOUR2=$( hexcolor COL1 COL2 COL3 )
     310                SELECTION_COLOUR2=$( echo "$SELECTION_COLOUR2" | cut -d "#" -f2 )
    289311        fi
    290312               
    291313       
    292         SELECTION_COLOUR2=`zenity --title "$MSG_TITLE" --list  --width 400 --height=300 --text "$MSG_SELECT_COLOUR2" --radiolist  --column "$MSG_SELECCIONA" --hide-column=2 --column "SELECCIONA" --column "$MSG_SELECT_COLOUR_PREDEF"   --cancel-label="PERSONAL COLOUR"\
     314        SELECTION_COLOUR=`zenity --title "$MSG_TITLE" --list  --width 400 --height=300 --text "$MSG_SELECT_COLOUR" --radiolist  --column "$MSG_SELECCIONA" --hide-column=2 --column "SELECCIONA" --column "$MSG_SELECT_COLOUR_PREDEF"   --cancel-label="PERSONAL COLOUR"\
    293315                                        TRUE "BLACK" "black" \
    294316                                        FALSE "WHITE" "white" \
     
    301323        #SE QUIERE COLOR PERSONALIZADO
    302324        if [[  $? -eq  1 ]]; then
    303                 SELECTION_COLOUR2=`zenity --title "$MSG_TITLE" --entry --width 200 --height=130 --text "$MSG_SELECT_COLOUR_PERSONAL2" `
     325                SELECTION_COLOUR=`zenity --title "$MSG_SELECT_COLOUR_PERSONAL2" --color-selection --show-palette `
    304326                cancelar $?
     327                COL1=$( echo "$SELECTION_COLOUR" | cut -d "," -f1 | cut -d "(" -f2 )
     328                COL2=$( echo "$SELECTION_COLOUR" | cut -d "," -f2 )
     329                COL3=$( echo "$SELECTION_COLOUR" | cut -d "," -f3 | cut -d ")" -f2 )
     330                SELECTION_COLOUR=$( hexcolor COL1 COL2 COL3 )
     331                SELECTION_COLOUR=$( echo "$SELECTION_COLOUR" | cut -d "#" -f2 )
     332               
    305333        fi
    306334}
Note: See TracChangeset for help on using the changeset viewer.