You are not logged in.

#76 2016-03-28 17:15:24

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

Re: Conky - Calendars / Clocks / Time

So what happens when we run mrpeachy's yearclock.lua and easysid's clock_easysid.lua in the same conky?

###  yearclock.lua  ##########################################################
lua_load /media/5/Conky/LUA/yearclock.lua
lua_draw_hook_pre draw_clock
#lua_draw_hook_post draw_clock
#
###  clock_easysid_conkyrc.lua  ##############################################
lua_load /media/5/Conky/LUA/clock_easysid.lua
lua_draw_hook_post es_clock

2016_03_28_14_01_45_Scrot11.jpg 2016_03_28_14_04_57_Scrot11.jpg

2016_03_28_14_05_50_Scrot11.jpg 2016_03_28_14_06_24_Scrot11.jpg
NICE!!!!!

--[[ Clock for conky
written by easysid
Thu 09 May 2013 19:20:16 IST
--]]

require 'cairo'

function conky_es_clock()

clock_table ={
    {
        -- Draw the seconds
	    -- x = l|r y = u|d
        arg = "time %S",
        xc = 295,		--200,
        yc = 307,		--150,
        r  = 290,		--radius
        font_face = "Monofur",
        top_font_size = 20, -- font size for display
        min_font_size = 6,  -- min font for trail
        max_font_size = 14, -- max font fot trail
        max_alpha = .6,     -- max alpha for trail
        trail = 40,         -- size of trail
        main_color = {0xFFDEAD,1}, --color of numbers
        trail_color = {0xC1C1C1,1} --color of trail.
    },

    {
        -- Draw the Minutes
        arg = "time %M",
        xc = 295,		--200,
        yc = 307,		--150,
        r  = 250,		--radius
        font_face = "Monofur",
        top_font_size = 25, -- font size for display
        min_font_size = 4,  -- min font for trail
        max_font_size = 14, -- max font fot trail
        max_alpha = .6,     -- max alpha for trail
        trail = 40,         -- size of trail
        main_color = {0xFFDEAD,1}, --color of numbers
        trail_color = {0xC1C1C1,1} --color of trail
    },

    {
        -- Draw the Hours
        arg = "time %H",
        xc = 295,		--200,
        yc = 307,		--150,
        r  = 210,		--radius
        font_face = "Monofur",
        top_font_size = 30, -- font size for display
        min_font_size = 4,  -- min font for trail
        max_font_size = 14, -- max font fot trail
        max_alpha = .6,     -- max alpha for trail
        trail = 40,         -- size of trail
        main_color = {0xFFDEAD,1}, --color of numbers
        trail_color = {0xC1C1C1,1} --color of trail
    },
}
    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>3 then
        for i in ipairs(clock_table) do
            draw_clock(cr, clock_table[i])
        end
    end
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
    cr=nil
end -- end main function


function draw_clock(cr, t)

        cairo_select_font_face (cr, t.font_face, CAIRO_FONT_SLANT_NORMAL,  CAIRO_FONT_WEIGHT_BOLD)

        local value = tonumber(conky_parse(string.format("${%s}",t.arg)))
        local first = value - t.trail

--[[        if t.arg == 'time %H' then -- special case for the hour digit
             cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.main_color))
             cairo_set_font_size (cr, t.top_font_size)
             cairo_move_to(cr, t.xc - t.top_font_size/3, t.yc+t.top_font_size/4) -- minor adjustment. Tweak here for your setting
             cairo_show_text(cr, value)
        else --]]
            for i = first, value do

                local theta = i*2*math.pi/60 -math.pi/2 -- calculate the angle
                local alpha = t.max_alpha*(i-first)/(value-first) -- map alpha value to [0, max_alpha]
                local font_size = (t.max_font_size-t.min_font_size)*(i-first)/(value-first) + t.min_font_size -- map font size similar to alpha
                t.trail_color[2] = alpha
                cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.trail_color))
                cairo_set_font_size (cr, font_size)
                if i == value then -- if we have the main value
                    cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.main_color)) -- switch color
                    cairo_set_font_size (cr, t.top_font_size) -- switch font
                end -- end if
                local k = i
                if k < 0 then k = 60 + i end  -- adjust seconds
                cairo_move_to(cr, t.xc + t.r*math.cos(theta), t.yc + t.r*math.sin(theta))
                cairo_show_text(cr, k)

            end -- end for
--[[      end --end if ------------- the if for special case for hours --]]
end -- end draw_clock


function rgba_to_r_g_b_a(tcolor)
	local color,alpha=tcolor[1],tcolor[2]
	return ((color / 0x10000) % 0x100) / 255.,
		((color / 0x100) % 0x100) / 255., (color % 0x100) / 255., alpha
end --end rgba

See the previous post to get the conky and yearclock.lua.

Thank you easysid.


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

Offline

#77 2016-04-04 17:58:04

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

Re: Conky - Calendars / Clocks / Time

Hello,

any ideas why the clock does not rotate?
It is Lua.  hmm
2016-04-04-19-26-47_scrot.th.png

conkyrc

# main conkyrc by Boris Krinkel <olgmen>
# krinkel@rambler.ru
# --- параметры окна ---
# эти строки необходимы для нормальной работы лучше не изменять
own_window		yes 
own_window_class	Conky 
own_window_transparent	yes 
own_window_type		normal 
own_window_hints	undecorated,below,skip_taskbar,skip_pager 
own_window_argb_visual  yes
# own_window_argb_value 255
# следующие параметры можно изменять
# минимальный размер
minimum_size 400 0 
# минимальная ширина
#maximum_width 400 
# --- расположение окна
# левый верхний угол экрана 
alignment top_left 
# левый нижний угол экрана
#alignment bottom_left 
# правый верхний угол экрана
#alignment top_right 
# правый нижний угол экрана
#alignment bottom_right 
# расстояние между кромкой экрана и окном
# по горизонтали
gap_x 30 
# по вертикали
gap_y 50 

# --- графика окна --- 
# если желаете выводить conky на другом фоне напишите yes
background no 
# окантовка окна, бордюр
draw_borders no

# если бордюр yes
# длина штрихов бордюра, если 0, то бордюр выводится сплошной линией
stippled_borders 1
# толщина линий бордюра 
border_width 1
# поле бордюра 
border_inner_margin 20 
# бордюр вокруг выводимых графиков
draw_graph_borders no
# включить тень?
draw_shades no
# окантовка вокруг текста и выводимых объектов
draw_outline no 
# Добавить пробел?  Только для встраиваемых объектов 
use_spacer right 

# --- цвет ---
# основной цвет по умолчанию 
default_color DeepSkyBlue
# цвет тени
default_shade_color black 
# цвет окантовки
default_outline_color black
# дополнительные
color1 white
color2 yellow 
color3 red 

# --- шрифты ---
# используемые шрифты X когда Xft не используется, можно выбрать один из следующих 
#font 5x7 
#font 6x10 
#font 7x13 
#font 8x13 
#font 9x15 
#font *mintsmild.se* 
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-* 

# Используется ли Xft? 
use_xft yes 

# Шриф Xft когда Xft доступен, здесь можно ввести название и размер любого шрифта 
xftfont D3 Roadsterism Long Italic:size=9 

# яркость шрифта при испоьзовании шрифтов Xft 
xftalpha 0.5 
# выводить весь текст прописными буквами 
uppercase no 
# использовать кодировку UTF8? ПРИМЕЧАНИЕ: требуется Xft 
override_utf8_locale yes 

# --- следующие данные необходимы для работы
# обновление в секундах не имеет смысла ставить больше 2
# при выводе времени в секундах необходимо значение 1 и менее
update_interval 1.0 
# время работы программы до её выключения
# установите 0 для работы программы без остановки
total_run_times 0
# двойная буфферизация (требуется для flicker, может не работать) 
double_buffer yes 
# вычитать буферизацию файловой системы из используемой памяти? 
no_buffers yes 
# количество cpu
cpu_avg_samples 2
# number of net samples to average 
net_avg_samples 2 
imlib_cache_size 0 
short_units yes 
pad_percents 2 
text_buffer_size 2048 
imlib_cache_size 0 
#--- LUA ---
lua_load /media/DATEN/francescoPC/Conky/Olgmen/Schief/rotate_clock.lua
lua_draw_hook_pre widgets

TEXT
${voffset 450}

rotate_clock.lua

--[[
Conky Widgets by olgmen (2010)

Скрипт позволяет выводить в окно CONKY часы

для запуска необходимо ввести до TEXT сдедующие строки

#--- LUA ---
lua_load ~/scripts/rotate_clock.lua
lua_draw_hook_pre widgets

при условии, что скрипт rotate_clock.lua сохранен в папке ~/scripts
]]

require 'cairo'

--[[ CLOCK WIDGET ]]

function clock(cr, x, y, s, bgc, bga, fgc, fga)

-- функция перекодировки цвета

	function rgb_to_r_g_b(colour,alpha)
		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
	end
		-- назначаем толщину выводимых линий

		local s_th = 2

		-- перехватываем данные часы, минуты, секунды

		local hours=os.date("%I")
		local mins=os.date("%M")
		local secs=os.date("%S")
	
		-- назначаем максимальные значения

		secs_arc=(2*math.pi/60)*secs
		mins_arc=(2*math.pi/60)*mins
		hours_arc=(2*math.pi/12)*hours+mins_arc/12

		-- рисуем циферблат

		local radius = s/2	
		local m_x,m_y = x + s/2, y + s/2
		cairo_set_line_width(cr,6)

		-- поворот циферблата

		cairo_rotate (cr, 30*math.pi/180)

		-- элипс первая цифра - ширина, вторая - высота

		cairo_scale (cr, 0.6, 1)

		-- рисуем циферблат

		cairo_arc(cr, m_x,m_y, radius, 0, math.rad(360))
		cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
		cairo_fill_preserve(cr)
		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
		cairo_stroke(cr)

		-- прозрачный "корпус часов"
	
		cairo_arc(cr, m_x, m_y, radius*1.25, 0, 2*math.pi)
		cairo_set_source_rgba(cr, 0.5, 0.5, 0.5, 0.8)
		cairo_set_line_width(cr,1)
		cairo_stroke(cr)
	
		local border_pat=cairo_pattern_create_linear(m_x, m_y - radius*1.25, m_x, m_y + radius*1.25)
	
		cairo_pattern_add_color_stop_rgba(border_pat,0,0,0,0,0.7)
		cairo_pattern_add_color_stop_rgba(border_pat,0.3,1,1,1,0)
		cairo_pattern_add_color_stop_rgba(border_pat,0.5,1,1,1,0)
		cairo_pattern_add_color_stop_rgba(border_pat,0.7,1,1,1,0)
		cairo_pattern_add_color_stop_rgba(border_pat,1,0,0,0,0.7)
		cairo_set_source(cr,border_pat)
		cairo_arc(cr, m_x, m_y, radius*1.125, 0, 2*math.pi)
		cairo_close_path(cr)
		cairo_set_line_width(cr, radius*0.25)
		cairo_stroke(cr)

		-- вывод часовых делений

		local i = 0
		local winkel = math.rad(30)		
		
		for i=0,11,1 do
		cairo_set_line_width(cr,s_th*1.5)
		cairo_move_to(cr, m_x-math.sin(winkel*i)*(radius*1.5), m_y-math.cos(winkel*i)*(radius*1.5))
		cairo_line_to(cr, m_x-math.sin(winkel*i)*(radius*0.9), m_y-math.cos(winkel*i)*(radius*0.9))
		cairo_fill_preserve(cr)
		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
		cairo_stroke(cr)
		end

		-- вывод минутных делений

		local i = 0
		local winkel = math.rad(6)

		for i=0,59,1 do
		cairo_set_line_width(cr,1)
		cairo_move_to(cr, m_x-math.sin(winkel*i)*radius, m_y-math.cos(winkel*i)*radius)
		cairo_line_to(cr, m_x-math.sin(winkel*i)*(radius*0.9), m_y-math.cos(winkel*i)*(radius*0.9))
		cairo_stroke(cr)
		end

		-- рисуем деления 3, 6, 9 и 12 часовые

		cairo_set_line_width(cr,s_th/2)			-- устанавливаем толщину линий
		cairo_move_to (cr, x + 0.15*s, y + 0.5*s)
		cairo_line_to (cr, x + 0.45*s, y + 0.5*s)
		cairo_move_to (cr, x + 0.55*s, y + 0.5*s)
		cairo_line_to (cr, x + 0.85*s, y + 0.5*s)
		cairo_move_to (cr, x + 0.5*s, y + 0.15*s)
		cairo_line_to (cr, x + 0.5*s, y + 0.45*s)
		cairo_move_to (cr, x + 0.5*s, y + 0.55*s)
		cairo_line_to (cr, x + 0.5*s, y + 0.85*s)
		cairo_stroke(cr)


		-- ОКНО ВЫВОДА ДАТЫ

		-- задаем размер окна

		local wo = s/5
		local ho = s/12
		local ro = (wo+ho)/2*0.04
		local xo = x+0.2*s
		local yo = y+0.45*s
		-- рисуем окно
		cairo_move_to(cr, xo + ro, yo)
		cairo_line_to(cr, xo + wo - ro, yo)
		cairo_arc(cr, xo + wo - ro, yo + ro, ro, -math.pi/2,0)
		cairo_line_to(cr, xo + wo, yo + ho - ro)
		cairo_arc(cr, xo + wo - ro, yo + ho - ro, ro, 0, math.pi/2)
		cairo_line_to(cr, xo + ro, yo + ho)
		cairo_arc(cr, xo + ro, yo + ho - ro, ro, math.pi/2, math.pi)
		cairo_line_to(cr, xo, yo + ro)
		cairo_arc(cr, xo + ro, yo + ro, ro, math.pi, math.pi*1.5)
		-- закрашиваем в черный цвет
		cairo_set_source_rgba(cr, 0,0,0,0.1)
		cairo_fill(cr)
		-- выводим в окно дату
		local value = conky_parse("${time %b}")
		cairo_set_font_size(cr, (ho - 2 * ro)*(15/11))
		cairo_move_to(cr, xo + ro, yo + ho - ro)
		-- задаем белый цвет цифрам даты
		cairo_set_source_rgba(cr, 1, 1, 1, 1)
		cairo_show_text(cr, value)

		-- задаем размер окна

		local wo = s/6
		local ho = s/12
		local ro = (wo+ho)/2*0.04
		local xo = x+0.62*s
		local yo = y+0.45*s
		-- рисуем окно
		cairo_move_to(cr, xo + ro, yo)
		cairo_line_to(cr, xo + wo - ro, yo)
		cairo_arc(cr, xo + wo - ro, yo + ro, ro, -math.pi/2,0)
		cairo_line_to(cr, xo + wo, yo + ho - ro)
		cairo_arc(cr, xo + wo - ro, yo + ho - ro, ro, 0, math.pi/2)
		cairo_line_to(cr, xo + ro, yo + ho)
		cairo_arc(cr, xo + ro, yo + ho - ro, ro, math.pi/2, math.pi)
		cairo_line_to(cr, xo, yo + ro)
		cairo_arc(cr, xo + ro, yo + ro, ro, math.pi, math.pi*1.5)
		-- закрашиваем в черный цвет
		cairo_set_source_rgba(cr, 0,0,0,0)
		cairo_fill(cr)

		-- выводим в окно дату
		local value = conky_parse("${time %d}")
		cairo_set_font_size(cr, (ho - 2 * ro)*(15/11))
		cairo_move_to(cr, xo + ro, yo + ho - ro)
		-- задаем белый цвет цифрам даты
		cairo_set_source_rgba(cr, 1, 1, 1, 1)
		cairo_show_text(cr, value)

		local clock_r = s/2
		local xc = x + s/2
		local yc = y + s/2
	
		-- вывод часовой стрелки

		xh=xc+0.55*clock_r*math.sin(hours_arc)
		yh=yc-0.55*clock_r*math.cos(hours_arc)
		cairo_move_to(cr,xc,yc)
		cairo_line_to(cr,xh,yh)
		cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
		cairo_set_line_width(cr,6)
		cairo_set_source_rgba(cr, 0, 0, 1, 1)
		cairo_stroke(cr)

		-- вывод минутной стрелки
	
		xm=xc+0.7*clock_r*math.sin(mins_arc)
		ym=yc-0.7*clock_r*math.cos(mins_arc)
		cairo_move_to(cr,xc,yc)
		cairo_line_to(cr,xm,ym)
		cairo_set_line_width(cr,4)
		cairo_stroke(cr)

		-- вывод секундной стрелки
	
		xs=xc+0.75*clock_r*math.sin(secs_arc)
		ys=yc-0.75*clock_r*math.cos(secs_arc)
		cairo_move_to(cr,xc,yc)
		cairo_line_to(cr,xs,ys)
		cairo_set_line_width(cr,2)
		cairo_set_source_rgba(cr, 1, 0, 0, 1)
		cairo_stroke(cr)
		-- рисуем ось стрелок
		cairo_arc (cr, xc, yc, s*0.02, 0, 2*math.pi)
		cairo_fill (cr)

		-- глянец

		local h1 = s/2.5
		cairo_move_to(cr, x + radius, y)
		cairo_line_to(cr, x + s - radius, y)
		cairo_arc(cr, x + s - radius, y + radius, radius, -math.pi/2, 0)
		cairo_line_to(cr, x + s, y + h1)
		cairo_curve_to(cr, x + 3 * s/4, y + 1.3 * h1, x + s/4, y + 1.3 * h1, x, y + h1)
		cairo_line_to(cr, x, y + radius)
		cairo_arc(cr, x + radius, y + radius, radius, math.pi, math.pi * 1.5)
		cairo_set_source_rgba(cr, 1, 1, 1, 0.2)
		cairo_fill(cr)

end
--[[ END CLOCK ]]

--------------------------------
function conky_widgets()
	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)

---------------------------------
	
--[[ CLOCK ]]

	cr = cairo_create(cs)
	clock(cr, 500, -50, 200, 0x151515, 0.2, 0x606070, 0.9)
 
--          опции: x,  y,   s, bgc, bga, fgc, fga
--		"x" координаты по горизонтали центра часов
--		"y" координаты по вертикали центра часов
--		"s" диаметр часов
--		"bgc" цвет фона
--		"bga" яркость фона
--		"fgc" цвет графики
--		"fga" яркость графики

	cairo_destroy(cr)

end 

Thanks!

Last edited by unklar (2016-06-13 20:49:14)

Offline

#78 2016-04-04 18:17:41

damo
....moderator....
Registered: 2015-08-20
Posts: 5,977

Re: Conky - Calendars / Clocks / Time

Do you mean that the whole clock should rotate, or just the hands? The hands go round fine for me.

Have you set the correct lua path for your system? Is the one in the conkyrc yours, or the original?

lua_load /media/DATEN/francescoPC/Conky/Olgmen/Schief/rotate_clock.lua

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#79 2016-04-04 19:14:08

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

Re: Conky - Calendars / Clocks / Time

It's working fine here.
FGAnrNit.jpg tIBthHoS.jpg Xe9PBzox.jpg h7CEW8aa.jpg 7Axsx5QO.jpg

First I put a box around, to see the conky window limits, it and made it a bit bigger:

minimum_size 500 0

Then I played with the поворот циферблата (Rotation dial) :

		-- поворот циферблата
		-- Rotation dial

--		cairo_rotate (cr, 15*math.pi/180)
--		cairo_rotate (cr, 20*math.pi/180)
--		cairo_rotate (cr, 25*math.pi/180)
--		cairo_rotate (cr, 30*math.pi/180) -- original
--		cairo_rotate (cr, 35*math.pi/180)
--		cairo_rotate (cr, 40*math.pi/180)
--		cairo_rotate (cr, 45*math.pi/180)
--		cairo_rotate (cr, 50*math.pi/180)
--		cairo_rotate (cr, 55*math.pi/180)
		cairo_rotate (cr, 60*math.pi/180)

The clock does not 'rotate' by itself.  But one can rotate it between ±15° and ±60° on an axis in the conky window and still see it.

Interesting script.  Nice find unklar.

With a bigger window and a full circle one could probably get it going a full 360°, but an upside down clock ????


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

Offline

#80 2016-04-04 19:50:52

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

Re: Conky - Calendars / Clocks / Time

Ok, then I misunderstood the ...

@damo, the original path to the script is:

lua_load ~/scripts/rotate_clock.lua
lua_draw_hook_pre widgets

@S11,
of course is not standing upside down the clock. I assumed it rotates by itself like a top.
http://www.amazon.de/Brummkreisel-Spiel … B0058BDNWI

Offline

#81 2016-04-04 20:30:29

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

Re: Conky - Calendars / Clocks / Time

lol  lol  lol Gotta love a man with a sense of humour.

At least it works and it's a nice twist to a clock.  KUDOS to Boris wherever he is.

I cannot tell a lie - I thought the clock would rotate by itself as well when I read your post.
Then I saw the: -- Rotation dial - AHA!


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

Offline

#82 2016-04-10 22:42:18

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

Re: Conky - Calendars / Clocks / Time

Went looking through a few archives today and found this interesting clock drawn with one of Wlourf's lua scripts.
2016_04_10_19_19_48_Scrot11.jpg  A closeup: 2016_04_10_19_20_02_Scrot11.jpg

The conky

## pkill -xf "conky -q -c /media/5/Conky/S11.clock.conky" &

## ---------- Begin Window Settings
own_window yes
own_window_type normal
own_window_transparent no
#own_window_hints skip_taskbar,skip_pager ## ,sticky,undecorated
own_window_hints skip_taskbar,skip_pager,undecorated,below #,sticky
own_window_colour 000000
own_window_class Conky
own_window_title Test conky
## ARGB can be used for real transparency
  own_window_argb_visual yes ## Options: yes or no
## Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
  own_window_argb_value 0

gap_x 10	## l|r
gap_y 10	## u|d
alignment tl

maximum_width 155
minimum_size 155 155
## ---------- End Window Settings

## ---------- Font Settings
## Force UTF8? requires XFT
override_utf8_locale yes

## Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Liberation Mono:bold:size=10
xftfont Fantasque Sans Mono:bold:size=11
#xftfont Monofur:bold:size=10
#xftfont DejaVu Sans Mono:bold:size=10

## Alpha of Xft font. Must be a value at or between 1 and 0
xftalpha 1.0
## --------- End Font Settings

## --------- Color Settings
draw_shades no
default_shade_color 000000
draw_outline no
default_outline_color 000000

default_color DCDCDC #Gainsboro
color0 98FB98 #PaleGreen
color1 778899 #LightSlateGray
color2 FFD700 #Gold
color3 B0E0E6 #PowderBlue
color4 F4A460 #SandyBrown
color5 DEB887 #BurlyWood
color6 00BFFF #DeepSkyBlue
color7 5F9EA0 #CadetBlue
color8 FFA500 #Orange
color9 FF4500 #OrangeRed
## ---------- End Color Settings

## ---------- Begin Borders Section
draw_borders no
## Stippled borders?
stippled_borders 5
## border margins
border_inner_margin 5
border_outer_margin 0
## border width
border_width 2
## graph borders
draw_graph_borders no
## default_graph_size 15 40
## ---------- End Borders Secton

## ---------- Begin Miscellaneous Section
## Boolean value, if true, Conky will be forked to background when started.
background no

## Adds spaces around certain objects to stop them from moving other things
## around, this only helps if you are using a mono font
## Options: right, left or none
use_spacer none

## Subtract (file slystem) buffers from used memory?
no_buffers yes

## Use the Xdbe extension? (eliminates flicker)
## It is highly recommended to use own window with this one
## so double buffer won't be so big.
double_buffer yes

## ---------- End Miscellaneous Section
## ---------- Begin LUA section
## ---------- Change /path/to/lua/script/name.lua as required
lua_load /media/5/Conky/LUA/clock.box.lua
lua_draw_hook_pre main_box
## ---------- End LUA section

update_interval 1
TEXT
${voffset 36}${goto 40}${color 000000}TIME\
${goto 80}${color}${time %z}
${voffset 7}${alignc}${color 000000}${time %T}
${voffset 16}${goto 40}${color 000000}DATE\
${voffset 0}${goto 77}${color}${time %a}${goto 108}${time %w}
${voffset 7}${alignc}${color 000000}${time  %F}${font}

The lua script: clock.box.lua

--[[ BOX WIDGET v1.1 by Wlourf 27/01/2011
This widget can drawn some boxes, even circles in your conky window
http://u-scripts.blogspot.com/2011/01/box-widget.html)

Inspired by Background by londonali1010 (2009), thanks ;-)

The parameters (all optionals) are :
x           - x coordinate of top-left corner of the box, default = 0 = (top-left corner of conky window)
y           - y coordinate of top-left corner of the box, default = 0 = (top-left corner of conky window)
w           - width of the box, default = width of the conky window
h           - height of the box, default = height of the conky window
corners     - corners is a table for the four corners in this order : top-left, top-right,bottom-right, bottom-left
              each corner is defined in a table with a shape and a radius, available shapes are : "curve","circle","line"
              example for the same shapes for all corners:
              { {"circle",10} }
              example for first corner different from the three others
              { {"circle",10}, {"circle",5}  }
              example for top corners differents from bottom corners
              { {"circle",10}, {"circle",10}, {"line",0}  }
              default = { {"line",0} } i.e=no corner
operator    - set the compositing operator (needs in the conkyrc : own_window_argb_visual yes)
              see http://cairographics.org/operators/
              available operators are :
              "clear","source","over","in","out","atop","dest","dest_over","dest_in","dest_out","dest_atop","xor","add","saturate"
              default = "over"
border      - if border>0, the script draws only the border, like a frame, default=0
dash        - if border>0 and dash>0, the border is draw with dashes, default=0
skew_x      - skew box around x axis, default = 0
skew_y      - skew box around y axis, default = 0
scale_x     - rescale the x axis, default=1, useful for drawing elipses ...
scale_y     - rescale the x axis, default=1
angle	    - angle of rotation of the box in degrees, default = 0
              i.e. a horizontal graph
rot_x       - x point of rotation's axis, default = 0,
              relative to top-left corner of the box, (not the conky window)
rot_y       - y point of rotation's axis, default = 0
              relative to top-left corner of the box, (not the conky window)
draw_me     - if set to false, box is not drawn (default = true or 1)
              it can be used with a conky string, if the string returns 1, the box is drawn :
              example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",

linear_gradient - table with the coordinates of two points to define a linear gradient,
                  points are relative to top-left corner of the box, (not the conky window)
                  {x1,y1,x2,y2}
radial_gradient - table with the coordinates of two circle to define a radial gradient,
                  points are relative to top-left corner of the box, (not the conky window)
                  {x1,y1,r1,x2,y2,r2} (r=radius)
colour      - table of colours, default = plain white {{1,0xFFFFFF,0.5}}
              this table contains one or more tables with format {P,C,A}
              P=position of gradient (0 = start of the gradient, 1= end of the gradient)
              C=hexadecimal colour
              A=alpha (opacity) of color (0=invisible,1=opacity 100%)
              Examples :
              for a plain color {{1,0x00FF00,0.5}}
              for a gradient with two colours {{0,0x00FF00,0.5},{1,0x000033,1}}        {x=80,y=150,w=20,h=20,
        radial_gradient={20,20,0,20,20,20},
        colour={{0.5,0xFFFFFF,1},{1,0x000000,0}},
              or {{0.5,0x00FF00,1},{1,0x000033,1}} -with this one, gradient will start in the middle
              for a gradient with three colours {{0,0x00FF00,0.5},{0.5,0x000033,1},{1,0x440033,1}}
              and so on ...

To call this script in Conky, use (assuming you have saved this script to ~/scripts/):
    lua_load ~/scripts/box.lua
    lua_draw_hook_pre main_box

And leave one line blank or not after TEXT

Changelog:
+ v1.0 -- Original release (19.12.2010)
+ v1.1 -- Adding parameters: operator, dash, angle, skew_x, skew_y, draw_me
          corners are described in a table

--      This program is free software; you can redistribute it and/or modify
--      it under the terms of the GNU General Public License as published by
--      the Free Software Foundation version 3 (GPLv3)
--
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warranty of
--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--      GNU General Public License for more details.
--
--      You should have received a copy of the GNU General Public License
--      along with this program; if not, write to the Free Software
--      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
--      MA 02110-1301, USA.
--]]

require 'cairo'
function conky_main_box()
    if conky_window==nil then return end

	---------------------- PARAMETERS BEGIN HERE
    local boxes_settings={
        {x=5,y=5,w=160,h=160, colour= { {0,0xFFFFFF,0.7}, {1,0x353535,0.7} }, radial_gradient= {100,20,50,100,0,200},
        corners = { {"circle",80} },},
        {x=15,y=15,w=140,h=140, colour= { {0,0xfefefe,0.5}, {1,0x353535,0.8} }, radial_gradient= {90,200,40,90,110,130},
        corners = { {"circle",55} },},
        {x=30,y=30,w=110,h=110, colour= { {0,0xFFFFFF,0.4}, {0,0xfefefe,0.3}, }, linear_gradient= {60,60,20,100},
        corners = { {"circle",30} },},
        --border
        {x=15, y=15,w=140,h=140, colour= { {0,0xFFFFFF,0.4}, },
        corners={ {"circle",55} },
        border= 1
        },
        {x=16, y=16,w=138,h=138, colour= { {0,0x000000,0.3}, },
        corners={ {"circle",55} },
        border= 2
        },
        {x=30, y=30,w=110,h=110, colour= { {0,0xFFFFFF,0.5}, },
        corners={ {"circle",29} },
        border= 1
        },
        {x=28, y=28,w=114,h=114, colour= { {0,0x000000,0.2}, },
        corners={ {"circle",30} },
        border= 2
        },
        {x=5, y=5,w=160,h=160, colour= { {0,0x000000,0.2}, },
        corners={ {"circle",80} },
        border= 2
        },
        {x=7, y=7,w=156,h=156, colour= { {0,0xFFFFFF,0.2}, },
        corners={ {"circle",80} },
        border= 1
        },
        {x=75, y=93,w=50,h=20, colour= { {0,0x353535,0.3}, },
        corners={ {"circle",3} },
        },
        {x=74, y=92,w=52,h=22, colour= { {0,0xFFFFFF,0.5}, },
        corners={ {"circle",3} },
        border= 1
        },
        {x=75, y=41,w=50,h=20, colour= { {0,0x353535,0.3}, },
        corners={ {"circle",3} },
        },
        {x=74, y=40,w=52,h=22, colour= { {0,0xFFFFFF,0.5}, },
        corners={ {"circle",3} },
        border= 1
        },
        {x=100, y=93,w=2,h=20, colour= { {0,0xfefefe,0.3}, },
        corners={ {"circle",0} },
        },
        {x=29, y=85,w=112,h=1, colour= { {0,0x353535,0.4}, },
        corners={ {"circle",0} },
        },
        {x=31, y=83,w=108,h=5, colour= { {0,0xFFFFFF,0.2}, },
        corners={ {"circle",0} },
        },
    }
    ---------------------------- PARAMETERS END HERE

    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 tonumber(conky_parse("$updates"))<5 then return end
    for i in pairs(boxes_settings) do
        draw_box (cr,boxes_settings[i])
    end
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
end

function draw_box(cr,t)

	if t.draw_me == true then t.draw_me = nil end
	if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end

    local table_corners={"circle","curve","line"}

    local t_operators={
        clear   = CAIRO_OPERATOR_CLEAR,
        source  = CAIRO_OPERATOR_SOURCE,
        over    = CAIRO_OPERATOR_OVER,
        ["in"]      = CAIRO_OPERATOR_IN,
        out     = CAIRO_OPERATOR_OUT,
        atop    = CAIRO_OPERATOR_ATOP,
        dest    = CAIRO_OPERATOR_DEST,
        dest_over   = CAIRO_OPERATOR_DEST_OVER,
        dest_in = CAIRO_OPERATOR_DEST_IN,
        dest_out = CAIRO_OPERATOR_DEST_OUT,
        dest_atop = CAIRO_OPERATOR_DEST_ATOP,
        xor = CAIRO_OPERATOR_XOR,
        add = CAIRO_OPERATOR_ADD,
        saturate =  CAIRO_OPERATOR_SATURATE,
    }

    function rgba_to_r_g_b_a(tc)
        --tc={position,colour,alpha}
        local colour = tc[2]
        local alpha = tc[3]
        return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end

    function table.copy(t)
      local t2 = {}
      for k,v in pairs(t) do
       t2[k] = {v[1],v[2]}
      end
      return t2
    end

    function draw_corner(num,t)
        local shape=t[1]
        local radius=t[2]
        local x,y = t[3],t[4]
        if shape=="line" then
            if num == 1 then cairo_line_to(cr,radius,0)
                elseif num == 2 then cairo_line_to(cr,x,radius)
                elseif num == 3 then cairo_line_to(cr,x-radius,y)
                elseif num == 4 then cairo_line_to(cr,0,y-radius)
            end
        end
        if shape=="circle" then
		    local PI = math.pi
           if num == 1 then cairo_arc(cr,radius,radius,radius,-PI,-PI/2)
                elseif num == 2 then cairo_arc(cr,x-radius,y+radius,radius,-PI/2,0)
                elseif num == 3 then cairo_arc(cr,x-radius,y-radius,radius,0,PI/2)
                elseif num == 4 then cairo_arc(cr,radius,y-radius,radius,PI/2,-PI)
            end
        end
        if shape=="curve" then
            if num == 1 then cairo_curve_to(cr,0,radius ,0,0 ,radius,0)
                elseif num == 2 then cairo_curve_to(cr,x-radius,0, x,y, x,radius)
                elseif num == 3 then cairo_curve_to(cr,x,y-radius, x,y, x-radius,y)
                elseif num == 4 then cairo_curve_to(cr,radius,y, x,y, 0,y-radius)
            end
        end
    end

    --check values and set default values
    if t.x == nil then t.x = 0 end
    if t.y == nil then t.y = 0 end
    if t.w == nil then t.w = conky_window.width end
    if t.h == nil then t.h = conky_window.height end
    if t.radius == nil then t.radius = 0 end
    if t.border == nil then t.border = 0 end
    if t.colour==nil then t.colour={{1,0xFFFFFF,0.5}} end
    if t.linear_gradient ~= nil then
        if #t.linear_gradient ~= 4 then
            t.linear_gradient = {t.x,t.y,t.width,t.height}
        end
    end
    if t.angle==nil then t.angle = 0 end

	if t.skew_x == nil then t.skew_x=0  end
	if t.skew_y == nil then  t.skew_y=0 end
	if t.scale_x==nil then t.scale_x=1 end
	if t.scale_y==nil then t.scale_y=1 end
	if t.rot_x == nil then t.rot_x=0  end
	if t.rot_y == nil then  t.rot_y=0 end

    if t.operator == nil then t.operator = "over" end
    if (t_operators[t.operator]) == nil then
        print ("wrong operator :",t.operator)
        t.operator = "over"
    end

    if t.radial_gradient ~= nil then
        if #t.radial_gradient ~= 6 then
            t.radial_gradient = {t.x,t.y,0, t.x,t.y, t.width}
        end
    end

    for i=1, #t.colour do
        if #t.colour[i]~=3 then
            print ("error in color table")
            t.colour[i]={1,0xFFFFFF,1}
        end
    end

    if t.corners == nil then t.corners={ {"line",0} } end
    local t_corners = {}
    local t_corners = table.copy(t.corners)
    --don't use t_corners=t.corners otherwise t.corners is altered

    --complete the t_corners table if needed
    for i=#t_corners+1,4 do
        t_corners[i]=t_corners[#t_corners]
        local flag=false
        for j,v in pairs(table_corners) do flag=flag or (t_corners[i][1]==v) end
        if not flag then print ("error in corners table :",t_corners[i][1]);t_corners[i][1]="curve"  end
    end

    --this way :
    --    t_corners[1][4]=x
    --    t_corners[2][3]=y
    --doesn't work
    t_corners[1]={t_corners[1][1],t_corners[1][2],0,0}
    t_corners[2]={t_corners[2][1],t_corners[2][2],t.w,0}
    t_corners[3]={t_corners[3][1],t_corners[3][2],t.w,t.h}
    t_corners[4]={t_corners[4][1],t_corners[4][2],0,t.h}

    t.no_gradient = (t.linear_gradient == nil ) and (t.radial_gradient == nil )

    cairo_save(cr)
    cairo_translate(cr, t.x, t.y)
    if t.rot_x~=0 or t.rot_y~=0 or t.angle~=0 then
        cairo_translate(cr,t.rot_x,t.rot_y)
        cairo_rotate(cr,t.angle*math.pi/180)
        cairo_translate(cr,-t.rot_x,-t.rot_y)
    end
    if t.scale_x~=1 or t.scale_y~=1 or t.skew_x~=0 or t.skew_y~=0 then
	    local matrix0 = cairo_matrix_t:create()
	    tolua.takeownership(matrix0)
	    cairo_matrix_init (matrix0, t.scale_x,math.pi*t.skew_y/180	, math.pi*t.skew_x/180	,t.scale_y,0,0)
	    cairo_transform(cr,matrix0)
    end

    local tc=t_corners
    cairo_move_to(cr,tc[1][2],0)
    cairo_line_to(cr,t.w-tc[2][2],0)
    draw_corner(2,tc[2])
    cairo_line_to(cr,t.w,t.h-tc[3][2])
    draw_corner(3,tc[3])
    cairo_line_to(cr,tc[4][2],t.h)
    draw_corner(4,tc[4])
    cairo_line_to(cr,0,tc[1][2])
    draw_corner(1,tc[1])

    if t.no_gradient then
        cairo_set_source_rgba(cr,rgba_to_r_g_b_a(t.colour[1]))
    else
        if t.linear_gradient ~= nil then
            pat = cairo_pattern_create_linear (t.linear_gradient[1],t.linear_gradient[2],t.linear_gradient[3],t.linear_gradient[4])
        elseif t.radial_gradient ~= nil then
            pat = cairo_pattern_create_radial (t.radial_gradient[1],t.radial_gradient[2],t.radial_gradient[3],
            	t.radial_gradient[4],t.radial_gradient[5],t.radial_gradient[6])
        end
        for i=1, #t.colour do
            cairo_pattern_add_color_stop_rgba (pat, t.colour[i][1], rgba_to_r_g_b_a(t.colour[i]))
        end
        cairo_set_source (cr, pat)
        cairo_pattern_destroy(pat)
    end

    cairo_set_operator(cr,t_operators[t.operator])

    if t.border>0 then
        cairo_close_path(cr)
        if t.dash ~= nil then cairo_set_dash(cr, t.dash, 1, 0.0) end
        cairo_set_line_width(cr,t.border)
        cairo_stroke(cr)
    else
        cairo_fill(cr)
    end

    cairo_restore(cr)
end

Enjoy!


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

Offline

#83 2016-04-18 12:15:13

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

Re: Conky - Calendars / Clocks / Time

@Sector11,

works very well.

where you can change the color of the clock?
I would like to have different blue tones.  cool

Offline

#84 2016-04-18 14:52:44

damo
....moderator....
Registered: 2015-08-20
Posts: 5,977

Re: Conky - Calendars / Clocks / Time

unklar wrote:

@Sector11,

works very well.

where you can change the color of the clock?
I would like to have different blue tones.  cool

colour      - table of colours, default = plain white {{1,0xFFFFFF,0.5}}
              this table contains one or more tables with format {P,C,A}
              P=position of gradient (0 = start of the gradient, 1= end of the gradient)
              C=hexadecimal colour
              A=alpha (opacity) of color (0=invisible,1=opacity 100%)
              Examples :
              for a plain color {{1,0x00FF00,0.5}}
              for a gradient with two colours {{0,0x00FF00,0.5},{1,0x000033,1}}        {x=80,y=150,w=20,h=20,
        radial_gradient={20,20,0,20,20,20},
        colour={{0.5,0xFFFFFF,1},{1,0x000000,0}},
              or {{0.5,0x00FF00,1},{1,0x000033,1}} -with this one, gradient will start in the middle
              for a gradient with three colours {{0,0x00FF00,0.5},{0.5,0x000033,1},{1,0x440033,1}}
              and so on ...

Change the values of "colour={   }" in the lua, as required.

For example, Find & Replace:
353535 with 1A7CB0
FFFFFF with 9FDAF

Last edited by damo (2016-04-18 15:00:21)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#85 2016-04-18 15:31:18

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

Re: Conky - Calendars / Clocks / Time

unklar wrote:

@Sector11,

where you can change the color of the clock?

To add to what damo said:

In the LUA script under:     ---------------------- PARAMETERS BEGIN HERE

My recommendation is to comment out the original lines and make test lines to test with and add comment lines to explain what they are.  IE:
2016_04_18_12_16_11_Scrot11.jpg

	---------------------- PARAMETERS BEGIN HERE
    local boxes_settings={
--        {x=5,y=5,w=160,h=160, colour= { {0,0xFFFFFF,0.7}, {1,0x353535,0.7} }, radial_gradient= {100,20,50,100,0,200}, -- ursprünglich
        {x=5,y=5,w=160,h=160, colour= { {0,0xB0C4DE,0.7}, {1,0xADD8E6,0.7} }, radial_gradient= {100,20,50,100,0,200},  -- ADD8E6  #173 216 230  LightBlue
        corners = { {"circle",80} },},
		-- clock "crystal" - glass over face of clock
--        {x=15,y=15,w=140,h=140, colour= { {0,0xfefefe,0.5}, {1,0x353535,0.8} }, radial_gradient= {90,200,40,90,110,130}, -- ursprünglich
        {x=15,y=15,w=140,h=140, colour= { {0,0x00bb00,0.5}, {1,0x353535,0.8} }, radial_gradient= {90,200,40,90,110,130}, -- green colour
        corners = { {"circle",55} },},
        {x=30,y=30,w=110,h=110, colour= { {0,0xFFFFFF,0.4}, {0,0xfefefe,0.3}, }, linear_gradient= {60,60,20,100},
        corners = { {"circle",30} },},
        --border
--        {x=15, y=15,w=140,h=140, colour= { {0,0xFFFFFF,0.4}, }, -- ursprünglich
        {x=15, y=15,w=140,h=140, colour= { {0,0xFFD700,0.9}, },  -- FFD700  #255 215   0  Gold
        corners={ {"circle",55} },
        border= 1
        },
--        {x=16, y=16,w=138,h=138, colour= { {0,0x000000,0.3}, }, -- ursprünglich
        {x=16, y=16,w=138,h=138, colour= { {0,0x008080,0.9}, }, -- 008080  #  0 128 128  Teal
        corners={ {"circle",55} },
        border= 2
        },
--        {x=30, y=30,w=110,h=110, colour= { {0,0xFFFFFF,0.5}, }, -- ursprünglich
        {x=30, y=30,w=110,h=110, colour= { {0,0x8b0000,0.5}, }, -- 8B0000  #139   0   0  DarkRed
        corners={ {"circle",29} },
        border= 1
        },
--        {x=28, y=28,w=114,h=114, colour= { {0,0x000000,0.2}, }, -- ursprünglich
        {x=28, y=28,w=114,h=114, colour= { {0,0x000000,0.2}, }, --
        corners={ {"circle",30} },
        border= 2
        },
        {x=5, y=5,w=160,h=160, colour= { {0,0x000000,0.2}, }, -- ursprünglich
        corners={ {"circle",80} },

wlourf was kind enough to have his code use the same hex colour codes that conky uses so it is 'almost' as easy as using colours in conky.


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

Offline

#86 2016-04-19 08:03:55

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

Re: Conky - Calendars / Clocks / Time

halbrund1.jpg

A first attempt  big_smile

Thank you guys. This forum is in its helpfulness top.  kiss

Offline

#87 2016-04-19 15:25:35

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

Re: Conky - Calendars / Clocks / Time

Nice - and in my favourite colours too.

I can see it now:

  • clock.box.grey.lua

  • clock.box.red.lua

  • clock.box.green.lua

  • clock.box.blue.lua

  • clock.bo...

for different wallpapers.


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

Offline

#88 2016-06-08 23:51:17

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

Re: Conky - Calendars / Clocks / Time

A new twist to a monthly calendar.  The white number in the day name line will always be on the current day and reflects the week # for the year.
2016_06_08_20_44_48_Scrot11.jpg

Code: monofont required - your spacing may vary.

${alignc}${color5}${time %T}
${alignc}${time %b %Y}${color}
${alignc}${if_match ${time %w}==0}${color5}${time %U}${color1} Mo Tu We Th Fr Sa${else}\
${if_match ${time %w}==1}${color1}Su ${color5}${time %U}${color1} Tu We Th Fi Sa${else}\
${if_match ${time %w}==2}${color1}Su Mo ${color5}${time %U}${color1} We Th Fr Sa${else}\
${if_match ${time %w}==3}${color1}Su Mo Tu ${color}${time %U}${color1} Th Fr Sa${else}\
${if_match ${time %w}==4}${color1}Su Mo Tu We ${color5}${time %U}${color1} Fr Sa${else}\
${if_match ${time %w}==5}${color1}Su Mo Tu We Th ${color5}${time %U}${color1} Sa${else}\
${color1}Su Mo Tu We Th Fr ${color5}${time %U}${color}\
${endif}${endif}${endif}${endif}${endif}${endif}
${alignc}  ${color1}${execpi 1800 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color1}/' | sed ':a;N;$!ba;s/\n/\n${alignc}  /g'}${color}

Enjoy.

Too easy to do it in your own language.


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

Offline

#89 2016-06-09 21:39:42

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

Re: Conky - Calendars / Clocks / Time

Not sure is this qualifies as a time piece, a calendar, or something else but since it has time, date and week and day numbers it's not weather or processes or cpu data so here it is:
2016-06-09_182649_Scrot11.th.jpg

${font Fantasque Sans Mono:bold:size=9}
${goto 66}${execi 900 echo `date --date="-7 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${goto 66}${execi 900 echo `date --date="-6 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${goto 66}${execi 900 echo `date --date="-5 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${goto 66}${execi 900 echo `date --date="-4 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${goto 66}${execi 900 echo `date --date="-3 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${goto 66}${execi 900 echo `date --date="-2 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${goto 66}${execi 900 echo `date --date="-1 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${color5}${time %T %a %d %b %y - Wk %U Day %j}${color}
${goto 66}${execi 900 echo `date --date="1 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${goto 66}${execi 900 echo `date --date="2 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${goto 66}${execi 900 echo `date --date="3 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${goto 66}${execi 900 echo `date --date="4 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${goto 66}${execi 900 echo `date --date="5 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${goto 66}${execi 900 echo `date --date="6 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${goto 66}${execi 900 echo `date --date="7 day" +%a" "%d" "%b" "%y" - Wk "%U" Day "%j`}
${font}

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

Offline

#90 2016-06-09 21:51:46

hhh
Meep!
Registered: 2015-09-17
Posts: 9,614
Website

Re: Conky - Calendars / Clocks / Time

One way to stop a runaway horse is to bet on him.

LOL!

Online

#91 2016-06-09 22:12:07

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

Re: Conky - Calendars / Clocks / Time

OFF TOPIC
It's a bash script with 366 lines that are read daily, the last line once every four years.  smile

${execpi 3600 /media/5/Conky/scripts/366.sh | fold -sw36}
#!/bin/bash
# by Sector11 with knowledge gained from Crinos512 in Astro.sh

# Month=`date +%m`
Day=`date +%j`

case "$Day"  in
  001 ) echo "Life is a game, if you are not careful you will lose it." ;;
  002 ) echo "Adults are kids with money. Therefore I'm just a kid!" ;;
  003 ) echo "To err is human; to admit it, superhuman.  - Doug Larson" ;;
  004 ) echo "I used to have an open mind but my brains kept falling out." ;;
  005 ) echo "Silence is golden but duck tape is silver." ;;
  006 ) echo "If you can't see the bright side of life, polish the dull side." ;;
  007 ) echo "It's funny how most activists are pacifists.  - Craig Bruce" ;;
  008 ) echo "I’d like to help you out. Which way did you come in?" ;;
  009 ) echo "Man has his will, but woman has her way.  - Holmes" ;;
  010 ) echo "Never argue with a fool. People might not know the difference." ;;
  011 ) echo "For Sale: Parachute. Only used once, never opened, small stain." ;;
  012 ) echo "Always laugh when you can. It is cheapest medicine." ;;
  013 ) echo "Everyone has a photographic memory. Some just don't have film." ;;
  014 ) echo "Death is hereditary. Life insurance is a lie!" ;;
  015 ) echo "Cheer up. The worst is yet to come. And you though yesterday was bad." ;;
  016 ) echo "Where there's a will, there are five hundred relatives." ;;
  017 ) echo "You know the speed of light, so what's the speed of dark?" ;;
  018 ) echo "I'd explain it to you, but your brain would explode." ;;
  019 ) echo "Death is a once in a lifetime experience and you will experience it." ;;
  020 ) echo "Some days you're the pigeon and some days you're the statue." ;;
  021 ) echo "When everything's coming your way, you're in the wrong lane." ;;
  022 ) echo "On the keyboard of life, always keep one finger on the [Escape] key." ;;
  023 ) echo "Everybody is somebody else's weirdo." ;;
  024 ) echo "Tell me what you need and I'll tell you how to get along without it." ;;
  025 ) echo "Love your enemies. It'll make 'em crazy." ;;
  026 ) echo "I don't have an attitude problem. YOU have a perception problem." ;;
  027 ) echo "Someday we'll look back on all this and plow into a parked car." ;;
  028 ) echo "My Reality Check bounced." ;;
  029 ) echo "Am I getting smart with you?  How would you possibly know?" ;;
  030 ) echo "Mothers of teens know why some animals eat their young." ;;
  031 ) echo "Insanity is hereditary. You get it from your kids." ;;
  032 ) echo "A doctor X-rayed my head and found nothing." ;;
  033 ) echo "He who smiles in a crisis has found someone to blame." ;;
  034 ) echo "If you pay peanuts, you get monkeys." ;;
  035 ) echo "If you wish to live wisely, ignore sayings including this one." ;;
  036 ) echo "Free speech carries with it some freedom to listen." ;;
  037 ) echo "Why isn't phonetic spelled the way it sounds?" ;;
  038 ) echo "If a cow laughed, would milk come out her nose? " ;;
  039 ) echo "Always be sincere even when you don’t mean it" ;;
  040 ) echo "Why does your nose run, and your feet smell?" ;;
  041 ) echo "Y2K????  Maybe 1 K just isn't enough." ;;
  042 ) echo "Why are a wise man and a wise guy opposites?" ;;
  043 ) echo "How much deeper would oceans be if sponges didn't live there?" ;;
  044 ) echo "What happens if you get scared half to death twice?" ;;
  045 ) echo "Conky: no such configuration: 'normal'  - Crinos512" ;;
  046 ) echo "If Barbie is so popular, why do you have to buy her friends?" ;;
  047 ) echo "No one ever says: 'It's only a game!'  if their team is winning." ;;
  048 ) echo "Why do sky divers wear helmets?" ;;
  049 ) echo "Is there another word for synonym?" ;;
  050 ) echo "Why do they report power outages on TV?" ;;
  051 ) echo "If you are refinishing a table, shouldn't you have to restart?" ;;
  052 ) echo "Are there seeing eye humans for blind dogs?" ;;
  053 ) echo "How do I set a laser printer to stun?" ;;
  054 ) echo "I like you. You remind me of when I was young and stupid." ;;
  055 ) echo "When I die, I'm leaving my body to science fiction. - Steven Wright" ;;
  056 ) echo "I'm already visualizing the duct tape over your mouth." ;;
  057 ) echo "What am I? Flypaper for freaks!?" ;;
  058 ) echo "Sarcasm is just one more service we offer." ;;
  059 ) echo "The secrecy of my job prevents me from knowing what I am doing." ;;
  060 ) echo "It's leap year - otherwise, Happy March!" ;;
  061 ) echo "I'm trying to imagine you with a personality." ;;
  062 ) echo "I plan on living forever. So far, so good." ;;
  063 ) echo "The early bird gets the worm, but the second mouse gets the cheese." ;;
  064 ) echo "Just remember, if the world didn't suck, we'd all fall off." ;;
  065 ) echo "Women are scientifically proven to be right even when they are wrong" ;;
  066 ) echo "To know how to hide one's ability is great skill." ;;
  067 ) echo "Old age is always 15 years older than I am." ;;
  068 ) echo "I would if I could, but Ican't so I won't!" ;;
  069 ) echo "I have great faith in fools - self-confidence my friends call it." ;;
  070 ) echo "I think crime pays. The hours are good and you travel a lot." ;;
  071 ) echo "I hope life isn’t a joke, because I don’t get it." ;;
  072 ) echo "When I read about the evils of drinking, I gave up reading." ;;
  073 ) echo "Most people are only alive because it is illegal to shoot them." ;;
  074 ) echo "All people have the right to stupidity but some abuse the privilege." ;;
  075 ) echo "Make it idiot-proof, and someone will make a better idiot!" ;;
  076 ) echo "Of course there’s no reason for it, it’s just our policy." ;;
  077 ) echo "Cheese - milk's leap toward immortality." ;;
  078 ) echo "Only a fool argues with a skunk, a mule or the cook." ;;
  079 ) echo "Always drink upstream from the herd." ;;
  080 ) echo "A clear conscience is usually the sign of a bad memory." ;;
  081 ) echo "Never kick a fresh turd on a hot day." ;;
  082 ) echo "The only thing stronger than a mother's love is garlic breath." ;;
  083 ) echo "Be a Hermit! They have no peer pressure." ;;
  084 ) echo "All those who believe in telekinesis raise my hand." ;;
  085 ) echo "Summer is the season when the air pollution is much warmer." ;;
  086 ) echo "Life's Tough!     Get a helmet!" ;;
  087 ) echo "I never think of the future.     It comes soon enough." ;;
  088 ) echo "42.7% of all statistics are made up on the spot." ;;
  089 ) echo "Never ever stand between a dog and the hydrant." ;;
  090 ) echo "You tried, and you failed,so the lesson is, never try again!." ;;
  091 ) echo "Marriage is bliss. Ignorance is bliss. Therefore ...." ;;
  092 ) echo "Stupidity got us into this mess, then why can't it get us out?" ;;
  093 ) echo "A day without sunshine is like - well - night." ;;
  094 ) echo "Procrastination gives you something to look forward to." ;;
  095 ) echo "Do you believe in love at first sight or should I walk by again?" ;;
  096 ) echo "I am in my own little world but it's okay they know me here." ;;
  097 ) echo "Health is merely the slowest possible rate at which one can die." ;;
  098 ) echo "Love is grand; divorce a hundred grand." ;;
  099 ) echo "Violence is the last refuge of the incompetent." ;;
  100 ) echo "The downhill path is easy, but there's no turning back." ;;
  101 ) echo "Operator! Quick, give me the number for 911!" ;;
  102 ) echo "You can be young without money but you can't be old without it." ;;
  103 ) echo "Foolproof systems don't take into account the ingenuity of some fools." ;;
  104 ) echo "My wife made me join a bridge club. I jump off next Tuesday." ;;
  105 ) echo "If you die in an elevator, be sure to push the [Up] button." ;;
  106 ) echo "Nothing in the known universe travels faster than a bad cheque." ;;
  107 ) echo "I'm at an age when my back goes out more than I do." ;;
  108 ) echo "You've got a photographic mind. It's such a same it never developed." ;;
  109 ) echo "Death is peaceful. It's the transition that's troublesome." ;;
  110 ) echo "Nothing is foolproof to a sufficiently talented fool." ;;
  111 ) echo "A fine is a tax for doing wrong. A tax is a fine for doing well." ;;
  112 ) echo "He who laughs last thinks slowest." ;;
  113 ) echo "On the other hand you have different fingers." ;;
  114 ) echo "Change is inevitable except from a vending machine." ;;
  115 ) echo "I just got lost in thought. It was unfamiliar territory." ;;
  116 ) echo "When the chips are down, the buffalo is empty." ;;
  117 ) echo "Seen it all, done it all, can’t remember most of it." ;;
  118 ) echo "Ever feel like you're diagonally parked in a parallel universe." ;;
  119 ) echo "He’s not dead, Jim, he’s electroencephalographically challenged." ;;
  120 ) echo "I wished the buck stopped here as I could use a few" ;;
  121 ) echo "If we drown in water does a fish drown in air?" ;;
  122 ) echo "Sleep: a completely inadequate substitute for caffeine." ;;
  123 ) echo "Finally things will start clicking - elbows, knees, backs ...!" ;;
  124 ) echo "Smith & Wesson: the original point and click interface." ;;
  125 ) echo "Software isn’t released, it’s allowed to escape." ;;
  126 ) echo "Some cause happiness wherever they go. Others whenever they go" ;;
  127 ) echo "Some mistakes are just too much fun to only make once." ;;
  128 ) echo "Some people wish to get what they deserve, while others fear the same." ;;
  129 ) echo "Spelling is a lossed art." ;;
  130 ) echo "Support your local Search and Rescue unit. Get lost." ;;
  131 ) echo "The future will be better tomorrow." ;;
  132 ) echo "Sure, when a – oink flap oink flap – well I’ll be darned!" ;;
  133 ) echo "Tact is the art of making a point without making an enemy." ;;
  134 ) echo "Take it easy, and if you get it - take it twice." ;;
  135 ) echo "Talk sense to a fool and he calls you foolish." ;;
  136 ) echo "Teamwork is essential – it allows you to blame someone else." ;;
  137 ) echo "The ability to quote is a serviceable substitute for wit." ;;
  138 ) echo "The beatings will continue until morale improves." ;;
  139 ) echo "Some people are living proof that at times retroactive birth control is justified!" ;;
  140 ) echo "Snap!   Crackle!   Crunch!   Bang!     Linux with milk." ;;
  141 ) echo "The best things in life aren’t things." ;;
  142 ) echo "[Panic Button] 'Out of Order' NOW WHAT!!!!!!!" ;;
  143 ) echo "The only job you start at the top is: digging a hole." ;;
  144 ) echo "The only way to get rid of temptation is to yield to it." ;;
  145 ) echo "Matrimony isn’t a word, it’s a sentence." ;;
  146 ) echo "Maybe this world is another planet’s hell." ;;
  147 ) echo "Monday is an awful way to spend 1/7th of your life." ;;
  148 ) echo "Most people don’t act stupid – it’s the real thing." ;;
  149 ) echo "Mother told me to be good, but she’s been wrong before." ;;
  150 ) echo "Never buy a car you can’t push." ;;
  151 ) echo "Never call a man a fool. Borrow from him." ;;
  152 ) echo "Never interrupt your enemy while they are making a mistake." ;;
  153 ) echo "Never tell a lie unless it is absolutely convenient." ;;
  154 ) echo "No one dies a virgin, life screws us all." ;;
  155 ) echo "Nostalgia isn’t what it used to be." ;;
  156 ) echo "No good deed goes unpunished." ;;
  157 ) echo "Nothing is illegal if one hundred businessmen decide to do it." ;;
  158 ) echo "Old soldiers never die. Young ones do." ;;
  159 ) echo "Once toothpaste is out of the tube, buy a new tube." ;;
  160 ) echo "Not all men are fools. Some are bachelors." ;;
  161 ) echo "One way to stop a runaway horse is to bet on him." ;;
  162 ) echo "Only dead fish go with the flow." ;;
  163 ) echo "No one suspects the butterfly!" ;;
  164 ) echo "Only the winners decide what were war crimes." ;;
  165 ) echo "Optimist: Someone without much experience." ;;
  166 ) echo "Nothing will dispel enthusiasm like a small admission fee." ;;
  167 ) echo "People in cars cause accidents. Accidents in cars cause people." ;;
  168 ) echo "Never test the depth of the water with both feet." ;;
  169 ) echo "Rainbows are just to look at, not to really understand." ;;
  170 ) echo "Reality is a nice place, but I wouldn’t want to live there." ;;
  171 ) echo "Old age is nothing to worry about, except if you’re a cheese." ;;
  172 ) echo "If you don’t care where you are, then you ain’t lost." ;;
  173 ) echo "If you put it off long enough, it might go away." ;;
  174 ) echo "So you think education is expensive, try ignorance." ;;
  175 ) echo "If you’re not having fun, then you’re not doing it right." ;;
  176 ) echo "Marriage is like pi - natural, irrational, and very important." ;;
  177 ) echo "It is easier to get forgiveness than ask for permission." ;;
  178 ) echo "It’s like deja vu all over again.              It’s like deja vu all over again." ;;
  179 ) echo "I know I’m paranoid, but am I paranoid enough? –Tom Clancy." ;;
  180 ) echo "Proofread carefully to see if you any words out." ;;
  181 ) echo "Never underestimate the power of stupid people in large groups." ;;
  182 ) echo "If you tell the truth you don’t have to remember anything." ;;
  183 ) echo "Quando omni flunkus moritati – when all else fails, play dead." ;;
  184 ) echo "It’s the squeaky wheel that gets the grease." ;;
  185 ) echo "Laugh at your problems; everybody else does." ;;
  186 ) echo "It’s people that give drinking a bad name" ;;
  187 ) echo "Never, ever make absolute, unconditional statements." ;;
  188 ) echo "Learn from my parent’s mistake. Don’t have kids!" ;;
  189 ) echo "It’s not reality that’s important, but how you perceive things." ;;
  190 ) echo "Life exists for no known purpose." ;;
  191 ) echo "Life’s a bitch, and then you’re reincarnated." ;;
  192 ) echo "Logic is in the eye of the logician." ;;
  193 ) echo "Illegal drugs are the chlorine in the gene pool." ;;
  194 ) echo "Linux: because rebooting is for adding new hardware." ;;
  195 ) echo "Love is temporary insanity curable by marriage." ;;
  196 ) echo "Judge a man by his questions rather than his answers." ;;
  197 ) echo "Man invented language to satisfy his deep need to complain." ;;
  198 ) echo "No life is totally wasted, one can always be a bad example." ;;
  199 ) echo "Man who stands on toilet is high on pot." ;;
  200 ) echo "Marriage. An expensive way of getting your laundry done for free." ;;
  201 ) echo "7/5th of all people do not understand fractions." ;;
  202 ) echo "A Smith & Wesson beats four aces." ;;
  203 ) echo "A bachelor’s life is no life for a single man." ;;
  204 ) echo "Lunix ! Because I tried the alternative!" ;;
  205 ) echo "Plan ahead. A bad plan is better than no plan." ;;
  206 ) echo "A city is a large community where people are lonesome together." ;;
  207 ) echo "99% of lawyers are giving the rest a bad name." ;;
  208 ) echo "Love may be blind but marriage is a real eye-opener." ;;
  209 ) echo "A conclusion is simply the place where you got tired of thinking." ;;
  210 ) echo "It's a good day for firm decisions! Or is it?" ;;
  211 ) echo "A free society is one where it is safe to be unpopular." ;;
  212 ) echo "A good pun is its own reword." ;;
  213 ) echo "A little inaccuracy sometimes saves a ton of explanation." ;;
  214 ) echo "A drunk mans’ words are a sober mans’ thoughts." ;;
  215 ) echo "A professor is one who talks in someone else’s sleep." ;;
  216 ) echo "Life’s a bleach and then you dye." ;;
  217 ) echo "A proverb is a short sentence based on long experience." ;;
  218 ) echo "A smart man covers his ass, but a wise man leaves his pants on." ;;
  219 ) echo "According to my calculations the problem doesn’t exist." ;;
  220 ) echo "A man wrapped up in himself makes a very small package." ;;
  221 ) echo "Admit nothing, deny everything and make counter-accusations." ;;
  222 ) echo "A person is just about as big as the things that make them angry." ;;
  223 ) echo "After all is said and done, more is said than done." ;;
  224 ) echo "Alcohol is not the answer, it just makes you forget the question." ;;
  225 ) echo "A gentleman is a patient wolf." ;;
  226 ) echo "All generalizations are dangerous, even this one." ;;
  227 ) echo "All true wisdom is found on T-shirts." ;;
  228 ) echo "All work and no play, will make you a manager." ;;
  229 ) echo "Am I ranting? I hope so. My ranting gets raves." ;;
  230 ) echo "Any clod can have the facts, but having an opinion is an art." ;;
  231 ) echo "Any time things appear to be going better, you've overlooked something." ;;
  232 ) echo "An atheist is a man who has no invisible means of support." ;;
  233 ) echo "A frustrated chicken should not vote for Colonel Sanders." ;;
  234 ) echo "A man on a date wonders if he’ll get lucky. The woman already knows." ;;
  235 ) echo "Forgive your enemies but REMEMBER THEIR NAMES!" ;;
  236 ) echo "A verbal contract isn't worth the paper it is written on." ;;
  237 ) echo "If corn oil comes from corn, where does baby oil come from?" ;;
  238 ) echo "A mathematician is a device for turning coffee into theorems." ;;
  239 ) echo "If it's tourist season, why can't we shoot them?" ;;
  240 ) echo "What's another word for thesaurus?" ;;
  241 ) echo "If a book about failures doesn't sell, is it a success?" ;;
  242 ) echo "Does fuzzy logic tickle?" ;;
  243 ) echo "Experience is what you get when you didn't get what you wanted." ;;
  244 ) echo "Would a fly without wings be called a walk?" ;;
  245 ) echo "If a turtle doesn't have a shell, is he homeless or naked?" ;;
  246 ) echo "Despite the cost of living, have you noticed how it remains so popular?" ;;
  247 ) echo "I started out with nothing, and I still have most of it." ;;
  248 ) echo "If flying is so safe, why do they call the airport the terminal?" ;;
  249 ) echo "What do they use to ship styrofoam?" ;;
  250 ) echo "Shopping tip: You can get shoes for 85 cents at the bowling alley." ;;
  251 ) echo "Two peanuts were walking down the street. One was asalted." ;;
  252 ) echo "How long is a minute? Depends on what side of the bathroom door you're on." ;;
  253 ) echo "Why are there interstate highways in Hawaii?" ;;
  254 ) echo "Snowmen fall from the sky unassembled." ;;
  255 ) echo "Time may be a great healer but it's also a lousy beautician." ;;
  256 ) echo "Brain cells come and go but fat cells live forever." ;;
  257 ) echo "Life not only begins at forty, it begins to show." ;;
  258 ) echo "The crumsumpten of alcahol may mack you tihnk you can tipe gode." ;;
  259 ) echo "If at first you don't succeed, skydiving is not for you." ;;
  260 ) echo "A closed mouth gathers no foot." ;;
  261 ) echo "Everyone is normal, until you get to know them." ;;
  262 ) echo "The shinbone is a device for finding furniture in a dark room." ;;
  263 ) echo "If the shoe fits, get another one just like it." ;;
  264 ) echo "Why doesn't glue stick to the inside of the bottle?" ;;
  265 ) echo "An elephant is a mouse built to government specifications." ;;
  266 ) echo "Flashlight: A case for holding dead batteries." ;;
  267 ) echo "An error doesn't become a mistake until you choose to ignore it." ;;
  268 ) echo "An obstacle is something you see when you take your eyes off the goal." ;;
  269 ) echo "Should vegetarians eat animal crackers?" ;;
  270 ) echo "An open mind does not always require an open mouth." ;;
  271 ) echo "Anybody who thinks talk is cheap never argued with a traffic cop." ;;
  272 ) echo "Any car will last a lifetime - if you are careless enough." ;;
  273 ) echo "When it rains, why don't sheep shrink?" ;;
  274 ) echo "Never argue with an idiot. They drag you down to their level." ;;
  275 ) echo "Anything you lose automatically doubles in value." ;;
  276 ) echo "A person of words and not deeds is like a garden full of weeds." ;;
  277 ) echo "A politician will stand for what he thinks people will fall for." ;;
  278 ) echo "A closed mind is a good thing to lose." ;;
  279 ) echo "A cynic knows the price of everything and the value of nothing." ;;
  280 ) echo "An optimist laughs to forget, a pessimist forgets to laugh." ;;
  281 ) echo "A drop of ink may make a million think." ;;
  282 ) echo "A face without freckles is like a sky without stars." ;;
  283 ) echo "A fall will always make a wise man wiser." ;;
  284 ) echo "A father carries pictures where his money used to be." ;;
  285 ) echo "A friend reaches for your hand and touches your heart." ;;
  286 ) echo "Beat me with the truth, don't torture me with lies." ;;
  287 ) echo "Be careful of your thoughts, they may become words at any moment." ;;
  288 ) echo "Bacteria: the only culture some people have." ;;
  289 ) echo "A drunk mans' words are a sober mans' thoughts." ;;
  290 ) echo "Be bold in what you stand for; and careful what you fall for." ;;
  291 ) echo "Behaviour is a mirror in which everyone shows his true image." ;;
  292 ) echo "Be not afraid of growing slowly, be afraid only of standing still." ;;
  293 ) echo "If you can’t live without me, then why aren’t you dead yet?" ;;
  294 ) echo "One should be slow in choosing a friend, slower in changing one." ;;
  295 ) echo "A reed bends in the wind, a mighty oak breaks!" ;;
  296 ) echo "'B positive' is not my blood group, still it's in my blood." ;;
  297 ) echo "Celibacy is not an inherited characteristic." ;;
  298 ) echo "We live in an age where pizza gets to your house before the police." ;;
  299 ) echo "Treat the janitor as you would the chairman of the board." ;;
  300 ) echo "Choose your love, love your choice." ;;
  301 ) echo "We never really grow up, we only learn how to act in public." ;;
  302 ) echo "A person who makes no mistakes, generally makes nothing." ;;
  303 ) echo "Be like the flower that perfumes the very hand that crushes it." ;;
  304 ) echo "The voices in my head may not be real, but they have some good ideas!" ;;
  305 ) echo "It's not the fall that kills you; it's the sudden stop at the end." ;;
  306 ) echo "Artificial intelligence is no match for natural stupidity." ;;
  307 ) echo "Always borrow money from a pessimist. He won't expect it back." ;;
  308 ) echo "We have enough gun control. What we need is idiot control." ;;
  309 ) echo "My opinions may have changed, but not the fact that I am right." ;;
  310 ) echo "When in doubt - mumble!" ;;
  311 ) echo "Committee: A body that keeps minutes and wastes hours." ;;
  312 ) echo "I like work. It fascinates me. I sit and watch at it for hours." ;;
  313 ) echo "You're never too old to learn something stupid." ;;
  314 ) echo "Knowledge is power, and power corrupts. So study hard and be evil." ;;
  315 ) echo "Count your rainbows, not your thunderstorms." ;;
  316 ) echo "With sufficient thrust, pigs fly just fine." ;;
  317 ) echo "A bargain; something you don't need at a price you can't resist." ;;
  318 ) echo "A TV can insult your intelligence, but nothing rubs it in like a computer." ;;
  319 ) echo "I used to be indecisive. Now I'm not sure." ;;
  320 ) echo "Whoever coined the phrase 'Quiet as a mouse' never stepped on one." ;;
  321 ) echo "By the time you can make ends meet, the ends move." ;;
  322 ) echo "After (M)onday and (T)uesday even the week says WTF!" ;;
  323 ) echo "I don't suffer from insanity. I enjoy every minute of it." ;;
  324 ) echo "Keep the dream alive: Hit the snooze button." ;;
  325 ) echo "Why didn't Noah swat those two mosquitoes?" ;;
  326 ) echo "Well aren't you a waste of two billion years of evolution." ;;
  327 ) echo "If you can't convince them, confuse them." ;;
  328 ) echo "Worrying works! 90% of the things I worry about never happen." ;;
  329 ) echo "The difference between in-laws and outlaws? Outlaws are wanted." ;;
  330 ) echo "Money talks but all mine ever says is 'Good-bye.'" ;;
  331 ) echo "I don't have an attitude; I have a personality you can't handle." ;;
  332 ) echo "Constant use will wear out anything. Especially friends." ;;
  333 ) echo "Progress is made by lazy men looking for an easier way to do things." ;;
  334 ) echo "Be careful; friends may come and go, but enemies accumulate." ;;
  335 ) echo "We're all time travelers moving at the speed of 60 minutes per hour" ;;
  336 ) echo "Dogs have masters. Cats have staff. CrunchBangers have corenominal." ;;
  337 ) echo "The Miss Universe pageant is fixed. All winners are from Earth." ;;
  338 ) echo "People tend to make rules for others and exceptions for themselves." ;;
  339 ) echo "The best way to lie is to tell the truth, a very carefully edited truth." ;;
  340 ) echo "Laughter is the shock absorber that eases the blows of life." ;;
  341 ) echo "Hard work never killed anyone, but why take the chance?" ;;
  342 ) echo "I have all the money I'll ever need - if I die by 4:00 p.m. today." ;;
  343 ) echo "Vegetarian: Native American definition for 'lousy hunter'." ;;
  344 ) echo "You can't have everything - where would you put it?" ;;
  345 ) echo "The trouble with being punctual; nobody's there to appreciate it." ;;
  346 ) echo "For every action, there is a corresponding over-reaction." ;;
  347 ) echo "What if there were no hypothetical questions?" ;;
  348 ) echo "Lite: the new way to spell 'Light,' now with 20% fewer letters!" ;;
  349 ) echo "There are no winners in lifeonly survivors." ;;
  350 ) echo "Efficiency is a highly developed form of laziness." ;;
  351 ) echo "Don't steal. That's the government's job." ;;
  352 ) echo "Archeologist: someone whose carreer lies in ruins." ;;
  353 ) echo "A committee is group of people doing the work of one." ;;
  354 ) echo "Drink coffee! Do stupid things faster with more energy!" ;;
  355 ) echo "I am in shape. Round is a shape isn't it?" ;;
  356 ) echo "Everyone has the right to be stupid, but you're abusing the privilege!" ;;
  357 ) echo "It's not how good your work is, it's how well you explain it." ;;
  358 ) echo "Don't piss me off! I'm running out of places to hide the bodies." ;;
  359 ) echo "Hippopotomonstrosesquippedaliophobia: Fear of long words." ;;
  360 ) echo "Discretion; being able to raise youreyebrow instead of your voice." ;;
  361 ) echo "People will believe anything if you whisper it." ;;
  362 ) echo "Failure is not falling down, it is not getting up again." ;;
  363 ) echo "The only knowledge that can hurt you is the knowledge you don't have." ;;
  364 ) echo "Without ME, it's just AWESO." ;;
  365 ) echo "You are depriving some poor village of its idiot." ;;
  366 ) echo "It's Leap Year, 1460 days between birthday presents, what a shame!" ;;
  *  ) echo "ERROR" ;;
esac

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

Offline

#92 2016-06-15 07:52:12

bra10n
Member
Registered: 2016-06-15
Posts: 22

Re: Conky - Calendars / Clocks / Time

A vertical conky calendar (I don't recall seeing any in this thread). Not my own work mind...
T2DDPe5.png?1

conkycal.sh

#!/bin/bash
cd $(dirname $0)
# horizontal and vertical calendar for conky by ans
# Updated by: mobilediesel, dk75, Bruce, Crinos512, et al.
# locale depend week day names
DOW=("Mo" "Tu" "We" "Th" "Fr" "Sa" "Su")
while getopts ":vl:" opts; do
case "$opts" in
l) lang=$OPTARG;;
v) orientation="$opts";;
esac
done
if [ -f lang ]; then
    . lang
fi
COLOROLD="a07f38" #Orange
COLORTODAY="c30021" #Red
COLORREST="1A1A1A" #Black
COLORNEXT="736d56" #Black
COLORSATURDAY="1A1A1A"
COLORSUNDAY="1A1A1A"
COLOR=("" "" "" "" "" "\${color $COLORSATURDAY}" "\${color $COLORSUNDAY}")
COLOREND=("" "" "" "" "" "" "\${color}")

TODAY=$(date +%-d)
LASTDAY=$(date -d "-$TODAY days +1 month" +%d)
FIRSTDAY=$(date -d "-$[$TODAY-1] days" +%u)

# horizontal function
h () {
# Build $TOPLINE
k=$FIRSTDAY
for j in {1..31}; do
  x=$[j+LASTDAY/j]
  case $j in
  	${j/#$x})	TOPLINE="$TOPLINE ${COLOR[$[k-1]]}${DOW[$[k-1]]}${COLOREND[$[k-1]]}";;
  	$[LASTDAY+1])	TOPLINE="$TOPLINE \${color $COLORNEXT}${DOW[$[k-1]]}";;
  	*)		TOPLINE="$TOPLINE ${DOW[$[k-1]]}";;
  esac
  k=$[${k/#7/0}+1]
done

BOTTOM="\${color $COLOROLD}$(seq -w -s ' ' $LASTDAY|sed "0,/[0-3]*$TODAY \?/s//\${color $COLORTODAY}&\${color $COLORREST}/") \${color $COLORNEXT}$(seq -w -s ' ' 0$[31-$LASTDAY])"

echo "${TOPLINE/# /}"
echo "$BOTTOM\${color}"
}

#vertical function
v () {
for i in $(seq 1 $[TODAY-1]); do
    TODAYC[$i]="\${goto 40}\${color $COLOROLD}" #$COLOROLD
done
TODAYC[$TODAY]="\${goto 40}\${color $COLORTODAY}"
for i in $(seq $[TODAY+1] $LASTDAY); do
    TODAYC[$i]="\${goto 40}\${color $COLORREST}"
done

k=$FIRSTDAY
for j in $(seq $LASTDAY); do
  	echo  "${COLOR[$[k-1]]}${DOW[$[k-1]]} ${TODAYC[$j]}$(printf "%02d" $j)\${color}\${voffset 2}"
  k=$[${k/#7/0}+1]
done
}

# call function based on "$orientation"
${orientation:-h}

and called in conky with

${execpi 6000 ~/.conky/conkycal.sh -l en -v|sed 's/^/\${goto 12}/'}

Current day shown in red, past shown in orange, future in black text. All configurable in the script.

Last edited by bra10n (2016-06-15 07:53:36)

Offline

#93 2016-06-15 08:25:12

bra10n
Member
Registered: 2016-06-15
Posts: 22

Re: Conky - Calendars / Clocks / Time

Another, and this is my all time favourite conky wink
6xT7iLx.png?1

The output you see here via conky is piped from another little gem of an app called 'when', a cli calendar available in the repos. What I like about this combination is the ease of which the calendar displayed can be changed by simply editing the call in conky, For example the conky line to show above is

${execpi 3600 when c --noneighboring_months --past=0 --future=365}

The "--future=365" shows a 12 month calendar, "---future=90" would show 3 months, etc etc.
But that's not all when has to offer. When can also output a list of dates (appointments, birthdays, reminders) and display those via conky also. Example,

ShwCyEL.png

Utilising the 'past=0' option in conky you can retain a list of all of your entries in a calendar file and only display those that occur in the future. Edit your calendar via the command line... what more can a man want wink


Unfortunately I've not yet figured out how to mark key dates to show on the calendar output but if you notice the current date is * so I think this is do-able. Something for the conky-guru's here to explore perhaps...

Offline

#94 2016-06-15 14:03:45

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

Re: Conky - Calendars / Clocks / Time

First off - Welcome to BunsenLabs.

bra10n wrote:

A vertical conky calendar (I don't recall seeing any in this thread). Not my own work mind...
http://i.imgur.com/T2DDPe5.png?1

Hey been a while since I've seen that.  'ans' really started something. It looks like you have an older version of the script though, here's an update for you:
conkycal.sh

#!/bin/bash
cd "${0%/*}" || exit

# horizontal and vertical calendar for conky by ans
# Updated by: mobilediesel, dk75, Bruce, Crinos512, et al.
# This update by dk75 - 15 Feb 2011
# tweaked by S11 @ http://www.shellcheck.net/ - 2016

#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.

#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.
# locale depend week day names
# The 'lang' file must be in the same directory as this script.
# Horizontal and English are the defaults:
#   conkycal.sh
# Make it vertical:
#   conkycal.sh -v
# Change the language to Spanish:
#   conkycal.sh -l es
# Or both at once:
#   conkycal.sh -v -l es
# The order of the arguments doesn't matter:
#   conkycal.sh -l es -v
# Test other year and/or month, eg. February 2000
#   conkycal.sh -d "2000 2"
# Need to use a goto:
#   conkycal.sh -l es|sed 's/^/\${goto 240}/'
# or a goto and a tab:
#   conkycal.sh |sed -e 's/^/\${goto 240}/' -e 's/$/\${tab 20}/'

DOW=("Mo" "Tu" "We" "Th" "Fr" "Sa" "Su")

while getopts ":vl:d:" opts; do
case "$opts" in
l) lang=$OPTARG;;
v) orientation="$opts";;
d) DATE=$OPTARG;;
esac
done
if [ -f conkycal.lang ]; then
    . conkycal.lang
fi

COLOROLD="DCDCDC"
COLORTODAY="FFD700"
COLORREST="DCDCDC"
COLORNEXT="778899"
COLORSATURDAY="B0E0E6"
COLORSUNDAY="B0E0E6"


COLOR=("" "" "" "" "" "\${color $COLORSATURDAY}" "\${color $COLORSUNDAY}")
COLOREND="\${color}"

DAYS=( $(echo "" |gawk -v dateS="$DATE" 'END{
if (dateS) {
	print strftime("%-u",mktime(dateS" 1 0 0 0")),strftime("%-d",mktime(dateS" 1 0 0 0")),strftime("%-d",mktime(strftime("%Y %m 0 0 0 0",mktime(dateS" 32 0 0 0"))))
	}
else {
	print strftime("%-u",mktime(strftime("%Y %m 1 0 0 0"))),strftime("%-d"),strftime("%-d",mktime(strftime("%Y %m 0 0 0 0",mktime(strftime("%Y %m 32 0 0 0")))))
	}
}') )

k=${DAYS[0]}
for ((j=1; j<=DAYS[2]; j++)); do
  days[$j]="${COLOR[k-1]}${DOW[k-1]}"
  k=$((${k/#7/0}+1))
done
for ((j=$((DAYS[2]+1)); j<=31; j++)); do
  days[$j]="${DOW[k-1]}"
  k=$((${k/#7/0}+1))
done

# horizontal function
h () {
for ((i=1; i<=DAYS[2]; i++)); do
  echo -n "${days[$i]/${DOW[6]}/${DOW[6]}$COLOREND} "
done
echo -n "\${color $COLORREST}"
for ((i=$((DAYS[2]+1)); i<=31; i++)); do
  echo -n "${days[$i]} "
done
echo $'\n'"\${color $COLOROLD}$(a=; for ((x=1; x<=$[DAYS[1]-1]; x++));do printf "%02d " $x; done)\${color $COLORTODAY}$(printf "%02d" DAYS[1])\${color $COLORREST} $(a=; for ((x=DAYS[1]+1;x<=DAYS[2];x++)); do printf "%02d " $x; done)\${color $COLORNEXT}$(a=; for ((x=1; x<=$((31-DAYS[2])); x++)); do printf "%02d " $x; done)" |sed -e 's/ *$//'
}

#vertical function
v () {
for ((i=1; i<=$((DAYS[1]-1)); i++)); do
    TODAYC[$i]="\${color $COLOROLD}"
done
TODAYC[${DAYS[1]}]="\${color $COLORTODAY}"
for ((i=$((DAYS[1]+1)); i<=DAYS[2]; i++)); do
    TODAYC[$i]="\${color $COLORREST}"
done
for ((j=1; j<=DAYS[2]; j++)); do
    echo  "${days[$j]} ${TODAYC[$j]}$(printf "%02d" $j)\${color}"
done
for ((j=1; j<=$((31-DAYS[2])); j++)); do
    echo  "\${color $COLORNEXT}${days[$j]} $(printf "%02d" $j)\${color}"
done
}
# call function based on "$orientation" - default is horizontal
${orientation:-h}

2016_06_15_10_53_29_Scrot11.jpg

The calls that created those calendars:

English
${execpi 3600 /media/5/Conky/scripts/conkycal.sh}${color}
German
${execpi 3600 /media/5/Conky/scripts/conkycal.sh -l de}${color}
French
${execpi 3600 /media/5/Conky/scripts/conkycal.sh -l fr}${color}
Spanish
${execpi 3600 /media/5/Conky/scripts/conkycal.sh -l es}${color}
Greek
${execpi 3600 /media/5/Conky/scripts/conkycal.sh -l el}${color}
Dutch
${execpi 3600 /media/5/Conky/scripts/conkycal.sh -l nl}${color}

 En     Fr     Gr
${execpi 3600 /media/5/Conky/scripts/conkycal.sh -v}
${voffset -434}${execpi 3600 /media/5/Conky/scripts/conkycal.sh -l fr -v|sed 's/^/\${goto 60}/'}
${voffset -434}${execpi 3600 /media/5/Conky/scripts/conkycal.sh -l el -v|sed 's/^/\${goto 110}/'}

Also you didn't say if you have it or not but there is a language file for that script, it must be in the same directory as the script:
conkycal.lang

case ${lang:-$LANG} in
	af* )  DOW=("Ma" "Di" "Wo" "Do" "Vr" "Sa" "So");;				# Afrikaans (Afrikaans)
	be* )  DOW=("Па" "Аў" "Се" "Ча" "Пя" "Су" "Ня");;				# Belarusian (Беларуская)
	bs* )  DOW=("Po" "Ut" "Sr" "Če" "Pe" "Su" "Ne");;				# Bosnian (Bosanac)
	bg* )  DOW=("По" "Вт" "Ср" "Че" "Пе" "Съ" "Не");;				# Bulgarian (Български)
	zh* )  DOW=("周一" "周二" "周三" "周四" "周五" "周六" "周天");;	# Chinese (中文)
	hr* )  DOW=("Po" "Ut" "Ut" "Sr" "Če" "Su" "Ne");;				# Croatian (Hrvatska)
	cs* )  DOW=("Po" "Út" "St" "Čt" "Pá" "So" "Ne");;				# Czech (Čeština)
	da* )  DOW=("Ma" "Ti" "On" "To" "Fr" "Lø" "Sø");;				# Danish (Dánština)
	nl* )  DOW=("Ma" "Di" "Wo" "Do" "Vr" "Za" "Zo");;				# Dutch (Nederlandse)
	de* )  DOW=("Mo" "Di" "Mi" "Do" "Fr" "Sa" "So");;				# German (Deutche)
	el* )  DOW=("Δε" "Τρ" "Τε" "Πέ" "Πα" "Σά" "Κυ");;				# Greek (Ελληνικά)
	et* )  DOW=("Es" "Te" "Ko" "Ne" "Re" "La" "Pü");;				# Estonian (Eesti)
	tl* )  DOW=("Lu" "Ma" "Mi" "Hu" "Bi" "Sa" "Li");;				# Filipino (Filipino)
	fi* )  DOW=("Ma" "Ti" "Ke" "To" "Pe" "La" "Su");;				# Finnish (Suomen)
	fr* )  DOW=("Lu" "Ma" "Me" "Je" "Ve" "Sa" "Di");;				# French (Français)
	gl* )  DOW=("Lu" "Ma" "Mé" "Xo" "Ve" "Sá" "Do");;				# Galician (Galego)
	hi* )  DOW=("सोम" "मंगल" "बुध" "गुरु" "शुक्र" "शनि" "सूर्य")	;;		# Hindi (हिन्दी)
	hu* )  DOW=("Hé" "Ke" "Se" "Cü" "Pé" "So" "Va");;				# Hungarian (Magyar)
	is* )  DOW=("Má" "Þr" "Mi" "Fi" "Fö" "La" "Su");;				# Icelandic (Íslenska)
	id* )  DOW=("Se" "Se" "Ra" "Ka" "Ju" "Sa" "Mi");;				# Indonesian (Indonesia)
	it* )  DOW=("Lu" "Ma" "Me" "Gi" "Ve" "Sa" "Do");;				# Italian (Italiano)
	ja* )  DOW=("月曜" "火曜" "水曜" "木曜" "金曜" "土曜" "日曜");;	# Japanese (日本語) x
	ko* )  DOW=("월요" "화요" "수요" "목요" "금요" "토요" "일요");;	# Korean (한국어) x
	lv* )  DOW=("Pr" "Ot" "Tr" "Ce" "Pe" "Se" "Sv");;				# Latvian (Latviešu)
	lt* )  DOW=("pi" "an" "tr" "ke" "pe" "še" "se");;				# Lithuanian (Lietuviškai)
	mk* )  DOW=("По" "Вт" "Ср" "Че" "Пе" "Са" "Не");;				# Macedonian (Македонски)
	ml* )  DOW=("Is" "Se" "Ra" "Ra" "Ju" "Sa" "Mi");;				# Malayam (Bahasa Melayu)
	nb* )  DOW=("ma" "ti" "on" "to" "fr" "lø" "sø");;				# Norwegian (Norsk)
	pl* )  DOW=("Po" "Wt" "Śr" "Cz" "Pt" "So" "Nd");;				# Polish (Polska)
	pt* )  DOW=("Sq" "Te" "Qa" "Qi" "Se" "Sá" "Do");;				# Portuguese (Português)
	ro* )  DOW=("Lu" "Ma" "Mi" "Jo" "Vi" "Sa" "Du");;				# Romanian (Român)
	ru* )  DOW=("По" "Вт" "Ср" "Че" "Пя" "Су" "Во");;				# Russian (Русский)
	sr* )  DOW=("Po" "Ut" "Sr" "Če" "Pe" "Su" "Ne");;				# Serbian (Српски)
	sk* )  DOW=("Po" "Ut" "St" "Št" "Pi" "So" "Ne");;				# Slovak (Slovenčina)
	sl* )  DOW=("Po" "To" "Sr" "Če" "Pe" "So" "Ne");;				# Slovenian (Slovenski)
	es* )  DOW=("Lu" "Ma" "Mi" "Ju" "Vi" "Sá" "Do");;				# Spanish (Español)
	sv* )  DOW=("Må" "Ti" "On" "To" "Fr" "Lö" "Sö");;				# Swedish (Svenska)
	tr* )  DOW=("Pa" "Sa" "Ça" "Pe" "Cu" "Cu" "Pa");;				# Turkish (Türkçe)
	uk* )  DOW=("По" "Ві" "Се" "Че" "Пя" "Су" "Не");;				# Ukrainian (Українська)
        * ) DOW=("Mo" "Tu" "We" "Th" "Fr" "Sa" "Su") ;;
esac

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

Offline

#95 2016-06-15 15:25:38

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

Re: Conky - Calendars / Clocks / Time

bra10n wrote:

Another, and this is my all time favourite conky wink

{ s n i p }

Edit your calendar via the command line... what more can a man want wink

Unfortunately I've not yet figured out how to mark key dates to show on the calendar output but if you notice the current date is * so I think this is do-able. Something for the conky-guru's here to explore perhaps...

Most interesting.  As for the conky "calendar" part of 'when' you could also use the "cal" command and get better formatting - 4 months before this month and 7 months after to get a 3x4 layout:

 15 Jun 16 @ 12:04:12 ~
  $ cal -B4 -A7
   February 2016           March 2016            April 2016       
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6         1  2  3  4  5                  1  2  
 7  8  9 10 11 12 13   6  7  8  9 10 11 12   3  4  5  6  7  8  9  
14 15 16 17 18 19 20  13 14 15 16 17 18 19  10 11 12 13 14 15 16  
21 22 23 24 25 26 27  20 21 22 23 24 25 26  17 18 19 20 21 22 23  
28 29                 27 28 29 30 31        24 25 26 27 28 29 30  
                                                                  

      May 2016             June 2016             July 2016        
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
 1  2  3  4  5  6  7            1  2  3  4                  1  2  
 8  9 10 11 12 13 14   5  6  7  8  9 10 11   3  4  5  6  7  8  9  
15 16 17 18 19 20 21  12 13 14 15 16 17 18  10 11 12 13 14 15 16  
22 23 24 25 26 27 28  19 20 21 22 23 24 25  17 18 19 20 21 22 23  
29 30 31              26 27 28 29 30        24 25 26 27 28 29 30  
                                            31                    

    August 2016          September 2016         October 2016      
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6               1  2  3                     1  
 7  8  9 10 11 12 13   4  5  6  7  8  9 10   2  3  4  5  6  7  8  
14 15 16 17 18 19 20  11 12 13 14 15 16 17   9 10 11 12 13 14 15  
21 22 23 24 25 26 27  18 19 20 21 22 23 24  16 17 18 19 20 21 22  
28 29 30 31           25 26 27 28 29 30     23 24 25 26 27 28 29  
                                            30 31                 

   November 2016         December 2016          January 2017      
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
       1  2  3  4  5               1  2  3   1  2  3  4  5  6  7  
 6  7  8  9 10 11 12   4  5  6  7  8  9 10   8  9 10 11 12 13 14  
13 14 15 16 17 18 19  11 12 13 14 15 16 17  15 16 17 18 19 20 21  
20 21 22 23 24 25 26  18 19 20 21 22 23 24  22 23 24 25 26 27 28  
27 28 29 30           25 26 27 28 29 30 31  29 30 31              
                                                                  

This months with 11 months following to get what you have:

 15 Jun 16 @ 12:05:48 ~
  $ cal -A11
     June 2016             July 2016            August 2016       
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
          1  2  3  4                  1  2      1  2  3  4  5  6  
 5  6  7  8  9 10 11   3  4  5  6  7  8  9   7  8  9 10 11 12 13  
12 13 14 15 16 17 18  10 11 12 13 14 15 16  14 15 16 17 18 19 20  
19 20 21 22 23 24 25  17 18 19 20 21 22 23  21 22 23 24 25 26 27  
26 27 28 29 30        24 25 26 27 28 29 30  28 29 30 31           
                      31                                          

   September 2016         October 2016         November 2016      
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
             1  2  3                     1         1  2  3  4  5  
 4  5  6  7  8  9 10   2  3  4  5  6  7  8   6  7  8  9 10 11 12  
11 12 13 14 15 16 17   9 10 11 12 13 14 15  13 14 15 16 17 18 19  
18 19 20 21 22 23 24  16 17 18 19 20 21 22  20 21 22 23 24 25 26  
25 26 27 28 29 30     23 24 25 26 27 28 29  27 28 29 30           
                      30 31                                       

   December 2016          January 2017         February 2017      
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
             1  2  3   1  2  3  4  5  6  7            1  2  3  4  
 4  5  6  7  8  9 10   8  9 10 11 12 13 14   5  6  7  8  9 10 11  
11 12 13 14 15 16 17  15 16 17 18 19 20 21  12 13 14 15 16 17 18  
18 19 20 21 22 23 24  22 23 24 25 26 27 28  19 20 21 22 23 24 25  
25 26 27 28 29 30 31  29 30 31              26 27 28              
                                                                  

     March 2017            April 2017             May 2017        
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
          1  2  3  4                     1      1  2  3  4  5  6  
 5  6  7  8  9 10 11   2  3  4  5  6  7  8   7  8  9 10 11 12 13  
12 13 14 15 16 17 18   9 10 11 12 13 14 15  14 15 16 17 18 19 20  
19 20 21 22 23 24 25  16 17 18 19 20 21 22  21 22 23 24 25 26 27  
26 27 28 29 30 31     23 24 25 26 27 28 29  28 29 30 31           
                      30                                          
 
 15 Jun 16 @ 12:10:45 ~
  $ 

Now today's date is "highlighted" in the terminal - that can be turned off with the '-h' option and a bash expert could gawk/awl/grep/sed the date and highlight it in conky similar to how it's done in the OP.  But that's beyond me.

Must talk about 'when' though.  smile


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

Offline

#96 2016-06-15 23:33:17

bra10n
Member
Registered: 2016-06-15
Posts: 22

Re: Conky - Calendars / Clocks / Time

Hi S11,

Re conkycal.sh, I wasn't aware there was an accompanying conkycal.lang script. Re the "cal" command I have run accross that one before. Many ways to skin (the same) cat!

In my haste, I did fail to post the conky call for 'when' for showing appointments...

${execpi 3600 when --future=3|cut -c 24-500}

Adjust as required.

cheers

Offline

#97 2016-06-15 23:59:57

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

Re: Conky - Calendars / Clocks / Time

^ Oooooooo thanks ... been reading up on when ... but with other stuff happening as well, I missed that.  Thank you


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

Offline

#98 2016-06-22 13:34:28

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

Re: Conky - Calendars / Clocks / Time

Two of my favorite conky things is weather and  'time' be it H:M:S or Days, Months and Years.
Over at #! I once showed a "dice" clock and calendar(?).  Well I expanded on it when I saw some interesting 'dominos'.  Making one set transparent for something to do and indicating AM/PM with a change of colour.

Three different sets means 6 conky files and lots of images.  Images re-sized so conky uses them without resizing them.

2016_06_21_20_23_12_Scrot11.jpg Top group yesterday evening, bottom group this morning.
All the images are there to make them all white - all black or reverse them as you wish.


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

Offline

#99 2016-11-02 13:23:59

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

Re: Conky - Calendars / Clocks / Time

@Sector11
https://forums.bunsenlabs.org/viewtopic … 437#p29437

I tried switching to Mo - So (ISO-8601)
2016-11-02-14-02-35_scrot.th.png
But the "3" as error display does not get away. This is my configuration.
"Week 44" is to stay there.  wink Where is my error (the time file I have here)

...
TEXT
${alignc}${color0}${time %T}
 ${time %b %Y}     Woche${alignr 15}${time %V}${color}
${alignc}${if_match ${time %u}==1}${color1}Mo Di Mi Do Fr Sa So ${else}\
${if_match ${time %u}==2}${color1}Mo ${color0}${time %u}${color1} Di Mi Do Fr Sa So${else}\
${if_match ${time %u}==3}${color1}Mo Di${color0}${time %u}${color1} Mi Do Fr Sa So${else}\
${if_match ${time %u}==4}${color1}Mo Di Mi${color}${time %u}${color1} Do Fr Sa So${else}\
${if_match ${time %u}==5}${color1}Mo Di Mi Do${color0}${time %u}${color1} Fr Sa So${else}\
${if_match ${time %u}==6}${color1}Mo Di Mi Do Fr${color0}${time %u}${color1} Sa So${else}\
${if_match ${time %u}==7}${color1}Mo Di Mi Do Fr Sa${color0}${time %u}${color1} So${else}\
${color1}Mo Di Mi Do Fr Sa So ${color}\
${endif}${endif}${endif}${endif}${endif}${endif}${endif}
${alignc}  ${color1}${execpi 1800 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color1}/' | sed ':a;N;$!ba;s/\n/\n${alignc}  /g'}${color}

Last edited by unklar (2016-11-02 13:28:43)

Offline

#100 2016-11-02 17:21:26

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

Re: Conky - Calendars / Clocks / Time

Yes, because you are using:

${if_match ${time %u}==3}${color1}Mo Di${color0}${time %u}${color1} Mi Do Fr Sa So${else}\

Which displays the result of ${time %u} (3) between Di and MI.  Also you have ncal starting on Sunday, you need to use: "ncal -bhM"

Here's the correct code:

${alignc}${color0}${time %T}
 ${time %b %Y}${alignr 15}Woche ${time %V}${color}
${alignc}${if_match ${time %u}==1}${color0}Mo${color1} Di Mi Do Fr Sa So ${else}\
${if_match ${time %u}==2}${color1}Mo ${color0}Di${color1} Mi Do Fr Sa So${else}\
${if_match ${time %u}==3}${color1}Mo Di ${color0}Mi${color1} Do Fr Sa So${else}\
${if_match ${time %u}==4}${color1}Mo Di Mi ${color0}Do${color1} Fr Sa So${else}\
${if_match ${time %u}==5}${color1}Mo Di Mi Do ${color0}Fr${color1} Sa So${else}\
${if_match ${time %u}==6}${color1}Mo Di Mi Do Fr ${color0}Sa${color1} So${else}\
${if_match ${time %u}==7}${color1}Mo Di Mi Do Fr Sa ${color0}So${color1}${else}
${endif}${endif}${endif}${endif}${endif}${endif}${endif}
${alignc}  ${color1}${execpi 1800 LAR=`date +%-d`; ncal -bhM | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color1}/' | sed ':a;N;$!ba;s/\n/\n${alignc}  /g'}${color}

VAEXhP1b.jpg

EDIT:
The link you pointed to is using ${time %U} (week number = 44) instead of the week day name (Mi)

${time %U}, ${time %V} and ${time %W} all show week numbers - but calculated differently:

Week
====
%U     Week number of the given year, starting with the first Sunday as the first week 13 (for the 13th full week of the year)

%V     ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with Monday being the start of the week     01 through 53 (where 53 accounts for an overlapping week)

%W     A numeric representation of the week of the year, starting with the first Monday as the first week     46 (for the 46th week of the year beginning with a Monday)

So that code would look like this:

${alignc}${color0}${time %T}
${alignc}${time %b %Y}
${alignc}${if_match ${time %u}==1}${color5}${time %V}${color1} Di Mi Do Fr Sa So ${else}\
${if_match ${time %u}==2}${color1}Mo ${color5}${time %V}${color1} Mi Do Fr Sa So${else}\
${if_match ${time %u}==3}${color1}Mo Di ${color5}${time %V}${color1} Do Fr Sa So${else}\
${if_match ${time %u}==4}${color1}Mo Di Mi ${color5}${time %V}${color1} Fr Sa So${else}\
${if_match ${time %u}==5}${color1}Mo Di Mi Do ${color5}${time %V}${color1} Sa So${else}\
${if_match ${time %u}==6}${color1}Mo Di Mi Do Fr ${color5}${time %V}${color1} So${else}\
${if_match ${time %u}==7}${color1}Mo Di Mi Do Fr Sa ${color5}${time %V}${color1}${else}
${endif}${endif}${endif}${endif}${endif}${endif}${endif}
${alignc}  ${color1}${execpi 1800 LAR=`date +%-d`; ncal -bhM | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color1}/' | sed ':a;N;$!ba;s/\n/\n${alignc}  /g'}${color}

Bc85ODXa.jpg

Last edited by Sector11 (2016-11-02 17:43:44)


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