You are not logged in.

#1 2017-03-08 11:15:54

ragamatrix
Member
Registered: 2015-10-04
Posts: 406

draw_bg variation

Hello,
I had an idea to use a convert script to display backgrouds for your conkys for example.
daniel38100 and jpdipsy are the contributors of the code I only had the idea.
syntaxe calling cartouche BG :
~/bin/draw_bg_convert.sh crea_cart "BG" "715x105" "cadre" "red" "0" "blue" "5"
you can read the little how-to in the script.
draw_bg_convert.sh:

#!/bin/bash
#------------------------------------------------------------------------------------------------------#
#inspiration: jpdipsy help-scripting: daniel38100 idea: ragamatrix from forum ubuntu-fr
#Examples how-to
#syntaxe calling cartouche BG :
#~/bin/draw_bg_convert.sh crea_cart "BG" "715x105" "cadre" "red" "0" "blue" "5"
#crea_cart "BG" "715x102" "cadre" "#00000000" "0" "#00000060" "5" #BG without square
#crea_cart "BG" "715x105" "cadre" "silver" "0" "#00000040" "5" #BG with square
#			^name.png  ^size(x-y) ^frame   |    |	|		|		|
#									  color frame   |		|
#											|		|		|
#											thickness frame |
#													|		|
#													color background
#															|
#															corner radius
#------------------------------------------------------------------------------------------------------#													
#You can change the reptemp path by your /pathes/choices you want																												  
if [ ! -z $9 ];then
    reptemp="$9"
elif [ -z $4 ];then
    reptemp=/tmp
elif [ $4 != "cadre" ];then
    reptemp=$4
else
    reptemp=/tmp
fi

echo $reptemp > ~/test.log
case "$1" in
    crea_cart )
        nom="$reptemp/$2.png" ;export image_"$2"="$nom" ;taille="$3";cadre="$4";couleur="$5";bordure="$6";couleurfond="$7";arrondi="$8"
        if [[ $4 = "cadre" ]];then
            # rectangle 1px de moins sur la taille
            L=$(echo $taille|cut -d x -f1);L=$((L - 1))
            H=$(echo $taille|cut -d x -f2);H=$((H - 1))
            convert -size "$taille" xc:none  -fill "$couleurfond" -strokewidth "$bordure" -stroke "$couleur" -draw "roundrectangle 1,1 $L,$H $arrondi,$arrondi" "$nom"
        else
            convert  -size "$taille" xc:none "$nom"
        fi

 ;;
esac

exit

render-examples:
1488971514.png
1488971577.png
1488971608.png
1488971655.png
1488971692.png
1488971722.png
I hope you'll like it enjoy to use it without limit wink

Last edited by ragamatrix (2017-03-08 11:17:28)

Offline

#2 2017-03-09 20:04:45

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: draw_bg variation

^Somehow those picture links do not work for me - is it me, or are they only temporarily unavailable?

Offline

#3 2017-03-09 21:33:35

unklar
Member
Registered: 2015-10-31
Posts: 914

Re: draw_bg variation

^ The image is located in /tmp depending on the size and can be used for the Conky (if you do not change the paths of ragamatrix).  wink

ragatest.th.jpg

Offline

Board footer

Powered by FluxBB