.lua help please. Capitolizing all lowercase variable contents [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

.lua help please. Capitolizing all lowercase variable contents [SOLVED]

Post by Logansfury »

Hello everyone,

I am working on editing a calendar conky widget authored by Bleys. The main piece of the widget is the .lua file. In this file there is a variable called wetter[1] and it has weather description information which is always in all lowercase letters. I would like every word in the description to have it's first letter capitolized (so "scattered clouds" becomes "Scattered Clouds" etc).

Does anyone know .lua well enough to help?

Thank you for reading,

Logan
Last edited by Logansfury on Thu Feb 08, 2024 4:04 am, edited 1 time in total.
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: .lua help please. Capitolizing all lowercase variable contents

Post by Logansfury »

I got the answer from the net. Im my case it was using the code:

Code: Select all

wetter[1] = string.gsub(wetter[1], "%f[%l]%l", string.upper)
The output looks much better with the capitol formatting :)
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
Post Reply

Return to “Compiz, Conky, Docks & Widgets”