I just edited teh minimum width from 130 to 390 and now I see all 3 calendarsLogansfury wrote: ⤴Wed Jan 31, 2024 7:02 am My conkyrc is only displaying last month not current or next, using the .lua you just posted.
May I have the conkyrc you are working with please?
Need help to edit .lua file for next and previous month displays [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
Re: Need help to edit .lua file for next and previous month displays
Re: Need help to edit .lua file for next and previous month displays
Of course you have to adjust min width and height to the displayed months!Logansfury wrote: ⤴Wed Jan 31, 2024 7:02 am My conkyrc is only displaying last month not current or next, using the .lua you just posted.
May I have the conkyrc you are working with please?
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 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 = 530, -- vertikal 5 Monate
minimum_width = 400, minimum_height = 100, -- horizontal 3 Monate
-- — 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: Need help to edit .lua file for next and previous month displays
I'm pulling an all-nighter, my mind is a void >.<
Here is my progress: I set bg to fully transparent, translated weekday names to english abbreviations, changed weekend blue color to yellow to better match my color theme. I think it looks beautiful:
Thank you so much and I'm happy to test anything you need run from another's machine for feedback/troubleshooting
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Need help to edit .lua file for next and previous month displays
Is it possible to change the month and year fonts without affecting the days of the week and day numerals formatting?
Re: Need help to edit .lua file for next and previous month displays
yesLogansfury wrote: ⤴Wed Jan 31, 2024 7:38 am Is it possible to change the month and year fonts without affecting the days of the week and day numerals formatting?
Depending on the width of the selected font, it may be necessary to adjust x and y. Line 207
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: Need help to edit .lua file for next and previous month displays
WOOT! I put my font into line 207 left everything else alone and restarted the calendars. Month/Year display is still formatted in center of calendars and blends right in with the rest of my GUI textBleys wrote: ⤴Wed Jan 31, 2024 7:45 amyesLogansfury wrote: ⤴Wed Jan 31, 2024 7:38 am Is it possible to change the month and year fonts without affecting the days of the week and day numerals formatting?
Depending on the width of the selected font, it may be necessary to adjust x and y. Line 207
Re: Need help to edit .lua file for next and previous month displays
i'm getting old... Line 207: align="c" -- c=centerLogansfury wrote: ⤴Wed Jan 31, 2024 7:54 am WOOT! I put my font into line 207 left everything else alone and restarted the calendars. Month/Year display is still formatted in center of calendars and blends right in with the rest of my GUI 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: Need help to edit .lua file for next and previous month displays
I have had the calendar installed on the Dell Linux Box since early this morning. I have got Neon 80s font in all 3 month and year displays, the weekend days and numerals are now yellow instead of blue, and the box around the current day has been changed from 0.5 alpha red to 255 alpha black. The box was completely lost against my full color wallpaper.
Is it possible to have control of the color of the daily numeral as well as control of color of the box?
Is it possible to have control of the color of the daily numeral as well as control of color of the box?
Re: Need help to edit .lua file for next and previous month displays
I chose the box because the variant, current day colored, would make the code about 30-40% larger and I wanted to keep the calendar code minimal.Logansfury wrote: ⤴Wed Jan 31, 2024 2:20 pm
Is it possible to have control of the color of the daily numeral as well as control of color of the box?
However, you can choose a border instead of a box:
Comment out line 44 (cairo_fill(cr))
Comment in line 43 (cairo_stroke(cr))
In order to be able to set the line thickness, I have added a corresponding line:
Line 42 (cairo_set_line_width(cr,3))
Code: Select all
cairo_set_line_width(cr,3)
cairo_stroke(cr) -- Markierung "Heute" durch Umrandung / Marking today by border
-- cairo_fill(cr) -- Markierung "Heute" durch Hintergrund / Marking today by background
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
Re: Need help to edit .lua file for next and previous month displays
but I can build a calendar that deals with each day individually. This also offers the possibility to add colors and/or font styles to holidays, dates, anniversaries, etc. individually. But it will take some time.
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: Need help to edit .lua file for next and previous month displays
Code: Select all
cairo_set_line_width(cr,3)
cairo_stroke(cr) -- Markierung "Heute" durch Umrandung / Marking today by border
-- cairo_fill(cr) -- Markierung "Heute" durch Hintergrund / Marking today by background
Thank you Bleys!
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Need help to edit .lua file for next and previous month displays
I will be happy to test out any features you care to take the time to code
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Need help to edit .lua file for next and previous month displays
I gave a shot at editing set_line_width to cr,2 from cr,3 and the box looks much sharper!Logansfury wrote: ⤴Wed Jan 31, 2024 4:34 pmI have performed this edit, and switched the box color from black to white. The white box around the white numerals with black dropshadow looks great!Code: Select all
cairo_set_line_width(cr,3) cairo_stroke(cr) -- Markierung "Heute" durch Umrandung / Marking today by border -- cairo_fill(cr) -- Markierung "Heute" durch Hintergrund / Marking today by background
Thank you Bleys!
Re: Need help to edit .lua file for next and previous month displays
Bleys, can you translate your comments in the script to english? I can read them, but makes it much easier for our english users.
Re: Need help to edit .lua file for next and previous month displays
Of course. I still have to clean up the code and I'll also adapt the descriptions. And then I'll post the result in my gists.
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: Need help to edit .lua file for next and previous month displays
Bleys I have seen your desktops on the 2024 "show off your desktop" thread. You make some of the most exquisite .lua conkys I have ever seen.
I really appreciate the time and work you are going to to share these and I'm sure a lot of thread lurkers are benefiting as well
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Need help to edit .lua file for next and previous month displays
Hey Bleys,
Forgive my ignorance, but what does "I'll post the result in my gists" mean? I draw a complete blank at "gists" Is that referring to posting here or to a repository for scripts that you maintain?
Also for anyone following the thread to get their own calendar, I have made a little addition to the calendar display - Day and Week # of current Year:
This is it's own little conky, based on the .conf file that defines the font, color, and sizes for my Minimalis display:
Code: Select all
conky.config = {
alignment = 'top_middle',
background = true,
border_width = 1,
cpu_avg_samples = 2,
default_color = 'gray',
default_outline_color = 'black',
default_shade_color = 'white',
color0 = '#ffffff',
color1 = '#ff0000',
double_buffer = true,
draw_borders = false,
draw_graph_borders = true,
draw_outline = true,
draw_shades = false,
extra_newline = false,
font = 'Neon 80s:size=10',
gap_x = 476,
gap_y = 60,
minimum_height = 40,
minimum_width = 380,
net_avg_samples = 2,
no_buffers = true,
out_to_console = false,
out_to_ncurses = false,
out_to_stderr = false,
out_to_x = true,
own_window = true,
own_window_class = 'Conky',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_type = 'desktop',
own_window_hints ='undecorated,sticky,skip_taskbar,skip_pager,below',
show_graph_range = false,
show_graph_scale = false,
stippled_borders = 0,
update_interval = 1.0,
uppercase = false,
use_spacer = 'none',
use_xft = true,
}
conky.text = [[
${color1}${font}Week: ${color0}${font}${time %U}${color1} Day: ${color0}${time %j}${color1} of ${color0}${time %Y}
]];
The output confuses me however. If Jan 1-7 was week 1, Jan 8-14 week 2, Jan 15-21 week 3, Jan 22-28 week 4 and we are currently in Jan 29-Feb 4 which seems to me to be the 5th week of the year. For some reason this script as well as web resources all agree this is the 4th week of the year and not the 5th. The only thing that makes sense is something I caught online about some counts waiting for the first sunday of the week as they consider this the first day of that week. In this case Jan 7-13 week 1, Jan 14-20 week 2, Jan 21-27 week 3 and Jan 28-Feb 3 makes this the last day of week 4 by this calculation. I believe this must be what the
Code: Select all
time %U
Anyhow, enjoy the little conky to anyone that chooses to use any part of it
Re: Need help to edit .lua file for next and previous month displays
https://gist.github.com/rdschmidtLogansfury wrote: ⤴Sat Feb 03, 2024 7:34 pm Hey Bleys,
Forgive my ignorance, but what does "I'll post the result in my gists" mean? I draw a complete blank at "gists" Is that referring to posting here or to a repository for scripts that you maintain?
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: Need help to edit .lua file for next and previous month displays
Far out, I suspected something to do with Github! Thanks for the confirmation.