looking for small time display edit in conky.conf file please [SOLVED]

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Post Reply
User avatar
Logansfury
Level 6
Level 6
Posts: 1409
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

looking for small time display edit in conky.conf file please [SOLVED]

Post by Logansfury »

Hello everyone,

I have a workspace that is employing the Victor Conky. This conky displays the time of day with the following line of bash text:

${voffset -11}${goto 30}${color1}${font Neon 80s:style=bold:size=30}${time %I:%M%P}${voffset 22}${color1}${goto 218}${font Neon 80s:style=Bold:size=14}CPU

This is fine, except that it is showing a 0 preceding the number from 1 to 9 o' clock AM or PM.

Is it possible to edit the above line in the conky format/syntax to eliminate the 0 from in front of the time display?

Thanks for reading :)

Logan
Last edited by Logansfury on Fri Apr 12, 2024 4:55 pm, edited 1 time in total.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Koentje
Level 7
Level 7
Posts: 1620
Joined: Tue Jan 04, 2022 6:23 pm
Location: Netherlands

Re: looking for small time display edit in conky.conf file please

Post by Koentje »

Replace
${time %I:%M%P}

with
${exec date +'%I:%M%P' | sed 's/^0//g'}
Image
User avatar
Logansfury
Level 6
Level 6
Posts: 1409
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: looking for small time display edit in conky.conf file please

Post by Logansfury »

Koentje wrote: Fri Apr 12, 2024 4:49 pm Replace
${time %I:%M%P}

with
${exec date +'%I:%M%P' | sed 's/^0//g'}
That is exactly what I needed, the display looks much better!

Thank you Koentje :)
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
trinidad
Level 1
Level 1
Posts: 43
Joined: Fri Dec 23, 2022 11:14 am
Location: Wisconsin
Contact:

Re: looking for small time display edit in conky.conf file please [SOLVED]

Post by trinidad »

Code: Select all

${alignc}${font Noto Sans:size=11}${color}Chicago Illinois ${color}${time %H : %M}
${alignc}${color}${time %A, }${time %e %B %Y}
${alignc}${color1}Auckland New Zealand  ${color}${tztime /usr/share/zoneinfo/Pacific/Auckland %H : %M}
${alignc}${color}${tztime /usr/share/zoneinfo/Pacific/Auckland %A, %e %B %Y}
I use this to keep track of the time difference between NZ and the US. I leave the 24hr format so I know the hours difference and don't wake people up in the middle of the night.

https://dbts-analytics.com/new24stff2.html

TC
User avatar
Logansfury
Level 6
Level 6
Posts: 1409
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: looking for small time display edit in conky.conf file please [SOLVED]

Post by Logansfury »

trinidad wrote: Wed Apr 17, 2024 8:48 am

Code: Select all

${alignc}${font Noto Sans:size=11}${color}Chicago Illinois ${color}${time %H : %M}
${alignc}${color}${time %A, }${time %e %B %Y}
${alignc}${color1}Auckland New Zealand  ${color}${tztime /usr/share/zoneinfo/Pacific/Auckland %H : %M}
${alignc}${color}${tztime /usr/share/zoneinfo/Pacific/Auckland %A, %e %B %Y}
I use this to keep track of the time difference between NZ and the US. I leave the 24hr format so I know the hours difference and don't wake people up in the middle of the night.

Image

TC
That is an excellent idea, tracking multiple time zones! Thank you for sharing the code. Can you repost the URL to your image, it shows as broken link to me.

EDIT: I see you just fixed the URL, thanks! Very nice looking Linux GUI!
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
Post Reply

Return to “Scripts & Bash”