I have found a calendar with a transparent bg. May I have help editing it please? [SOLVED]

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

I have found a calendar with a transparent bg. May I have help editing it please? [SOLVED]

Post by Logansfury »

Hello everyone,

I discovered a webpage where a Linux user posted his previous/current/next month calendar for conky. I have been able to set the colors and the font to my preference, the issue is the numerals are completely out of format and do not at all line up with the days to make clean vertical columns of text.

Can anyone tell me if:

1) The calendar can be formatted

2) Whats the easiest way to eliminate the previous & next calendars? I tried just removing the lines for displaying them in .conf but this made the current month calendar disappear as well.

Here's the files:

conky.conf

Code: Select all

-- needs package cal (provided by ncal) - sudo apt install ncal
conky.config = {
	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,
	update_interval = 60,
	double_buffer = true,
	alignment = 'top_middle',
	gap_x = 500,-- left | right
	gap_y = 0,-- up | down
    minimum_width = 518, minimum_height = 174,
    maximum_width = 518,
	use_xft = true,
	draw_outline = false,
	draw_shades = true,	
	font = 'Neon 80s:size=9',
	default_color = 'e82127',
};
conky.text = [[
${image calendar.png -p 0,0}\
${voffset 31}${execpi 60 ./previousmonth.sh}
${voffset -123}${execpi 60 ./currentmonth.sh}
${voffset -105}${execpi 60 ./nextmonth.sh}
# ${alignc}${voffset 3}${color white}${font Neon 80s:bold:size=10}${time %A %B %e, %Y}${font}${color}
]];
currentmonth.sh

Code: Select all

#!/bin/bash
YEAR=`date +%_Y`;TDY=`date +%_d`;MTH=`date +%_B`; cal | sed s/"\([^a-zA-Z]\)$MTH"'\b'/'${color white}${font Neon 80s:bold:size=11} '"    $MTH"'${color}'/ | sed s/"\([^0-9]\)$YEAR"'\b'/'${color white}'" $YEAR"'${color}${font}'/ | sed s/"\([^0-9]\)$TDY"'\b'/'${color white}'" $TDY"'${color}'/ | sed s/^/'${alignc}'/
nextmonth.sh

Code: Select all

#!/bin/bash
YEAR=`date --date='next month' +%_Y`; MONTH=`date --date='next month' +%_m`; MTH=`date --date='next month' +%_B`; cal -m $MONTH $YEAR | sed s/"\([^a-zA-Z]\)$MTH"'\b'/'${color red}'" $MTH"'${color}'/ | sed s/"\([^0-9]\)$YEAR"'\b'/'${color red}'" $YEAR"'${color}'/ | sed s/^/'${alignr 30}'/
previousmonth.sh

Code: Select all

#!/bin/bash
YEAR=`date --date='1 month ago' +%_Y`; MONTH=`date --date='1 month ago' +%_m`;MTH=`date --date='1 month ago' +%_B`; cal -m $MONTH $YEAR | sed s/"\([^a-zA-Z]\)$MTH"'\b'/'${color red}'" $MTH"'${color}'/ | sed s/"\([^0-9]\)$YEAR"'\b'/'${color red}'" $YEAR"'${color}'/ | sed s/^/'${offset 30}'/
Thank you for reading,

Logan
Last edited by Logansfury on Sat Jan 27, 2024 1:44 am, edited 1 time in total.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
zcot
Level 9
Level 9
Posts: 2838
Joined: Wed Oct 19, 2016 6:08 pm

Re: I have found a calendar with a transparent bg. May I have help editing it please?

Post by zcot »

Code: Select all

${voffset 31}${execpi 60 ./previousmonth.sh}
${voffset -123}${execpi 60 ./currentmonth.sh}
${voffset -105}${execpi 60 ./nextmonth.sh}

Code: Select all

${voffset 31}${execpi 60 ./currentmonth.sh}
notice that voffset change.

I don't have all the files to test, you didn't provide that.

Code: Select all

${image calendar.png -p 0,0}\
-that's the first line and showing some image, no clue what it looks like. the backslash at the ends makes it to where the next line will be a continuation from this backslash line.
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: I have found a calendar with a transparent bg. May I have help editing it please?

Post by Logansfury »

I'm desperately trying to find the page this came from. It was buried in a forum, and all that was available was the code for currentmonth.sh, nextmonth.sh, previousmonth.sh and the conky.conf. No image file was mentioned or made available, but even without that the script is displaying all 3 calendars, with my font and color edits.

The only issue with these is the way the day of month numbers don't line up to form even columns beneath the month name abbreviations.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: I have found a calendar with a transparent bg. May I have help editing it please?

Post by Logansfury »

Here is how they are displaying on my screen without any image file:

https://imgur.com/a/eQE2Ctx
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
zcot
Level 9
Level 9
Posts: 2838
Joined: Wed Oct 19, 2016 6:08 pm

Re: I have found a calendar with a transparent bg. May I have help editing it please?

Post by zcot »

It's because you change the font to a non monospace font where any given character or space is any different pixels wide.
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: I have found a calendar with a transparent bg. May I have help editing it please?

Post by Logansfury »

I found the page this script came from:

https://forums.bunsenlabs.org/viewtopic ... 65#p122965

I restored the monaco font to the scripts and installed it on my system and the numerals are now aligned.

I found the picture but I hate it and want to eliminate it, its a big ugly frame and background that clashes with my wallpaper.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: I have found a calendar with a transparent bg. May I have help editing it please?

Post by Logansfury »

The calendars are looking pretty good. Not perfect but good. I am getting used to seeing all 3 and may stick with previous/current/next displays.

I customized the font of the one text display I could without messing anything up, that was the current month month-name and year display. The rest of the text is restored to monaco font which I installed on my system, and all the days form clean columns below the day-names. I have deleted the line calling the picture I dont wan't to use, and have retained a completely transparent background with no visible boarder.

What do you guys think:
Image
Last edited by Logansfury on Tue Jan 30, 2024 12:06 am, edited 1 time in total.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
zcot
Level 9
Level 9
Posts: 2838
Joined: Wed Oct 19, 2016 6:08 pm

Re: I have found a calendar with a transparent bg. May I have help editing it please? [SOLVED]

Post by zcot »

Excellent, good job!
Post Reply

Return to “Compiz, Conky, Docks & Widgets”