Page 1671 of 2348 FirstFirst ... 6711171157116211661166916701671167216731681172117712171 ... LastLast
Results 16,701 to 16,710 of 23480

Thread: Post your .conkyrc files w/ screenshots

  1. #16701
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by degan View Post
    Hi boys, don't succeed in understanding because it doesn't work me this scrpt in conky...

    Code:
    ${execp /home/deegan/.scripts/clock.php}
    clock.php
    Code:
    #!/usr/bin/php
    <?php
    
    /*    // TEST
    $year    = 1989;
    $month    = 1;
    $day    = 12;
    $hour    = 18;
    $min    = 24;
    /*/    // REAL
    $year    = date('Y');
    $month    = date('n');
    $day    = date('j');
    $hour    = date('H');
    $min    = date('i');
    //*/
    
    //var_dump($argv);
    
    if (isset($argv[1]))
    {
        switch ($argv[1])
        {        
            case 'simplecal':
            case 'simplecalendar':
            case 'simpledate':
                echo simplecalendar($year, $month, $day);
            break;
            
            case 'cal':
            case 'calendar':
            case 'date':
                echo calendar($year, $month, $day);
            break;
            
            case 'simpleclock':
            case 'simpletime':
                echo simpleclock($hour, $min);
            break;
            
            case 'verysimpleclock':
            case 'verysimpletime':
                echo verysimpleclock($hour, $min);
            break;
            
            case 'clock':
            case 'time':
            default:
                echo clock($hour, $min);
            break;
        }
    }
    
    
    //* HERE BE FUNCTIONS !! *//
    
    function calendar($year, $month, $day)
    {
        $nl            = "\n";
        $font        = '${font Kates}';
        $pref        = '${alignr}';
        $offset        = ' ';
        $_offset    = '.';
        $_pref        = '${color1}';
        $_suff        = '${color}';
        $daysinmonth= (int) date('t', mktime(0, 0, 0, $month, $day, $year));
        
        $diff = abs($day - $month);
        if ($day >= 12)
        {    
            $startday    = $diff < 0 ? $diff : 0;
            $startmonth    = $diff < 0 ? 0 : $diff;
        }
        else
        {
            $startday    = $diff < 0 ? 0 : $diff;
            $startmonth    = $diff < 0 ? $diff : 0;    
        }
        $endmonth    = $startmonth + 12;
        $endday        = $startday + $daysinmonth;
        $CURDATE = "{$_pref}{$year}{$_offset}" . f($month) . $_offset . f($day) . $_suff;
        $M = 1;
        $D = 1;
        $OUT = $font;
        for ($i = 1; $i < $daysinmonth + 12; $i++)
        {
            $OUT .= $pref;
            if ($i > $startmonth && $i <= $endmonth)
            {
                if ($i == $month + $startmonth) $OUT .= $CURDATE;
                else $OUT .= f($M) . $offset;
                $M++;
            } 
            else $OUT .= '  ' . $offset;
            if ($i > $startday && $i <= $endday)
            {
                if ($i == $day + $startday) $OUT .= $nl;
                else $OUT .= f($D) . $nl;
                $D++;        
            } 
             else $OUT .= '  ' . $nl;
        }
        return $OUT;
    }
    
    function simplecalendar($year, $month, $day)
    {
        $nl = "\n";
        $font = '${font Kates}';
        $pref = '${alignr}';
        $_pref = '${alignr}${color1}';
        $suf = $nl;
        $_suf = ' ${color}' . $nl;
        $OUT = $font;
        ##Year
        $OUT .= $_pref . $year . $suf;
        $OUT .= $nl;
        ##Month
        for ($m = 1; $m <= 12; $m++)
        {
            if ($m < 10) $m = "0$m";
            $OUT .= ($m == $month) ? $_pref . $m . $_suf : $pref . $m . $suf;
        }
        $OUT .= $nl;
        ##Day
        for ($d = 1, $x = date('t'); $d <= $x; $d++)
        {
            if ($d < 10) $d = "0$d";
            $OUT .= ($d == $day) ? $_pref .  $d . $_suf : $pref . $d . $suf;
        }
        #Output
        return $OUT;
    }
    
    function clock($hour, $min)
    {
        $space     = 0;
        $_space    = 2;
        $font    = '${voffset 10}${font Kates}';
        $pref    = '${offset ' . $space . '}';
        $_pref    = '${voffset -7}${offset ' . $_space . '}${color1}';
        $suf    = '';
        $_suf    = '${color}${voffset 7}${offset ' . $_space . '}';
        $offset    = $min - $hour;
        if ($offset == 0)
        {
            $minspaces = '';
            $hourspaces = '';
        }
        elseif ($offset < 0) 
        {
            $minspaces = str_repeat("  $pref", abs($offset));
            $hourspaces = '';
        } 
        else 
        {
            $minspaces = '';
            $hourspaces = str_repeat("  $pref", abs($offset));
        }
        $hr = $hourspaces;
        for ($h = 0; $h < 24; $h++) $hr .= ($h == $hour) ? $_pref . f($h) . $_suf : $pref . f($h) . $suf;
        
        $mr = $minspaces;
        for ($m = 0; $m < 60; $m++) $mr .= ($m == $min) ? $_pref . f($m) . $_suf : $pref . f($m) . $suf;
        
        $OUT = $font . $hr . "\n" . '' . $mr;
        return $OUT;
    }
    
    function simpleclock($hour, $min)
    {
        $font   = "\n" . '${font Kates}';
        $pref   = '${offset 1}';
        $_pref  = '${voffset -7}${offset 1}${color1}';
        $suf    = '';
        $_suf   = '${color}${voffset 7}';
        $OUT = $font;
        for ($h = 0; $h < 24; $h++) $OUT .= ($h == $hour) ? $_pref . f($h) . $_suf : $pref . f($h) . $suf;
        $OUT .= ' ';
        for ($m = 0; $m < 60; $m++) $OUT .= ($m == $min) ? $_pref . f($m) . $_suf : $pref . f($m) . $suf;
        #Output
        return $OUT;    
    }
    
    function verysimpleclock($hour, $min) { return '${voffset -30}${font Arial Black:size=60}' . f($hour) . ':' . f($min) . '${font}${voffset -45}'; }
    
    function f($v) { return ($v < 10 ? "0$v" : $v); }
    The terminal doesn't give me any error, but the conky doesn't give me any image...

    Code:
    CruncBang Stantler10 ~»» conky -c .conkyrc5
    Conky: desktop window (111) is root window
    Conky: window type - override
    Conky: drawing to created window (0x2800001)
    Conky: drawing to double buffer
    just out of interest, what is this script supposed to do and look like?

  2. #16702
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    @bfmetcalf you probably want to edit your previous post and remove the screenshot , you have your ip addresses still showing

    edit the pic and blur those out

    and use code boxes instead of quote boxes so that your post isn't soooooooo long

  3. #16703
    Join Date
    Sep 2008
    Location
    Italy Varese..
    Beans
    8
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Post your .conkyrc files w/ screenshots

    #mrpeachy

    if I don't remember badly you/he/she should show both the calendar and the clock.

  4. #16704
    Join Date
    Aug 2010
    Location
    Arizona USA
    Beans
    3,001
    Distro
    Ubuntu Development Release

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by BoredOutOfMyMind View Post
    Do you need help making a Font Archive?

    Yes!

    Are you volunteering
    Intel ® P4 Extreme Edition 3.4 (Gallatin) || DFI ® LanParty PRO875B rev B1
    Crucial ® Ballistix Tracer PC4000 1GB || Mountain Mods U2-UFO Opti-1203
    XFX 7600GT 560M AGP (PV-T73A-UDF3) || Corsair HX520W Modular PSU

  5. #16705
    Join Date
    Feb 2011
    Location
    Under that huge rock
    Beans
    98

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by ddnev45 View Post
    It looks like your / and /home are not separate partitions (as opposed to folders). In a terminal, what is the output of:

    Code:
    df -h
    Code:
    metcalf@metcalf:~$ df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/sda1             220G   14G  195G   7% /
    none                  1.9G  312K  1.9G   1% /dev
    none                  1.9G  264K  1.9G   1% /dev/shm
    none                  1.9G  140K  1.9G   1% /var/run
    none                  1.9G     0  1.9G   0% /var/lock
    /home/metcalf/.Private
                          220G   14G  195G   7% /home/metcalf
    /dev/sdb1             466G  177G  290G  38% /media/BRIANS BOOK

  6. #16706
    Join Date
    Feb 2011
    Location
    Under that huge rock
    Beans
    98

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by mrpeachy View Post
    @bfmetcalf you probably want to edit your previous post and remove the screenshot , you have your ip addresses still showing

    edit the pic and blur those out

    and use code boxes instead of quote boxes so that your post isn't soooooooo long

    Thanks,

    I'm still a bit new to Linux and some of the things that go along with it.

  7. #16707
    Join Date
    Aug 2005
    Location
    Mars
    Beans
    245

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by VinDSL View Post
    Yes!

    Are you volunteering
    The second most asked question here is "Where are the VinDSL fonts?"

    Since you have them in one directory, right click the directory from Nautlius and then select compress. After the box pops up select .tar .gz or .zip format.

    Place the saved compressed file of all VinDSL fonts somewhere on the Wild Wooly Web to allow download.


  8. #16708
    Join Date
    Aug 2005
    Location
    Mars
    Beans
    245

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by bfmetcalf View Post
    Thanks,

    I'm still a bit new to Linux and some of the things that go along with it.

    Please don't allow being new scare you. Many members on this thread did not touch conky until about a year ago.


  9. #16709
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by BoredOutOfMyMind View Post
    The second most asked question here is "Where are the VinDSL fonts?"

    Since you have them in one directory, right click the directory from Nautlius and then select compress. After the box pops up select .tar .gz or .zip format.

    Place the saved compressed file of all VinDSL fonts somewhere on the Wild Wooly Web to allow download.

    so what would you say was the most frequently asked?

    i would guess maybe
    "how do you get weather in conky?"

  10. #16710
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    here's the latest version of my lua calendar

    you can have a curved corner background



    Code:
    --lua calendar script by mrpeachy Feb 2011
    --version2.1 with background and glassy effect overlay, background and overlay adjust when calendar gains a line due to month length and start day
    require 'cairo'
    --------------------------------------------------------------------------------
    function conky_draw_fig()
    if conky_window == nil then return end
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    cr = cairo_create(cs)
    local updates=tonumber(conky_parse('${updates}'))
    --####################################################################################################
    if updates>5 then -- starts the display
    --####################################################################################################
    --####################################################################################################
    --title text color
    tred,tgreen,tblue,talpha=0.9,0,0.3,1
    --title text font
    tfont="URW Gothic L"
    --title text size
    tfontsize=22
    --###################################################
    --main body text color
    bred,bgreen,bblue,balpha=0.6,1,0.6,1
    --main body text font
    mfont="URW Gothic L"
    --main body text size
    mfontsize=18
    --###################################################
    --highlight text color
    hred,hgreen,hblue,halpha=1,1,0.2,1
    --highlight font
    hfont="URW Gothic L"
    --highlight size
    hfontsize=24
    --###################################################
    --surrounding numbers (previous and next month) 1=on, 0=off
    surround=1
    --surrounding dates text color
    sred,sgreen,sblue,salpha=0.3,0.5,0.3,1
    --surrounding font
    sfont="URW Gothic L"
    --surounding size
    sfontsize=18
    --###################################################
    --indicator box enter 1 for box or 0 for no box
    box=1
    --use the following 2 numbers to adjust box position
    xadjust=2.5
    yadjust=4
    --set the box dimensions
    width=34
    height=23
    --box color
    xred,xgreen,xblue,xalpha=1,0.2,0.8,1
    --##################################################
    --position
    across=55.5
    down=65.5
    --rotate - this will require repositioning above
    rotate=0
    --###################################################
    --horizontal gap between dates
    gaph=45
    --###################################################
    --gap between day titles and first line
    gapt=30
    --###################################################
    --gap between calendar line
    gapl=30
    --###################################################
    --spacer -- this can help with alignment enter 0, 1 space or 2 spaces between the ""
    spacer=""
    --###################################################
    --start day, enter 0 for sunday, 1 for monday
    sday=0
    --###################################################
    --## END OF CALENDAR SETUP ##########################
    --###################################################
    --calendar calcs
    year=os.date("%G")
    today=tonumber(os.date("%d"))
    t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
    t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
    feb=(os.difftime(t1,t2))/(24*60*60)
    local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
    local day=tonumber(os.date("%w"))+1-sday
    local day_num = today
    local remainder=day_num % 7
    start_day=day-(day_num % 7)
    if start_day<0 then start_day=7+start_day end     
    month=os.date("%m")
    mdays=monthdays[tonumber(month)]
    mdaystm=mdays
    x=mdays+start_day
    dnum={}
    dnumh={}
    if mdays+start_day<36 then 
    dlen=35
    plen=29 
    else 
    dlen=42 
    plen=36
    end
    for i=1,dlen do
    if i<=start_day then dnum[i]="  " 
    else dn=i-start_day
    if dn=="nil" then dn=0 end
    if dn<=9 then dn=(spacer .. dn) end
    if i>x then dn="" end
    dnum[i]=dn
    dnumh[i]=dn
    if dn==(spacer .. today) or dn==today then
    dnum[i]=""
    end 
    if dn==(spacer .. today) or dn==today then
    dnumh[i]=dn
    place=i 
    else dnumh[i]="  " 
    end 
    end
    end--for
    --###################################################
    --glassy look box drawer
    -- if combined with another lua script this setup sections
    -- needs to be at the start of the main function so that background doesn't cover the display
    --set top left coordinates for box
    glass_x,glass_y=across-25,down-35
    --set box width
    glass_w=355
    --compensate for changing calendar height
    if mdays+start_day<36 then
    --height of 5 line calendar 
    glass_h=210
    else 
    --height of 6 line calendar
    glass_h=245
    end
    --set box corner radius
    glass_cr=15
    --set box corner radius
    glass_cr=45
    --######################################################
    --set how far down the right side for the curve to start
    glass_cs=45
    --set how far down the left side for the curve to end
    glass_ce=glass_h-45
    --######################################################
    --NOTE to have main curve start on box corner curve set on_curve to 1, else 0
    on_curve=1
    --set degrees around corner for main curve to start (0 to 90)
    on_curvedeg=60
    --######################################################
    --set gradient colors
    --start gradient
    glass_sr,glass_sg,glass_sb,glass_sa=0,0,0,0
    --end graient
    glass_er,glass_eg,glass_eb,glass_ea=1,1,1,0.4
    --control curve with these settings
    --turn setting displaglass_y on = 1, off =0
    displaglass_y=0
    --point 1 -- display red circle
    glass_angle1=270
    glass_length1=glass_w/1.5--should be less than width
    --point 2 -- display blue circle
    glass_angle2=0
    glass_length2=glass_h/1.5--should be less than height
    --adjust the gradient - a number 1 or just over
    glass_adjust=1.4
    --end of setup ###################################################################
    --draw background
    --set background color
    glass_bgr,glass_bgg,glass_bgb,glass_bga=0,0,0,1--46/255,46/255,3/255,1
    --set start position for box - topleft corner
    x=glass_x
    y=glass_y
    --set radius of corners
    r=glass_cr
    --set height and width of box
    h=glass_h
    w=glass_w
    --calculations below
    xtl=x+r
    ytl=y+r
    xtr=(x+r)+((w)-2*r)
    ytr=y+r
    xbr=(x+r)+((w)-2*r)
    ybr=(y+r)+((h)-2*r)
    xbl=(x+r)
    ybl=(y+r)+((h)-2*r)
    cairo_set_source_rgba (cr,glass_bgr,glass_bgg,glass_bgb,glass_bga)
    cairo_move_to (cr,xtl,ytl-r)
    cairo_line_to (cr,xtr,ytr-r)
    cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
    cairo_line_to (cr,xbr+r,ybr)
    cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
    cairo_line_to (cr,xbl,ybl+r)
    cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
    cairo_line_to (cr,xtl-r,ytl)
    cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
    cairo_close_path(cr)
    cairo_fill (cr)
    
    --###################################################
    cairo_rotate (cr,(math.pi/180)*(rotate))
    --print calendar titles
    --###################################################
    cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tfontsize);
    cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
    if sday==0 then
    dys={"SU","MO","TU","WE","TH","FR","SA"}
    else
    dys={"MO","TU","WE","TH","FR","SA","SU"}
    end
    --------------------------------
    --use these settings to mess around with positioning
    turn=0
    ta=0
    move=0
    rot=0
    --------------------------------
    for i=1,7 do
    cairo_move_to (cr, across+(gaph*(i-1)), down+(i*move))
    cairo_rotate (cr,(math.pi/180)*(rot))
    cairo_show_text (cr, dys[i])
    cairo_stroke (cr)
    cairo_rotate (cr,(math.pi/180)*(rot*-1))
    end
    cairo_select_font_face (cr, mfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, mfontsize);
    cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
    for i=1,plen,7 do
    fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, across+(gaph*(i-fn))-((((fn-1)/7)+ta)*turn), (i*move)+down+gapt+(gapl*((fn-1)/7)))
    cairo_rotate (cr,(math.pi/180)*(rot))
    cairo_show_text (cr, dnum[i])
    cairo_stroke (cr)
    cairo_rotate (cr,(math.pi/180)*(rot*-1))
    end
    end
    cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, hfontsize);
    cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
    for i=1,plen,7 do
    fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, across+(gaph*(i-fn))-((((fn-1)/7)+ta)*turn), (i*move)+down+gapt+(gapl*((fn-1)/7)))
    cairo_rotate (cr,(math.pi/180)*(rot))
    cairo_show_text (cr, dnumh[i])
    cairo_stroke (cr)
    cairo_rotate (cr,(math.pi/180)*(rot*-1))
    end
    end
    --###############################################################################
    if surround==1 then
    thisstart=tonumber(start_day)+1
    thisend=tonumber(start_day)+mdays
    previous=tonumber(start_day)
    nextmon=dlen-thisend
    pmon=tonumber(month)-1
    if pmon==0 then pmon=12 end
    pmon=monthdays[pmon]
    snum={}
    for i=1,dlen do
    snum[i]=""
    end
    for i=tonumber(thisend)+1,tonumber(thisend)+nextmon do
    snum[i]=i-tonumber(thisend)
    end
    for i=1,previous do
    snum[i]=pmon-(previous-(i))
    end
    cairo_select_font_face (cr, sfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, sfontsize);
    cairo_set_source_rgba (cr,sred,sgreen,sblue,salpha)
    for i=1,plen,7 do
    fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, across+(gaph*(i-fn))-((((fn-1)/7)+ta)*turn), (i*move)+down+gapt+(gapl*((fn-1)/7)))
    cairo_rotate (cr,(math.pi/180)*(rot))
    cairo_show_text (cr, snum[i])
    cairo_stroke (cr)
    cairo_rotate (cr,(math.pi/180)*(rot*-1))
    end
    end
    end
    --box aound
    if box==1 then
    cairo_set_source_rgba (cr,xred,xgreen,xblue,xalpha)
    cairo_set_line_width (cr,1)
    if place>0 and place<8 then
    cy=down+gapt
    elseif
    place>7 and place<15 then
    cy=down+gapt+gapl
    elseif
    place>13 and place<23 then
    cy=down+gapt+gapl+gapl
    elseif
    place>21 and place<29 then
    cy=down+gapt+gapl+gapl+gapl
    elseif
    place>28 and place<36 then
    cy=down+gapt+gapl+gapl+gapl+gapl
    end
    placey=place %7
    if placey==1 then
    cx=across
    elseif
    placey==2 then
    cx=across+(gaph*1)
    elseif
    placey==3 then
    cx=across+(gaph*2)
    elseif
    placey==4 then
    cx=across+(gaph*3)
    elseif
    placey==5 then
    cx=across+(gaph*4)
    elseif
    placey==6 then
    cx=across+(gaph*5)
    elseif
    placey==0 then
    cx=across+(gaph*6)
    end
    cairo_rectangle (cr,cx-xadjust,cy+yadjust,width,-height)
    cairo_stroke (cr)
    end
    --###################################################
    cairo_rotate (cr,(math.pi/180)*(rotate*-1))
    --end of calendar
    --###################################################
    --call drawing function ##########################################################
    -- if combined with another lua script the call to the drawing function
    -- needs to be at the end of the main function so that the effect covers the display
    glass(glass_x,glass_y,glass_h,glass_w,glass_cs,glass_ce,glass_sr,glass_sg,glass_sb,glass_sa,glass_er,glass_eg,glass_eb,glass_ea,displaglass_y,glass_angle1,glass_length1,glass_angle2,glass_length2,glass_adjust,on_curve,on_curvedeg)
    ----------------------------------------------------------------
    --#################################################################################
    end--end if 5
    end--end main function
    --glassy drawing function put this after the main function
    function glass(glass_x,glass_y,glass_h,glass_w,glass_cs,glass_ce,glass_sr,glass_sg,glass_sb,glass_sa,glass_er,glass_eg,glass_eb,glass_ea,displaglass_y,glass_angle1,glass_length1,glass_angle2,glass_length2,glass_adjust,on_curve,on_curvedeg)
    --set start position for box - topleft corner
    x=glass_x
    y=glass_y
    --set radius of corners
    r=glass_cr
    --set height and width of box
    h=glass_h
    w=glass_w
    --calculations below
    xtl=x+r
    ytl=y+r
    xtr=(x+r)+((w)-2*r)
    ytr=y+r
    xbr=(x+r)+((w)-2*r)
    ybr=(y+r)+((h)-2*r)
    xbl=(x+r)
    ybl=(y+r)+((h)-2*r)
    if on_curve==0 then
    startglass_x=glass_x+glass_w
    startglass_y=glass_y+glass_cs
    else
    rad=glass_cr
    arc=((2*math.pi)/360)*(on_curvedeg)
    oncurve_x=0+rad*(math.sin(arc))
    oncurve_y=0-rad*(math.cos(arc))
    startglass_x=oncurve_x+xtr
    startglass_y=oncurve_y+ytr
    end
    endglass_x=glass_x
    endglass_y=glass_y+glass_ce--
    rad=glass_length1
    arc=((2*math.pi)/360)*(glass_angle1)
    c1glass_x=0+rad*(math.sin(arc))
    c1glass_y=0-rad*(math.cos(arc))
    glass_center1glass_x=c1glass_x+startglass_x
    glass_center1glass_y=c1glass_y+startglass_y
    rad=glass_length2
    arc=((2*math.pi)/360)*(glass_angle2)
    c2glass_x=0+rad*(math.sin(arc))
    c2glass_y=0-rad*(math.cos(arc))
    glass_center2glass_x=c2glass_x+endglass_x
    glass_center2glass_y=c2glass_y+endglass_y
    if displaglass_y==1 then
    cairo_set_line_width (cr,1)----------------------
    cairo_set_source_rgba (cr,1,0,1,1)---------------
    cairo_move_to (cr,startglass_x,startglass_y)-----------------
    cairo_line_to (cr,glass_center1glass_x,glass_center1glass_y)-------------
    cairo_stroke (cr)--------------------------------
    cairo_set_source_rgba (cr,1,0,0,1)---------------
    cairo_arc (cr,startglass_x,startglass_y,3,0,2*math.pi)-------
    cairo_fill (cr)----------------------------------
    cairo_set_source_rgba (cr,1,0,0,1)---------------
    cairo_arc (cr,startglass_x,startglass_y,glass_length1,0,2*math.pi)
    cairo_stroke (cr)--------------------------------
    cairo_set_source_rgba (cr,0,1,0,1)---------------
    cairo_arc (cr,glass_center1glass_x,glass_center1glass_y,3,0,2*math.pi)---
    cairo_fill (cr)----------------------------------
    cairo_set_source_rgba (cr,1,0,1,1)---------------
    cairo_move_to (cr,endglass_x,endglass_y)---------------------
    cairo_line_to (cr,glass_center2glass_x,glass_center2glass_y)-------------
    cairo_stroke (cr)--------------------------------
    cairo_set_source_rgba (cr,0,1,1,1)---------------
    cairo_arc (cr,endglass_x,endglass_y,3,0,2*math.pi)-----------
    cairo_fill (cr)----------------------------------
    cairo_arc (cr,endglass_x,endglass_y,glass_length2,0,2*math.pi)-----
    cairo_stroke (cr)--------------------------------
    cairo_set_source_rgba (cr,1,1,0,1)---------------
    cairo_arc (cr,glass_center2glass_x,glass_center2glass_y,3,0,2*math.pi)---
    cairo_fill (cr)----------------------------------
    end
    if glass_w>glass_h then
    cc=glass_w
    else
    cc=glass_h
    end
    ccglass_x=glass_x+cc
    ccglass_y=glass_y+cc
    pat = cairo_pattern_create_radial (ccglass_x,ccglass_y, 1,
                                       ccglass_x,ccglass_y, cc*glass_adjust);
    cairo_pattern_add_color_stop_rgba (pat, 1,glass_er,glass_eg,glass_eb,glass_ea);
    cairo_pattern_add_color_stop_rgba (pat, 0,glass_sr,glass_sg,glass_sb,glass_sa);
    cairo_set_source (cr,pat)
    cairo_set_line_width (cr,1)
    if on_curve==0 then
    cairo_move_to (cr,xtl,ytl-r)
    cairo_line_to (cr,xtr,ytr-r)
    cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
    cairo_line_to (cr,glass_x+glass_w,glass_y+glass_cs)
    cairo_curve_to (cr,glass_center1glass_x,glass_center1glass_y,glass_center2glass_x,glass_center2glass_y,endglass_x,endglass_y)
    cairo_line_to (cr,xtl-r,ytl)
    cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
    cairo_close_path(cr)
    cairo_fill (cr)
    else
    cairo_move_to (cr,xtl,ytl-r)
    cairo_line_to (cr,xtr,ytr-r)
    cairo_arc(cr,xtr,ytr,r,((math.pi/180)*-90),((math.pi/180)*(on_curvedeg-90)))
    cairo_curve_to (cr,glass_center1glass_x,glass_center1glass_y,glass_center2glass_x,glass_center2glass_y,endglass_x,endglass_y)
    cairo_line_to (cr,xtl-r,ytl)
    cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
    cairo_close_path(cr)
    cairo_fill (cr)
    end
    end
    400 lines of lua code may be a bit overkill for a calendar... but oh well... i think it looks good

    there is a bug that will occur if the calendar gains a line when a month starts on a day late in the week, need to make the background and overlay change to compensate
    -EDIT fixed above in code
    Last edited by mrpeachy; March 26th, 2011 at 08:29 PM.

Page 1671 of 2348 FirstFirst ... 6711171157116211661166916701671167216731681172117712171 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •