Looking for a calendar display widget, synchable w/google if possible [SOLVED]
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Looking for a calendar display widget, synchable w/google if possible [SOLVED]
Hello everyone,
I have a great amount of desktop real estate, so I wanted a HUD calendar. I was hoping for something that could sync with google calendar and display the events I schedule from my android phone and win machines.
I found this page: https://www.linuxuprising.com/2018/11/h ... -your.html
but it appears to be coded in 2018, so I wonder if it still works. Also the DOS look of it depresses me, I was hoping for a more beautiful GUI calendar.
I goggled briefly but couldnt find anything like a list of current conky calendars to scroll thru and choose from. Does such a page exist that anyone knows of, or does anyone know of working calendar displays that sync and have some gui customability? Colors and font control would be great!
Thanks for reading,
Logan
I have a great amount of desktop real estate, so I wanted a HUD calendar. I was hoping for something that could sync with google calendar and display the events I schedule from my android phone and win machines.
I found this page: https://www.linuxuprising.com/2018/11/h ... -your.html
but it appears to be coded in 2018, so I wonder if it still works. Also the DOS look of it depresses me, I was hoping for a more beautiful GUI calendar.
I goggled briefly but couldnt find anything like a list of current conky calendars to scroll thru and choose from. Does such a page exist that anyone knows of, or does anyone know of working calendar displays that sync and have some gui customability? Colors and font control would be great!
Thanks for reading,
Logan
Last edited by Logansfury on Tue Jan 30, 2024 8:43 am, edited 1 time in total.
Re: Looking for a calendar display widget, synchable w/google if possible
I never have seen such thing in conky with nice graphics... you're stuck with that conky i guess.
Or if you want nice graphics, you need to make a screenshot of the calendar with a browser in headless mode and then present that image in conky. Problem is the login to google calendar.. so you already need a cooky in headless mode or you get a screenshot of the login page. It can be done, but making a script for it takes a while!
Or if you want nice graphics, you need to make a screenshot of the calendar with a browser in headless mode and then present that image in conky. Problem is the login to google calendar.. so you already need a cooky in headless mode or you get a screenshot of the login page. It can be done, but making a script for it takes a while!
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a calendar display widget, synchable w/google if possible
Hello again,
Thanks for joining another of my posts for help
I noted the sweet screenshot Bleys shared at the end of my Mizar clock post. The small calendar he has in his conky looks fine. I would be happy with something similar to that, and ecstatic if it could spawn a window with event day/time info.
Would it compromise my system to try to run that google sync conky calendar from several years back? I think it was from 2018-2020 or thereabouts.
Thanks for joining another of my posts for help
I noted the sweet screenshot Bleys shared at the end of my Mizar clock post. The small calendar he has in his conky looks fine. I would be happy with something similar to that, and ecstatic if it could spawn a window with event day/time info.
Would it compromise my system to try to run that google sync conky calendar from several years back? I think it was from 2018-2020 or thereabouts.
Re: Looking for a calendar display widget, synchable w/google if possible
is actually no great effort to expand my calendar. The function to mark days is available, color and/or type of marking is already adjustable. The only thing missing is a text file with all the current appointments. Your scheduler should provide such a file.
But clickable appointments are not possible with Conky/Lua on-board tools.
But clickable appointments are not possible with Conky/Lua on-board tools.
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
Re: Looking for a calendar display widget, synchable w/google if possible
I believe the newest Conky versions have the abillity to gain mouse events inside the window. But it still seems a hell of a job to align every mouseclick/coordinate with all the days..
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a calendar display widget, synchable w/google if possible
I am working with Bleys calendar and its a great start. The month numbers are actually lined up with the weekday columns, which wasnt the case in the last working calendar I found.
Once again, my Cinnamon is displaying a background around/behind the calendar despite putting the coding that worked to get the Mizar clock background truly transparent.
Here are the two calendar files with my current edits for colors to match my desktop:
cal.lua
conkyrc
does anyone see anything in here that would account for the background being visible? https://imgur.com/a/kONFYwe
Once again, my Cinnamon is displaying a background around/behind the calendar despite putting the coding that worked to get the Mizar clock background truly transparent.
Here are the two calendar files with my current edits for colors to match my desktop:
cal.lua
Code: Select all
--[[
2023 Bleys
Screenshot ist im ersten Kommentar. (gist.github)
Änderungen des Font (Ubuntu Mono) und/oder der Schriftgröße erfordern auch eine Anpassung der Berechnung der Hintergrund Berechnung!
Das sollte man nur machen wenn man weis was man tut...
Screenshot in first Comment
Changing the font (Ubuntu Mono) and font size also requires an adjustment of the background calculation for the current day!
Only change if you know what you are doing!
mainx, mainy innerhalb der Funktion calendar bestimmen die Position des Kalenders.
mainx, mainy within the calendar function determine the position of the calendar.
-- color=0xffffff --weiß / white
-- color=0x000000 --schwarz / black
-- color=0x0000ff --blau / blue
-- color=0xffff00 --gelb / yellow
-- color=0xff0000 --rot / red
-- color=0x00ff00 --grün / green
]]
require 'cairo'
require "math"
function rgb_to_rgba(color,alpha)
return ((color / 0x10000) % 0x100) / 255., ((color / 0x100) % 0x100) / 255., (color % 0x100) / 255., alpha
end
function draw_day(cr,xx,yy,bcolor,balpha) -- zeichne Hintergrund für aktuellen Tag / draw current Day Background
local corner_r=20
local bg_color=0x000000 --rot / red (Farbe/Color))
local bg_alpha=0.5
local w=15
local h=12
local x=xx
local y=yy
cairo_set_source_rgba(cr,rgb_to_rgba(bcolor,balpha))
cairo_move_to(cr,x,y)
cairo_line_to(cr,x+w,y)
cairo_line_to(cr,x+w,y+h)
cairo_line_to(cr,x,y+h)
cairo_line_to(cr,x,y)
cairo_close_path(cr)
-- cairo_stroke(cr) -- Markierung "Heute" durch Umrandung / Marking today by border
cairo_fill(cr) -- Markierung "Heute" durch Hintergrund / Marking today by background
end
function draw_bg(cr,color,alpha,typ) -- zeichne Hintergrund Conky Fenster / draw Conky Area Background
local corner_r=0
local bg_color=color
local bg_alpha=alpha
local w=conky_window.width
local h=conky_window.height
cairo_set_source_rgba(cr,rgb_to_rgba(bg_color,bg_alpha))
cairo_move_to(cr,corner_r,0)
cairo_line_to(cr,w-corner_r,0)
cairo_curve_to(cr,w,0,w,0,w,corner_r)
cairo_line_to(cr,w,h-corner_r)
cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
cairo_line_to(cr,corner_r,h)
cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
cairo_line_to(cr,0,corner_r)
cairo_curve_to(cr,0,0,0,0,corner_r,0)
cairo_close_path(cr)
if typ==1 then
cairo_fill(cr)
else
cairo_stroke(cr)
end
end
function write_text(cr, x, y, text, f)
--write_text(cr, x, y, text, {})
--font attributes (Schriftattribute zuweisen oder default Werte annehmen)
local font=f.font or "Neon 80s"
local size=f.size or 10
local align=f.align or 'l'
local bold=f.bold or false
local ital=f.italic or false
local color=f.color or "0xffffff"
local slant=CAIRO_FONT_SLANT_NORMAL
if ital then slant=CAIRO_FONT_SLANT_ITALIC end
local weight=CAIRO_FONT_WEIGHT_NORMAL
if bold then weight=CAIRO_FONT_WEIGHT_BOLD end
--Text Size (Textgröße für die Plazierung bestimmen.)
local x_a=0
local y_a=0
local te = cairo_text_extents_t:create()
tolua.takeownership(te)
cairo_select_font_face (cr, font, slant, weight)
cairo_set_font_size (cr, size)
cairo_text_extents (cr, text, te)
--Text Position
if align=='c' then
x_a = -(te.width/2+te.x_bearing)
y_a = -(te.height/2+te.y_bearing)
end
if align=='r' then
x_a = -(te.width+te.x_bearing)
--y_a = -(te.height+te.y_bearing)
end
--Schadow 1 Pixel (Schatten für den Text um 1 Pixel versetzt)
cairo_set_source_rgba(cr, rgb_to_rgba(0x000000,1))
cairo_move_to (cr, x+1+x_a, y+1+y_a)
cairo_show_text (cr, text)
cairo_stroke(cr)
-- Now Text on Top (nun den Text oben drauf)
cairo_set_source_rgba(cr, rgb_to_rgba(color,1))
cairo_move_to (cr, x+x_a, y+y_a)
cairo_show_text (cr, text)
cairo_stroke(cr)
end
function calendar(cr)
-- x, y Koordinaten für den Kalender (oben, links) / x, y coordinates for the calendar (top, left)
local mainx=10
local mainy=32
-- End(e) x,y
-- Parameter Grid Berechnung Monat / Parameters grid calculation month
local time=os.time{year=os.date("%Y"), month=os.date("%m"), day=1}
local weekday=os.date("%w", time)
local mon=tonumber(os.date("%m"))+1
local time=os.time{year=os.date("%Y"), month=mon, day=0}
local lastday=tonumber(os.date("%d", time))
local day=tonumber(os.date("%d"))
local weekday=tonumber(weekday)
local start=1
local posabsbg=0
if weekday == 0 then
start=-5
posabsbg=day+6
else
start=(weekday-2)*-1
posabsbg=day+weekday-1
end
local count=0
local week=1
local wd={}
local we={}
local workdays=""
local weekend=""
local bcolor=0xff0000 -- Farbe aktueller Tag / Color current Day
local balpha=0.5 -- Alpha aktueller Tag /Alpha current Day
-- Ende Berechnung / end Calculation
-- Berechnung aktueller Tag Hintergrund / calculate current day Background
local yposbg=math.floor(((posabsbg-posabsbg%7)/7)*12+mainy+20)
if math.floor(posabsbg%7)==0 then yposbg=math.floor(((posabsbg-posabsbg%7)/7-1)*12+mainy+20) end
local xposbg=math.floor((posabsbg%7)*18+mainx-13)
if math.floor(posabsbg%7)==0 then xposbg=math.floor((posabsbg%7+7)*18+mainx-13) end
draw_day(cr,xposbg,yposbg,bcolor,balpha) -- Funktion Hintergrund aktueller Tag / Function Highlight current Day
-- Ende Berechnung aktueller Tag Hintergrund / calculate today Background
-- Monatsübersicht zusammenstellen / Compile monthly overview
for i=start,lastday do
if i<1 then -- old Month
if (start==-5 and i==0) then -- Weekend
weekend=weekend.." "
else -- Work Days
workdays=workdays.." "
end
else
if i<10 then
if count<5 then
workdays=workdays.." "..i
else
weekend=weekend.." "..i
end
else
if count<5 then
workdays=workdays.." "..i
else
weekend=weekend.." "..i
end
end
end
count=count+1
if ( count == 7 or i == lastday ) then
wd[week]=workdays
we[week]=weekend
week=week+1
workdays=""
weekend=""
count=0
end
end
-- Ende Monatsübersicht zusammenstellen / End Compile monthly overview
-- Schreiben... / write...
write_text(cr, mainx+66, mainy-16, os.date("%B").." "..os.date("%Y"), {font="Dyuthi", size=14, align="c"})
write_text(cr, mainx+1, mainy+17, " Mo Tu We Th Fr ", {font="Ubuntu Mono", size=12, bold=true, align="l"})
write_text(cr, mainx+91, mainy+17, " Sa Su", {font="Ubuntu Mono", size=12, bold=true, color="0xffff00", align="l"})
for w=1,week do
wy=mainy+30+((w-1)*12)
wx=mainx+90
write_text(cr, mainx, wy, wd[w], {font="Ubuntu Mono", size=12, align="l"})
write_text(cr, wx, wy, we[w], {font="Ubuntu Mono", size=12, align="l", color="0xffff00"}) -- Farbe/Color WE
end
-- Ende Schreiben / End write
end
function conky_main()
if conky_window==nil then return end
local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
local cr=cairo_create(cs)
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num>5 then
color=0xffffff alpha=0.1 typ=1
draw_bg(cr,color,alpha,typ) -- Funktion Hintergrund Conky Bereich / Function Backgrounds Conky Area
color=0xffffff alpha=0.8 typ=2
-- draw_bg(cr,color,alpha,typ) --zeichne Linie um den Bereich / Draw line around Conky Area
calendar(cr) -- Hauptfunktion erzeuge / Main
end
cairo_surface_destroy(cs)
cairo_destroy(cr)
end
Code: Select all
conky.config = {
-- — Conky settings
background = false,
update_interval = 1,
total_run_times = 0,
no_buffers = true,
draw_graph_borders = true,
draw_outline = false,
-- Window Settings --
own_window = true,
own_window_type = 'normal',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_hints = 'skip_taskbar,skip_pager,undecorated,below',
own_window_class = 'Conky',
own_window_argb_visual = true,
background = true,
-- — Window specifications with Shadow
own_window = true,
own_window_transparent = true,
own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
-- end
double_buffer = true,
minimum_width = 130, minimum_height = 100, --ring
-- — Position on Desktop / Lage auf dem Desktop festlegen
alignment = 'top_left',
gap_x = 50,
gap_y = 50,
border_inner_margin = 10,
-- Lua Load
lua_load = './cal.lua',
lua_draw_hook_post = 'main',
};
conky.text = [[
]];
Re: Looking for a calendar display widget, synchable w/google if possible
You need to check your conky config on double settings!
I see 2
What i miss is
And set
I see 2
own_window_transparent = true,
and 2 own_window_argb_visual = true,
What i miss is
own_window_argb_value = 0,
and own_window_colour = '000000',
And set
own_window_transparent = true,
to false
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a calendar display widget, synchable w/google if possible
I'm at the vet with my dog so I will do these edits shortly.
I note a section called window and shadow settings. I certainly don't need shadows if they are contributing to the window visibility. Should I nuke that whole section?
I note a section called window and shadow settings. I certainly don't need shadows if they are contributing to the window visibility. Should I nuke that whole section?
Re: Looking for a calendar display widget, synchable w/google if possible
You could copy these settings part from the clock widget and replace it in this conky..
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a calendar display widget, synchable w/google if possible
Thats exactly what I did! I didnt work but it was responsible for those double entries you noted.
I just got Max home from the Vet, Im going to go over the conkyrc now and delete all double entries and add the sections you advised.
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a calendar display widget, synchable w/google if possible
I just made these edits and the calendar disappeared entirely >.<
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a calendar display widget, synchable w/google if possible
I restored Bleys original conkyrc and got the calendar back. I am going over it and all the edits you suggest appear to already be there, yet I am still seeing the background.
Code: Select all
conky.config = {
-- — Conky settings
background = false,
update_interval = 1,
total_run_times = 0,
no_buffers = true,
draw_graph_borders = true,
draw_outline = false,
-- — Window specifications with Background
-- own_window = true,
-- own_window_type = desktop,
-- own_window_transparent = false,
-- own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
-- own_window_argb_visual = true,
-- own_window_argb_value = 0,
-- own_window_colour = '000000',
-- — Window specifications with Shadow
own_window = true,
own_window_transparent = true,
own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
-- end
double_buffer = true,
minimum_width = 130, minimum_height = 100, --ring
-- — Position on Desktop / Lage auf dem Desktop festlegen
alignment = 'top_left',
gap_x = 50,
gap_y = 50,
border_inner_margin = 10,
-- Lua Load
lua_load = './cal.lua',
lua_draw_hook_post = 'main',
};
conky.text = [[
]];
Re: Looking for a calendar display widget, synchable w/google if possible
Logansfury wrote: ⤴Wed Jan 24, 2024 6:13 pm change to:
Code: Select all
conky.config = { -- — Conky settings background = false, update_interval = 1, total_run_times = 0, no_buffers = true, draw_graph_borders = true, draw_outline = false, -- — Window specifications with Background own_window = true, own_window_type = desktop, own_window_transparent = false, own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below', own_window_argb_visual = true, own_window_argb_value = 0, own_window_colour = '000000', -- end double_buffer = true, minimum_width = 130, minimum_height = 100, --ring -- — Position on Desktop / Lage auf dem Desktop festlegen alignment = 'top_left', gap_x = 50, gap_y = 50, border_inner_margin = 10, -- Lua Load lua_load = './cal.lua', lua_draw_hook_post = 'main', }; conky.text = [[ ]];
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a calendar display widget, synchable w/google if possible
I removed the Window specifications with Shadow section as instructed, made sure to keep the -- end to close the rest of the statement, and when restarting the widget, the calendar has completely disappeared.
Code: Select all
conky.config = {
-- — Conky settings
background = false,
update_interval = 1,
total_run_times = 0,
no_buffers = true,
draw_graph_borders = true,
draw_outline = false,
-- — Window specifications with Background
-- own_window = true,
-- own_window_type = desktop,
-- own_window_transparent = true,
-- own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
-- own_window_argb_visual = true,
-- own_window_argb_value = 0,
-- own_window_colour = '000000',
-- end
double_buffer = true,
minimum_width = 130, minimum_height = 100, --ring
-- — Position on Desktop / Lage auf dem Desktop festlegen
alignment = 'top_left',
gap_x = 50,
gap_y = 50,
border_inner_margin = 10,
-- Lua Load
lua_load = './cal.lua',
lua_draw_hook_post = 'main',
};
conky.text = [[
]];
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a calendar display widget, synchable w/google if possible
I realized that I left a comma at the end of a block of code after the strip, I changed that to a period, but still nothing showing with that section of code removed.
Re: Looking for a calendar display widget, synchable w/google if possible
Anything with 2 dashes in front of it are comments.. these do nothing.Logansfury wrote: ⤴Wed Jan 24, 2024 6:51 pm I realized that I left a comma at the end of a block of code after the strip, I changed that to a period, but still nothing showing with that section of code removed.
I cleaned up your conky config, changed transparency to false. Try this one.
Code: Select all
conky.config = {
background = false,
alignment = 'top_left',
gap_x = 50,
gap_y = 50,
minimum_width = 130,
minimum_height = 100, --ring
border_inner_margin = 10,
draw_graph_borders = true,
draw_outline = false,
double_buffer = true,
no_buffers = true,
own_window = true,
own_window_type = 'desktop',
own_window_transparent = false,
own_window_argb_visual = true,
own_window_argb_value = 0,
own_window_colour = '000000',
own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
update_interval = 1,
total_run_times = 0,
lua_load = './cal.lua',
lua_draw_hook_post = 'main',
};
conky.text = [[
]];
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a calendar display widget, synchable w/google if possible
I'm afraid this still displays the background >.<Koentje wrote: ⤴Wed Jan 24, 2024 6:55 pmAnything with 2 dashes in front of it are comments.. these do nothing.Logansfury wrote: ⤴Wed Jan 24, 2024 6:51 pm I realized that I left a comma at the end of a block of code after the strip, I changed that to a period, but still nothing showing with that section of code removed.
I cleaned up your conky config, changed transparency to false. Try this one.Code: Select all
conky.config = { background = false, alignment = 'top_left', gap_x = 50, gap_y = 50, minimum_width = 130, minimum_height = 100, --ring border_inner_margin = 10, draw_graph_borders = true, draw_outline = false, double_buffer = true, no_buffers = true, own_window = true, own_window_type = 'desktop', own_window_transparent = false, own_window_argb_visual = true, own_window_argb_value = 0, own_window_colour = '000000', own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below', update_interval = 1, total_run_times = 0, lua_load = './cal.lua', lua_draw_hook_post = 'main', }; conky.text = [[ ]];
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a calendar display widget, synchable w/google if possible
Here is a current screenshot showing the two calendars Im working on customizing.
As you can see, the Minimalis, the Mizar clock, and the triple display calendar all have perfect transparency. Im not sure why the cal I got from Bleys is being problematical.
https://imgur.com/a/VuRqUGV
As you can see, the Minimalis, the Mizar clock, and the triple display calendar all have perfect transparency. Im not sure why the cal I got from Bleys is being problematical.
https://imgur.com/a/VuRqUGV
Re: Looking for a calendar display widget, synchable w/google if possible
What you can try is to comment the lua settings out. So it only starts the conky window (very small probably) and see if the background is still visibale. If not, the problem is the lua script, if still visible then the problem lies not in the lua script.
Change these
into these
Change these
Code: Select all
lua_load = './cal.lua',
lua_draw_hook_post = 'main',
Code: Select all
-- lua_load = './cal.lua',
-- lua_draw_hook_post = 'main',
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a calendar display widget, synchable w/google if possible
I just commented out the two lines as instructed, and when I hit the restart widget button nothing re-appeared at all.Koentje wrote: ⤴Wed Jan 24, 2024 7:39 pm What you can try is to comment the lua settings out. So it only starts the conky window (very small probably) and see if the background is still visibale. If not, the problem is the lua script, if still visible then the problem lies not in the lua script.
Change theseinto theseCode: Select all
lua_load = './cal.lua', lua_draw_hook_post = 'main',
Code: Select all
-- lua_load = './cal.lua', -- lua_draw_hook_post = 'main',
I then clicked Start Widget in Terminal and got this return:
Code: Select all
conky: desktop window (2400010) is subwindow of root window (6cb)
conky: window type - dock
conky: drawing to created window (0x6800002)
conky: drawing to double buffer