Ignore:
Timestamp:
Jun 9, 2016, 2:45:59 PM (5 years ago)
Author:
daduve
Message:

Adding new propierties to conky server

File:
1 edited

Legend:

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

    r1633 r1892  
    1111CONKYRC_USED=$FILE_PATH/conkyrc_used
    1212
    13 TEXT_COLOUR="black"
     13TEXT_COLOUR="white"
    1414READED=TRUE
    1515
     
    8787MSG_SEMILIGERO_PANEL=$(gettext "Semithin")
    8888MSG_DESKTOP_PANEL=$(gettext "Desktop")
    89 
     89MSG_COLOUR_QUESTION=$(gettext "Do you want to change colour fonts or use default mode?")
     90MSG_BOTON_COLOR_OK=$(gettext "DEFAULT")
     91MSG_BOTON_COLOR_CANCEL=$(gettext "CHANGE")
     92MSG_TIME=$(gettext "TIME")
     93MSG_TIME_DESC=$(gettext "You can show the time with this clock in the desktop")
     94MSG_DATE=$(gettext "DATE")
     95MSG_DATE_DESC=$(gettext "You can show the date in your desktop")
     96MSG_SHADE=$(gettext "TRANSPARENT")
     97MSG_SHADE_DESC=$(gettext "You eliminate the shadow in Conky desktop")
    9098
    9199
     
    228236        SELECTION=`zenity  --title "$MSG_TITLE" --list  --width 850 --height=620 --text "$MSG_TITPARAM" --checklist --column "$MSG_SELECCIONA" --hide-column=2  --column "SELECCIONA" --column "$MSG_PARAMETRO" --column "$MSG_DESCRIPCION" \
    229237                                $READED "USUARIO" "$MSG_USER" "$MSG_USER_DESC" \
     238                                TRUE "HORA" "$MSG_TIME" "$MSG_TIME_DESC" \
     239                                TRUE "DIA" "$MSG_DATE" "$MSG_DATE_DESC" \
    230240                                TRUE "EQUIPO" "$MSG_HOSTNAME" "$MSG_HOSTNAME_DESC" \
    231241                                TRUE "CLIENTE" "$MSG_CLIENT" "$MSG_CLIENT_TYPE" \
     
    238248                                TRUE "CPU_TYPE" "$MSG_CPU_TYPE" "$MSG_CPU_TYPE" \
    239249                                TRUE "CPU_BAR" "$MSG_CPU_BAR" "$MSG_CPU_BAR_DESC" \
    240                                 TRUE "CPU_GRAPH" "$MSG_CPU_GRAPH" "$MSG_CPU_GRAPH_DESC" \
     250                                FALSE "CPU_GRAPH" "$MSG_CPU_GRAPH" "$MSG_CPU_GRAPH_DESC" \
    241251                                TRUE "RAM_USAGE" "$MSG_RAM_USAGE" "$MSG_RAM_USAGE_DESC" \
    242                                 TRUE "RAM_BAR" "$MSG_RAM_BAR" "$MSG_RAM_BAR_DESC" \
     252                                FALSE "RAM_BAR" "$MSG_RAM_BAR" "$MSG_RAM_BAR_DESC" \
    243253                                TRUE "SWAP_USAGE" "$MSG_SWAP_USAGE" "$MSG_SWAP_USAGE_DESC" \
    244                                 TRUE "SWAP_BAR" "$MSG_SWAP_BAR" "$MSG_SWAP_BAR_DESC" \
     254                                FALSE "SWAP_BAR" "$MSG_SWAP_BAR" "$MSG_SWAP_BAR_DESC" \
    245255                                TRUE "IP_ADDRESS" "$MSG_NET_ADDRESS" "$MSG_NET_ADDRESS_DESC" \
    246                                 TRUE "NET_DOWNLOAD" "$MSG_NET_DOWNLOAD" "$MSG_NET_DOWNLOAD_DESC" \
    247                                 TRUE "NET_UPLOAD" "$MSG_NET_UPLOAD" "$MSG_NET_UPLOAD_DESC" \
     256                                FALSE "NET_DOWNLOAD" "$MSG_NET_DOWNLOAD" "$MSG_NET_DOWNLOAD_DESC" \
     257                                FALSE "NET_UPLOAD" "$MSG_NET_UPLOAD" "$MSG_NET_UPLOAD_DESC" \
    248258                                TRUE "HDD_USED" "$MSG_HDD_USED" "$MSG_HDD_USED_DESC" \
     259                                FALSE "SHADE" "$MSG_SHADE" "$MSG_SHADE_DESC" \
    249260                                --separator=":"`
    250261        cancelar $?
     
    335346
    336347function change_colour {
    337         zenity --title "$MSG_TITLE" --question --text "Do you want to change colour fonts or use default mode?" --ok-label=CHANGE --cancel-label=DEFAULT
    338         if [[  $? =  0 ]]; then
     348        zenity --title "$MSG_TITLE" --question --text "$MSG_COLOUR_QUESTION" --ok-label=$MSG_BOTON_COLOR_OK --cancel-label=$MSG_BOTON_COLOR_CANCEL
     349        if [[  $? !=  0 ]]; then
    339350                if [[ $SOY = "CLIENTE" ]]; then
    340351                        text_colour_client
     
    346357                        SELECTION_COLOUR="white"
    347358                else
    348                         SELECTION_COLOUR2="FF8C00"
    349                         SELECTION_COLOUR="black"
     359                        SELECTION_COLOUR2="dodgerblue3"
     360                        SELECTION_COLOUR="white"
    350361                fi
    351362               
     
    369380        #echo "">>$CONKYRC_USED
    370381       
     382       
    371383        ##DETERMINAMOS LOS COLORES DE LAS FUENTES
    372384        echo ' default_color '$SELECTION_COLOUR' ' >> $CONKYRC_USED
    373385        echo 'template0 ${font AvantGardeLTMedium:bold:size=10}${color '$SELECTION_COLOUR2'}\1 ${hr 2}$color${font}${voffset 1}' >>  $CONKYRC_USED
    374386       
     387        #FONDO TRANSPARENTE O NO
     388        if [[ $SELECTION == *SHADE* ]] ; then echo 'own_window_transparent yes' >> $CONKYRC_USED; echo '' >> $CONKYRC_USED; fi
     389       
    375390        ##COMIENZA LA CONFIGURACION
    376391        echo "TEXT" >>  $CONKYRC_USED
     392        if [[ $SELECTION == *HORA* ]] ; then echo '$color${font}${font AvantGardeLTMedium::size=38}$alignc${time %H:%M}$font$color${font AvantGardeLTMedium:size=15}' >> $CONKYRC_USED;fi
     393        if [[ $SELECTION == *DIA* ]] ; then echo '$alignc${time %a}, ${time %d %b %Y}$font$color' >> $CONKYRC_USED; echo '' >> $CONKYRC_USED; fi
    377394               
    378395        ####DATOS INICIALES####
     
    383400        if [[ $SELECTION == *ARQUITECTURA* ]] ; then echo ''$MSG_ARCHITECTURE': ${if_match ${exec grep "x86_64" /tmp/architecture.txt -c}!=0}64 Bits${else}32 Bits${endif}' >> $CONKYRC_USED;fi
    384401        if [[ $SELECTION == *VERSION* ]] ; then echo ''$MSG_VERSION': ${if_existing /usr/share/lliurex-cdd/version}${exec cat /usr/share/lliurex-cdd/version}${endif}' >> $CONKYRC_USED;fi
    385         if [[ $SELECTION == *MIRROR_VERSION* ]] ; then echo '${if_existing /tmp/mirror_version.txt}${if_match ${exec grep "VERSION 32" /tmp/mirror_version.txt -c}!=0}${if_match ${exec grep "VERSION 64" /tmp/mirror_version.txt -c}!=0}${template6}${else}${template5 32}${endif}${else}${if_match ${exec grep "VERSION 64" /tmp/mirror_version.txt -c}!=0}${template5 64}${endif}${endif}${endif}' >> $CONKYRC_USED;fi
    386         if [[ $SELECTION == *HDD_ALERT* ]] ; then echo '${if_match ${fs_used_perc /}>=91}${execi 1000 /usr/share/lliurex-conky/hdd_full}${else}${endif}' >> $CONKYRC_USED;fi   
     402        if [[ $SELECTION == *MIRROR_VERSION* ]] ; then
     403                if  ( rgrep 32 /tmp/mirror.txt ) || ( rgrep 64 /tmp/mirror.txt) ; then
     404                        echo '${if_existing /tmp/mirror_version.txt}${if_match ${exec grep "VERSION 32" /tmp/mirror_version.txt -c}!=0}${if_match ${exec grep "VERSION 64" /tmp/mirror_version.txt -c}!=0}${template9}${else}${template8 32}${endif}${else}${if_match ${exec grep "VERSION 64" /tmp/mirror_version.txt -c}!=0}${template8 64}${endif}${endif}${endif}' >> $CONKYRC_USED
     405                fi
     406        fi
    387407        ####SYSTEMA####
    388         if [[ $SELECTION == *HDD_ALERT* ]] ; then echo "No blank added";else echo "">> $CONKYRC_USED;fi
    389408        if [[ $SELECTION == *KERNEL* ]] || [[ $SELECTION == *UPTIME* ]] ;  then echo '${template0 '$MSG_SYSTEM_PANEL'}' >> $CONKYRC_USED;fi
    390409        if [[ $SELECTION == *KERNEL* ]] ; then echo 'Kernel $alignr $kernel' >> $CONKYRC_USED;fi
    391410        if [[ $SELECTION == *UPTIME* ]] ; then echo ''$MSG_UPTIME_PANEL' $alignr $uptime' >> $CONKYRC_USED;fi
    392411        ####CPU####
    393         if [[ $SELECTION == *CPU* ]] ;  then echo "">> $CONKYRC_USED; echo '${template0 CPU}' >> $CONKYRC_USED;fi
     412        if [[ $SELECTION == *CPU* ]] ;  then echo '${template0 CPU}' >> $CONKYRC_USED;fi
    394413        if [[ $SELECTION == *CPU_TYPE* ]] ; then echo "\${exec cat /proc/cpuinfo | grep 'model name' | cut -c 14-42 | uniq }" >> $CONKYRC_USED;fi
    395414        if [[ $SELECTION == *CPU_BAR* ]] ; then echo '$cpu % ${cpubar}' >> $CONKYRC_USED;fi
    396415        if [[ $SELECTION == *CPU_GRAPH* ]] ; then
    397416                echo '${cpugraph}' >> $CONKYRC_USED;
    398         else
    399                 echo "">> $CONKYRC_USED
    400417        fi
    401418        ####RAM####
    402419        if [[ $SELECTION == *RAM* ]] || [[ $SELECTION == *SWAP* ]] ;  then echo '${template0 RAM}' >> $CONKYRC_USED;fi
    403         if [[ $SELECTION == *RAM_USAGE* ]] ; then echo ''$MSG_RAM_USAGE_PANEL': $mem/$memmax' >> $CONKYRC_USED;fi
    404         if [[ $SELECTION == *RAM_BAR* ]] ; then echo '$memperc% $membar' >> $CONKYRC_USED;fi
    405         if [[ $SELECTION == *SWAP_USAGE* ]] ; then echo ''$MSG_SWAP_USAGE_PANEL':$swap/$swapmax' >> $CONKYRC_USED;fi
    406         if [[ $SELECTION == *SWAP_BAR* ]] ; then echo '$swapperc% ${swapbar}' >> $CONKYRC_USED;fi
     420        if [[ $SELECTION == *RAM_USAGE* ]] ; then echo ''$MSG_RAM_USAGE_PANEL': $memperc% $alignr $memmax' >> $CONKYRC_USED;fi
     421        if [[ $SELECTION == *RAM_BAR* ]] ; then echo '$membar' >> $CONKYRC_USED;fi
     422        if [[ $SELECTION == *SWAP_USAGE* ]] ; then echo ''$MSG_SWAP_USAGE_PANEL': $swapperc% $alignr $swapmax' >> $CONKYRC_USED;fi
     423        if [[ $SELECTION == *SWAP_BAR* ]] ; then echo '${swapbar}' >> $CONKYRC_USED;fi
    407424        ####NETWORK####
    408         if [[ $SELECTION == *IP_ADDRESS* ]] && [[ $SELECTION == *NET_DOWNLOAD* ]] && [[ $SELECTION == *NET_UPLOAD* ]] ;  then echo '${template3 eth0 ETH0}${template3 wlan0 WLAN0}' >> $CONKYRC_USED; echo '${template3 eth1 ETH1}${template3 wlan1 WLAN1}' >> $CONKYRC_USED; echo '${template3 eth2 ETH2}${template3 wlan2 WLAN2}' >> $CONKYRC_USED;
    409         elif [[ $SELECTION == *NET_DOWNLOAD* ]] ;  then echo '${template5 eth0 ETH0}${template5 wlan0 WLAN0}' >> $CONKYRC_USED; echo '${template5 eth1 ETH1}${template5 wlan1 WLAN1}' >> $CONKYRC_USED; echo '${template5 eth2 ETH2}${template5 wlan2 WLAN2}' >> $CONKYRC_USED;
    410         elif [[ $SELECTION == *NET_UPLOAD* ]] ;  then echo '${template6 eth0 ETH0}${template6 wlan0 WLAN0}' >> $CONKYRC_USED; echo '${template6 eth1 ETH1}${template6 wlan1 WLAN1}' >> $CONKYRC_USED; echo '${template6 eth2 ETH2}${template6 wlan2 WLAN2}' >> $CONKYRC_USED;
    411         elif [[ $SELECTION == *IP_ADDRESS* ]] ;  then echo '${template7 eth0 ETH0}${template7 wlan0 WLAN0}' >> $CONKYRC_USED; echo '${template7 eth1 ETH1}${template7 wlan1 WLAN1}' >> $CONKYRC_USED; echo '${template7 eth2 ETH2}${template7 wlan2 WLAN2}' >> $CONKYRC_USED;
     425        if [[ $SELECTION == *IP_ADDRESS* ]] && [[ $SELECTION == *NET_DOWNLOAD* ]] && [[ $SELECTION == *NET_UPLOAD* ]] ;  then
     426                index=0
     427                for i in $( ifconfig | grep 'Ethernet' | awk '{print $1}' );
     428                do
     429                        NET_TITLE=$( echo "$i" | tr '[:lower:]' '[:upper:]' )
     430                        echo '${template3 '$i' '$NET_TITLE'}${template3 wlan'$index' WLAN'$index'}' >> $CONKYRC_USED;
     431                        index=$index+1
     432                done
     433       
     434        elif [[ $SELECTION == *NET_DOWNLOAD* ]] ;  then
     435                index=0
     436                for i in $( ifconfig | grep 'Ethernet' | awk '{print $1}' );
     437                do
     438                        NET_TITLE=$( echo "$i" | tr '[:lower:]' '[:upper:]' )
     439                        echo '${template5 '$i' '$NET_TITLE'}${template5 wlan'$index' WLAN'$index'}' >> $CONKYRC_USED;
     440                        index=$index+1
     441                done
     442               
     443        elif [[ $SELECTION == *NET_UPLOAD* ]] ;  then
     444                index=0
     445                for i in $( ifconfig | grep 'Ethernet' | awk '{print $1}' );
     446                do
     447                        NET_TITLE=$( echo "$i" | tr '[:lower:]' '[:upper:]' )
     448                        echo '${template6 '$i' '$NET_TITLE'}${template6 wlan'$index' WLAN'$index'}' >> $CONKYRC_USED;
     449                        index=$index+1
     450                done
     451        elif [[ $SELECTION == *IP_ADDRESS* ]] ;  then
     452                index=0
     453                for i in $( ifconfig | grep 'Ethernet' | awk '{print $1}' );
     454                do
     455                        NET_TITLE=$( echo "$i" | tr '[:lower:]' '[:upper:]' )
     456                        echo '${template7 '$i' '$NET_TITLE'}${template7 wlan'$index' WLAN'$index'}' >> $CONKYRC_USED;
     457                        index=$index+1
     458                done
    412459        fi
    413460        ####HDD####
    414         if [[ $SELECTION == *HDD* ]] ;  then echo '${template0 '$MSG_HDD_PANEL'}' >> $CONKYRC_USED;fi
    415         if [[ $SELECTION == *CPU_TYPE* ]] ; then echo '${template1 /}' >> $CONKYRC_USED; echo '${if_mounted /net${template1 /net}}$endif' >> $CONKYRC_USED;fi
    416        
    417         #####LINEA QUE ME SIRVE PARA INDICAR QUE FUE MODIFICADO POR EL USUARIO, SE AÑADE AL INICIO DEL FICHERO
     461       
     462        if [[ $SELECTION == *HDD* ]]  &&  [[ $SELECTION == *HDD_ALERT* ]] ; then echo '${template0 '$MSG_HDD_PANEL'}' >> $CONKYRC_USED; echo '${if_mounted /}${template1 /}${if_match ${fs_used_perc /}>=91}${execi 1000 /usr/share/lliurex-conky/hdd_full}${else}${endif}$endif' >> $CONKYRC_USED;  echo '${if_mounted /net}${template1 /net}${if_match ${fs_used_perc /net}>=91}${execi 1000 /usr/share/lliurex-conky/hdd_full_net}${else}${endif}$endif' >> $CONKYRC_USED;fi
     463
     464        if [[ $SELECTION == *HDD* ]]  &&  [[ $SELECTION != *HDD_ALERT* ]] ; then echo '${template0 '$MSG_HDD_PANEL'}' >> $CONKYRC_USED; echo '${if_mounted /}${template1 /}$endif' >> $CONKYRC_USED; echo '${if_mounted /net}${template1 /net}$endif' >> $CONKYRC_USED; fi
     465       
     466        if [[ $SELECTION != *HDD* ]]  &&  [[ $SELECTION == *HDD_ALERT* ]] ; then echo '${if_mounted /}${if_match ${fs_used_perc /}>=91}${execi 1000 /usr/share/lliurex-conky/hdd_full}${else}${endif}$endif' >> $CONKYRC_USED;  echo '${if_mounted /net}${if_match ${fs_used_perc /net}>=91}${execi 1000 /usr/share/lliurex-conky/hdd_full_net}${else}${endif}$endif' >> $CONKYRC_USED;fi
     467        #####LINEA QUE ME SIRVE PARA INDICAR QUE FUE MODIFICADO POR EL USUARIO, SE ANYADE AL INICIO DEL FICHERO
    418468        sed -i '1s/^/#modified_by_user\n/'  $CONKYRC_USED
    419469       
Note: See TracChangeset for help on using the changeset viewer.