You are not logged in.

#226 2017-06-27 02:19:35

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,053

Re: Conky - Calendars / Clocks / Time

@ ututo - Thank you for the idea and the clock face. I 'tweaked' it a tad.  Size is now an even 250x250.

My version of the clock ututo put us onto:
2017-06-26_224704_Scrot11.th.jpg

The conky:

## pkill -xf "conky -c /media/5/Conky/S11-Grey-Clock.conky" &
## 2017-06-25
## ---------- Begin Window Settings
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints skip_taskbar,skip_pager,below,undecorated
own_window_colour 000000
own_window_class Conky
own_window_title Grey Clock

gap_x 100
gap_y 100

minimum_size 350 260
maximum_width 0

alignment tr

## ---------- End Window Settings
## ---------- Font Settings

override_utf8_locale yes
use_xft yes
xftfont Roboto Condensed:size=12
#xftfont Liberation Mono:bold:size=11
#xftfont Fantasque Sans Mono:bold:size=12
#xftfont Monofur:bold:size=12
#xftfont DejaVu Sans Mono:bold:size=10
#xftfont Fira Mono:bold:size=11
xftalpha 1.0

## --------- End Font Settings
## --------- Color Settings

draw_shades yes
default_shade_color 000000
draw_outline no
default_outline_color 000000

default_color DCDCDC #Gainsboro
color0 C0C0C0 #Silver
color1 778899 #LightSlateGray
color2 FAEBD7 #AntiqueWhite
color3 87CEFA #LightSkyBlue
color4 48D1CC #MediumTurquoise
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 B0E0E6 #PowderBlue
color8 FFD700 #Gold
color9 CD5C5C #IndianRed
## ---------- End Color Settings
## ---------- Begin Borders Section
draw_borders no
## Stippled borders?
stippled_borders 5
## border margins
border_inner_margin 0
border_outer_margin 0
## border width
border_width 2
## graph borders
draw_graph_borders yes ## no
## default_graph_size 15 40

## ---------- End Borders Secton
## ---------- Begin Miscellaneous Section

background no ## yes
use_spacer none
no_buffers yes
imlib_cache_size 0
double_buffer yes

## ---------- End Miscellaneous Section
## ---------- Begin draw.bg LUA

## ---------- Above and After TEXT  (requires a composite manager or it blinks!)
## THIS LINE ALWAYS ABOVE TEXT
lua_load /media/5/Conky/LUA/draw-bg.lua

## ABOVE TEXT >>> (no composite manager required - no blinking!)
##lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.2
# TEXT

## BELOW TEXT >>> composite manager required - OH YEA!! blinking!)
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}


## Note
## ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.2}
##   See below:        1  2 3 4 5 6        7

## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}

## covers the whole window and will change if you change the minimum_size setting

## 1 = 20            corner_radius
## 2 = 0             x_position l|r
## 3 = 0             y_position u|d
## 4 = 0             width
## 5 = 0             height
## 6 = 0x000000      color
## 7 = 0.2           alpha

## ---------- End draw.bg LUA


	lua_load /media/5/Conky/LUA/Grey-clock.lua
	lua_draw_hook_pre main

update_interval 1
TEXT
${lua conky_draw_bg 114 22 22 228 228 0x000000 0.15}\
${image /media/5/Conky/images/grey-clock-face.png -p 10,10}
${goto 100}${goto 200}${time %A}
${goto 100}${goto 220}the \
${if_match ${time %d} == 01}${time %dst} ${else}\
${if_match ${time %d} == 21}${time %dst} ${else}\
${if_match ${time %d} == 31}${time %dst} ${else}\
${if_match ${time %d} == 02}${time %dnd} ${else}\
${if_match ${time %d} == 22}${time %dnd} ${else}\
${if_match ${time %d} == 03}${time %drd} ${else}\
${if_match ${time %d} == 23}${time %drd} ${else}${time %dth} \
${endif}${endif}${endif}${endif}${endif}${endif}${endif} day
${goto 100}${goto 235}${time of %B}
${goto 85}${goto 250}${time %Y}
${goto 75}${goto 250}
${goto 70}${goto 255}
${goto 70}${goto 255}
${goto 75}${goto 250}
${goto 85}${goto 245}ZULU
${goto 100}${goto 235}${utime %T}
${goto 100}${goto 220}Flight time:
${goto 100}${goto 200}${uptime_short}

The clock LUA script: Grey-clock.lua

--[[drawing a clock in conkyrc
by mrpeachy - 12 March 2010
tweaked by Sector11 - 2017-06-26

lua_load /path/clock.lua
lua_draw_hook_pre main
TEXT
]]

require 'cairo'

function conky_main()
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)
--##############################################################################
--   SETTINGS AREA
--##############################################################################
--12 OR 24
local clock_type=12

--CLOCK SETTINGS
local clock_radius=110
local clock_centerx=136
local clock_centery=137

-- SET MARKS ### NOT BEING USED
--how many marks around edge
local number_marks=0 -- 0 for none, 60 for seconds 12 = am/pm or 24
--set mark length
local m_length=10
--set mark line width
local m_width=1
--set mark line cap type
local m_cap=CAIRO_LINE_CAP_ROUND
--set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,1,1  --opaque white

--SET BORDER OPTIONS ### NOT BEING USED
local clock_border_width=0 --2
--set color and alpha for clock border
local cbr,cbg,cbb,cba=1,1,1,1  --full opaque white
--gap from clock border to hour marks
local b_to_m=5

--SECONDS HAND SETUP
--set length of seconds hand
local sh_length=90
--set hand width
local sh_width=1
--set hand line cap
local sh_cap=CAIRO_LINE_CAP_ROUND
--set seconds hand color
local shr,shg,shb,sha=1,0,0,1  --fully opaque red
--local shr,shg,shb,sha=1,1,0,1  --fully opaque yellow

--MINUTE HAND SETUP
--set length of minutes hand
local mh_length=80
--set hand width
local mh_width=2
--set hand line cap
local mh_cap=CAIRO_LINE_CAP_ROUND
--set minute hand color
local mhr,mhg,mhb,mha=0.6,0.6,0.6,1  --fully opaque grey

--HOUR HAND SETUP
--set length of hour hand
local hh_length=70
--set hand width
local hh_width=4
--set hand line cap
local hh_cap=CAIRO_LINE_CAP_ROUND
--set hour hand color
local hhr,hhg,hhb,hha=0.6,0.6,0.6,1  --fully opaque grey
--##############################################################################
--   END SETTINGS AREA
--##############################################################################

--DRAWING CODE
--draw border
cairo_set_source_rgba (cr,cbr,cbg,cbb,cba)
cairo_set_line_width (cr,clock_border_width)
cairo_arc (cr,clock_centerx,clock_centery,clock_radius,0,2*math.pi)
cairo_stroke (cr)

--DRAW MARKS
--stuff that can be moved outside of the loop, needs only be set once
--calculate end and start radius for marks
m_end_rad=clock_radius-b_to_m
m_start_rad=m_end_rad-m_length
--set line cap type
cairo_set_line_cap  (cr, m_cap)
--set line width
cairo_set_line_width (cr,m_width)
--set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
--start for loop
for i=1,number_marks do
--drawing code using the value of i to calculate degrees
--calculate start point for 12 oclock mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
--set start point for line
cairo_move_to (cr,clock_centerx+x,clock_centery+y)
--calculate end point for 12 oclock mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
--set path for line
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
--draw the line
cairo_stroke (cr)
end--of for loop

--TIME CALCULATIONS ###########################
if clock_type==12 then
hours=tonumber(os.date("%I")) --12 hour clock
--convert hours to seconds
h_to_s=hours*60*60
elseif clock_type==24 then
hours=tonumber(os.date("%H")) --24 hour clock
--convert hours to seconds
h_to_s=hours*60*60
end

minutes=tonumber(os.date("%M"))
--convert minutes to seconds
m_to_s=minutes*60
--get current seconds
seconds=tonumber(os.date("%S"))

--DRAW HOUR HAND ############################
--convert hours, minutes & seconds to seconds
hsecs=h_to_s+m_to_s+seconds
--calculate number of degrees for each hand per second
hsec_degs=hsecs*(360/(60*60*clock_type)) -- USING AN EQUATION INSTEAD OF TYPING THE CALCULATION IN BECAUSE THE RESULT OF 360/43200 HAS DECIMAL PLACES
--set radius we will use to calculate hand points
radius=hh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes hand
point=(math.pi/180)*hsec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
--describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
--set up line attributes and draw line
cairo_set_line_width (cr,hh_width)
cairo_set_source_rgba (cr,hhr,hhg,hhb,hha)
cairo_set_line_cap  (cr, hh_cap)
cairo_stroke (cr)

--DRAW MINUTES HAND ############################
--convert minutes & seconds to seconds
msecs=m_to_s+seconds
--calculate degrees for the hand each second
msec_degs=msecs*0.1
--set radius we will use to calculate hand points
radius=mh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes hand
point=(math.pi/180)*msec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
--describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
--set up line attributes and draw line
cairo_set_line_width (cr,mh_width)
cairo_set_source_rgba (cr,mhr,mhg,mhb,mha)
cairo_set_line_cap  (cr, mh_cap)
cairo_stroke (cr)

--DRAW SECOND HAND #############################
--calculate degrees for each second the hand moves
sec_degs=seconds*6
--set radius we will use to calculate hand points
radius=sh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of second hand
point=(math.pi/180)*sec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
--describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
--set up line attributes and draw line
cairo_set_line_width (cr,sh_width)
cairo_set_source_rgba (cr,shr,shg,shb,sha)
cairo_set_line_cap  (cr, sh_cap)
cairo_stroke (cr)

--##############################################################################
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function

and the shadow background LUA script: draw-bg.lua

--[[Background originally by londonali1010 (2009)
    ability to set any size for background mrpeachy 2011
    ability to set variables for bg in conkyrc dk75

  the change is that if you set width and/or height to 0
  then it assumes the width and/or height of the conky window

so:

Above and After TEXT  (requires a composite manager or it blinks!)

 lua_load /media/5/Conky/LUA/draw-bg.lua
 TEXT
 ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}

OR Both above TEXT (no composite manager required - no blinking!)

 lua_load /media/5/Conky/LUA/draw-bg.lua
 lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.2
 TEXT

Note
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.2}
  See below:        1  2 3 4 5 6        7

${lua conky_draw_bg corner_radius x_position y_position width height color alpha}

covers the whole window and will change if you change the minimum_size setting

1 = 20            corner_radius
2 = 0             x_position l|r
3 = 0             y_position u|d
4 = 0             width
5 = 0             height
6 = 0x000000      color
7 = 0.4           alpha

--  -----  calendar function  -----

then to use it, you activate the calendar function BELOW TEXT like this

${lua luacal {settings}}

#${lua luacal {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gh=,gt=,gv=,sd=}}
#    x=x position top left
#    y=y position top left
#    tf=title font, eg "mono" must be in quotes
#    tfs=title font size
#    tc=title color
#    ta=title alpha
#    bf=body font, eg "mono" must be in quotes
#    bfs=body font size
#    bc=body color
#    ba=body alpha
#    hf=highlight font, eg "mono" must be in quotes
#    hfs=highlight font size
#    hc=highlight color
#    ha=highlight alpha
#    sp=spacer, eg " " or sp="0"... 0,1 or 2 spaces can help with positioning of non-monospaced fonts

--  ----- GAPS  -----
#    gt=gap from title to body
#    gh=gap horizontal between columns
#    gv=gap vertical between rows
#    sd=start day, 0=Sun, 1=Mon

#    hstyle = heading style, 0=just days, 1=date insert
#    tdf=title date font, eg "mono" must be in quotes
#    tdfs=title date font size
#    tdc=title date color
#    tda=title date alpha

# test line
-- ${lua luacal {x=20,y=100,tf="Monofur",tfs=24,tc=0xFFDEAD,ta=1,bf="Monofur",bfs=24,bc=0xFFDEAD,ba=1,hf="Monofur",hfs=24,hc=0x00BFFF,ha=1,sp="0",gh=60,gt=26,gv=20,sd=0,hstyle=1,tdf="Monofur",tdfs=24,tdc=0x00BFFF,tda=1}}


]]

require 'cairo'
local    cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--  top left mid circle
local xtl=x+r
local ytl=y+r
--  top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--  bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--  bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--  -----  -----  -----  -----
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_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
-- ----- calendar function -----
function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=,hstyle=,tdf=,tdfs=,tdc=,tda=}
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)
local cr = cairo_create(cs)
--  -----  -----  -----  -----
if caltab.x==nil then
caltab=loadstring("return" .. caltab)()
end
local cal_x=caltab.x
local cal_y=caltab.y
local tfont=caltab.tf		or "mono"
local tfontsize=caltab.tfs	or 12
local tc=caltab.tc			or 0xffffff
local ta=caltab.ta			or 1
local bfont=caltab.bf		or "mono"
local bfontsize=caltab.bfs	or 12
local bc=caltab.bc			or 0xffffff
local ba=caltab.ba			or 1
local hfont=caltab.hf		or "mono"
local hfontsize=caltab.hfs	or 12
local hc=caltab.hc			or 0xff0000
local ha=caltab.ha			or 1
local spacer=caltab.sp		or " "
local gaph=caltab.gh		or 20
local gapt=caltab.gt		or 15
local gapl=caltab.gv		or 15
local sday=caltab.sd		or 0
local hstyle=caltab.hstyle	or 0
--  convert colors
--  local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
--  main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
--  highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
--  -----  -----  -----  -----
--  calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
local 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
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local 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
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)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
if hstyle==0 then
    if tonumber(sday)==0 then
    dys={"SU","MO","TU","WE","TH","FR","SA"}
    else
    dys={"MO","TU","WE","TH","FR","SA","SU"}
    end
--  draw calendar titles
elseif hstyle==1 then
    if tonumber(sday)==0 then
    dys={"SU","MO"," ","  ","  ","FR","SA"}
    cairo_text_extents(cr,"MO",extents)
    local s=extents.x_advance+gaph
    local f=gaph*5
    local tdfont=caltab.tdf        or "mono"
    local tdfontsize=caltab.tdfs    or 12
    local tdc=caltab.tdc        or 0xffffff
    local tda=caltab.tda        or 1
    cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tdfontsize);
    local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
    cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
    local insert=os.date("%b %y")
    cairo_text_extents(cr,insert,extents)
    local w=extents.x_advance
    cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
    cairo_show_text (cr,insert)
    cairo_stroke (cr)
    else
    dys={"MO","TU"," ","  ","  ","SA","SU"}
    cairo_text_extents(cr,"TU",extents)
    local s=extents.x_advance+gaph
    local f=gaph*5
    local tdfont=caltab.tdf        or "mono"
    local tdfontsize=caltab.tdfs    or 12
    local tdc=caltab.tdc        or 0xffffff
    local tda=caltab.tda        or 1
    cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tdfontsize);
    local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
    cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
    local insert=os.date("%b %y")
    cairo_text_extents(cr,insert,extents)
    local w=extents.x_advance
    cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
    cairo_show_text (cr,insert)
    cairo_stroke (cr)
    end
end
--  draw calendar titles
for i=1,7 do
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)
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--  draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
    cairo_show_text (cr, dnum[i])
    cairo_stroke (cr)
    end
end
--  highlight
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
local fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
    cairo_show_text (cr, dnumh[i])
    cairo_stroke (cr)
    end
end
--  -----  -----  -----  -----
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end
-- ----- end main function -----

The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#227 2017-06-27 03:37:43

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,053

Re: Conky - Calendars / Clocks / Time

OK, I think I like this tweak better:
Better_Scrot11.th.jpg

In the conky:

TEXT
${lua conky_draw_bg 114 22 22 229 228 0xffffff 0.2}\
${image /media/5/Conky/images/grey-clock-face.png -p 10,10}

change LUA line.


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#228 2017-06-27 04:58:23

Dobbie03
Resident Metalhead
From: New Zealand
Registered: 2015-09-29
Posts: 2,554
Website

Re: Conky - Calendars / Clocks / Time

Sector11 wrote:

OK, I think I like this tweak better:
https://cdn.scrot.moe/images/2017/06/27/Better_Scrot11.th.jpg

In the conky:

TEXT
${lua conky_draw_bg 114 22 22 229 228 0xffffff 0.2}\
${image /media/5/Conky/images/grey-clock-face.png -p 10,10}

change LUA line.


Some great options there S11.


One of the ArchLabs dudes
Obssesive Metalhead and practiced beer drinker
\m/

Offline

#229 2017-06-27 09:42:51

unklar
Member
Registered: 2015-10-31
Posts: 1,095

Re: Conky - Calendars / Clocks / Time

^ In the German forum I've said it many times, the configurations of the Master just work!  wink

Thanks to all involved:
ututo; Dobbie03; PackRat; DeepDayze and naturally Sector11 big_smile  angel

2017-06-27-10-59-52_scrot.th.png

Offline

#230 2017-06-27 16:44:13

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,053

Re: Conky - Calendars / Clocks / Time

Thank you Doobie03 and unklar but I can't lay claim to that "circle" shadow from draw-bg.lua  - as it says in the beginning of the LUA file:

--[[Background originally by londonali1010 (2009)
    ability to set any size for background mrpeachy 2011
    ability to set variables for bg in conkyrc dk75

should get the credit.

And to be honest it was not until ragamatrix's 'conkybarre_v9000' that everything fell into place:
2017-06-27_122129_Scrot11.th.jpg
Very clear that there is a white circle behind the moon on a dark background but look at that same conky with a light background or a highly mixed coloured dark-light background and the beauty of draw-bg.lua comes to light:
2017-06-27_122654_Scrot11.th.jpg
Let's see ARGB in conky do that!  And this all happened before ARGB was available in conky.

From that conky:

# -- Lua load -- #
lua_load ~/v9000/v9000.lua
lua_draw_hook_pre weather
lua_load /media/5/Conky/LUA/template_meteo_barre.lua
lua_load /media/5/Conky/LUA/draw-bg.lua
##############################################
update_interval 1

TEXT
${lua conky_draw_bg 10 0 0 480 87 0x000000 0.3}\
${lua conky_draw_bg 30 105 5 60 60 0xffffff 0.5}\
${lua conky_draw_bg 10 522 0 75 87 0x000000 0.3}\
${lua conky_draw_bg 10 640 0 75 87 0x000000 0.3}\
${lua conky_draw_bg 10 760 0 75 87 0x000000 0.3}\
${lua conky_draw_bg 10 880 0 75 87 0x000000 0.3}\
${lua conky_draw_bg 10 1000 0 75 87 0x000000 0.3}\
${lua conky_draw_bg 10 1120 0 75 87 0x000000 0.3}\
${lua conky_draw_bg 10 1240 0 75 87 0x000000 0.3}\
${lua conky_draw_bg 10 1360 0 75 87 0x000000 0.3}\
${lua conky_draw_bg 10 1480 0 75 87 0x000000 0.3}

And that's it, nothing else under TEXT - it's all in:
- mrpeachy's v9000 LUA script, and
- ragamatrix's /template_meteo_barre.lua <- an option of the v9000 script, use a template or put the code into the conky.

So the masters here are londonali1010, mrpeachy, dk75 and ragamatrix.  As I keep telling people, I'm a layout guy. I couldn't build a decent bash script, lua script or python script to support conky if my life depended on it.  I can however, bend fold and mutilate the hell out of them, most times, to "get a layout" I like.  I'll spend a couple of days laying out a conky that others could do in a few hours, because of my typing speeds.

Consider: http://smallbusiness.chron.com/good-typ … 71789.html

The average person types between 38 and 40 words per minute -- between 190 and 200 characters per minute.

I probably type less then 10, then add; my proofreading for tpyo's and a lot of those still get through.

The weather scrip in those images is a LUA script: v9000 by mrpeachy, from the oldest archive I have:

--weather v9000 by mrpeachy 01/10/12; released: Feb 23, 2012

and it's still going - weill there have been a few development updates up to maybe 2014 and then it sits dormant, but still working.

And like another mentor of mine: Kaivalagi.  You know, the guy who wrote python scripts like; conkyForecast, conkyEmail, conkyMisc, among others.  He also wrote a python script to get images into conky before conky had the ${image} command.

They are The Masters.  I share what My Mentors shared with me, nothing else.

My recommendation:  Grab the draw-bg.lua script if you don't already have it. Use it if you have a conky that needs a background and has images, where ARGB fails.  ARGB is great for backgrounds that fill the conky window but it doesn't have the other options.


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#231 2017-06-27 17:03:34

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 1,182

Re: Conky - Calendars / Clocks / Time

Sector11 wrote:

@ ututo - Thank you for the idea and the clock face. I 'tweaked' it a tad.  Size is now an even 250x250.

My version of the clock ututo put us onto:
2017-06-26_224704_Scrot11.th.jpg

I like your new ride - how fast can you get to Mendoza in that?

--[[Background originally by londonali1010 (2009)

using the Way-back machine for that one.

Last edited by PackRat (2017-06-27 17:04:25)


You must unlearn what you have learned.
    -- yoda

Offline

#232 2017-06-27 18:06:07

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,053

Re: Conky - Calendars / Clocks / Time

@ PackRat - Yea, I wish that was my ride!  It's a concept machine I think - can't remember.

So 'conceptually' speaking of course ( while roll ) 35 minutes - 20 with a good tail wind. lol lol

Way-back machine, maybe, but a good solid one.  londonali1010's clock rings lua script is still going strong in conkys around the globe and that dates back to 2009 on #! 9.04.  And it would not surprise me if a lot of the newer scripts were "tweaked" from that or ideas borrowed from it.


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

#233 2017-06-27 18:27:53

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 817

Re: Conky - Calendars / Clocks / Time

PackRat wrote:
DeepDayze wrote:
PackRat wrote:

I don't blame you. It would be nice if conky 1.9 was forked; or even 1.8.

Think you can find the source for Conky 1.9 in the Debian snapshots repo. Just need to rebuild it against the newer libraries.


@Head_on_a_Stick's package works just fine so far.

This what you're after?

Good place to look and I am sure you could try building your favorite version into a shiny new package. Of course code may need to be patched to work with newer libs.


Real Men Use Linux

Offline

#234 2017-06-27 20:33:18

ututo
Member
Registered: 2015-09-29
Posts: 279

Re: Conky - Calendars / Clocks / Time

Wow!!! Nice clocks you got there!! Great job!


BunsenLabs on deviantArt
Don't touch my git!

Offline

#235 2017-08-07 04:59:58

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,053

Re: Conky - Calendars / Clocks / Time

OK a couple of new clocks.  Well one is old I've had it for a while, posted it on the #! forums, so that gives you an idea "Set Theory Clock" or the Berlin Clock as some call it, on the right.  Has a 'few' images so I'll either need to archive it and find a place to put it OR you can do like I did and grab them from the website.  wink

And the second one, on the left, super simple clock: Plexiglas Clock
2017-08-06_222949_Scrot11.th.jpg
Oh didn't I tell you, the site is in German .... hmmmmmmmm OK, it's in English as well:
2017-08-06_222900_Scrot11.th.jpg

I have the "SVG Railway Station Clock " here as well, when I find it, I'll post it.  It's a LUA script if I recall correctly.

Here's the Plexiglas Clock: plexiglas-ns.png
and the conky:

# pkill -xf "conky -q -c /media/5/Conky/3quarks/plexiglas/plexiglas.conky" &

# 24 hours watches: http://24hourtime.info/
# http://www.3quarks.com/index.html
# Thanks to: Rüdiger Appel

own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints skip_taskbar,skip_pager,below,undecorated #,sticky
own_window_colour 000000
own_window_class Conky
own_window_title Plexiglas Conky

gap_x 5
gap_y 5

minimum_size 166 80 ## h|W equal to plexiglas-ns.png
maximum_width 166

alignment tl

override_utf8_locale yes
use_xft yes
xftfont LED_mono:size=25
xftalpha 1.0

default_color B2ADAB   # Same as plexiglas
color0 000000

background yes
use_spacer none
no_buffers yes
imlib_cache_size 0
double_buffer yes

update_interval 0.5
TEXT
${image /media/5/Conky/3quarks/plexiglas/plexiglas-ns.png}
${goto 25}88:88:88${goto 25}${color0}${time %T}${color}

Posted just after: 2017-08-07_015825_Scrot11.jpg


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.

Offline

Board footer

Powered by FluxBB