Skip to content

Commit

Permalink
weather@mockturtl: Add line break to Override options (linuxmint#6103)
Browse files Browse the repository at this point in the history
  • Loading branch information
aperkins81 authored Jun 20, 2024
1 parent acc0a26 commit 7555851
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions weather@mockturtl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ The setting allows you to make the applet display basically anything in the form
| `{country}` | Country name shown in the popup |
| `{search_entry}` | Search entry text in manual location (or location store) |
| `{last_updated}` | Formatted last updated time |
| `{br}` | Line Break |

## Run script when the weather data changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9360,7 +9360,8 @@ function InjectValues(text, weather, config, inCommand = false) {
.replace(/{{city}}/g, Literal(city))
.replace(/{{country}}/g, Literal(country))
.replace(/{{search_entry}}/g, Literal(searchEntry))
.replace(/{{last_updated}}/g, Literal(lastUpdatedTime));
.replace(/{{last_updated}}/g, Literal(lastUpdatedTime))
.replace(/{{br}}/g, Literal("\n"));
}
return text.replace(/{t}/g, temp)
.replace(/{u}/g, tempUnit)
Expand All @@ -9377,7 +9378,8 @@ function InjectValues(text, weather, config, inCommand = false) {
.replace(/{city}/g, city)
.replace(/{country}/g, country)
.replace(/{search_entry}/g, searchEntry)
.replace(/{last_updated}/g, lastUpdatedTime);
.replace(/{last_updated}/g, lastUpdatedTime)
.replace(/{br}/g, "\n");
}
function CapitalizeFirstLetter(description) {
if ((description == undefined || description == null)) {
Expand Down
6 changes: 4 additions & 2 deletions weather@mockturtl/src/3_8/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ export function InjectValues(text: string, weather: WeatherData, config: Config,
.replace(/{{city}}/g, Literal(city))
.replace(/{{country}}/g, Literal(country))
.replace(/{{search_entry}}/g, Literal(searchEntry))
.replace(/{{last_updated}}/g, Literal(lastUpdatedTime));
.replace(/{{last_updated}}/g, Literal(lastUpdatedTime))
.replace(/{{br}}/g, Literal("\n"));
}

return text.replace(/{t}/g, temp)
Expand All @@ -114,7 +115,8 @@ export function InjectValues(text: string, weather: WeatherData, config: Config,
.replace(/{city}/g, city)
.replace(/{country}/g, country)
.replace(/{search_entry}/g, searchEntry)
.replace(/{last_updated}/g, lastUpdatedTime);
.replace(/{last_updated}/g, lastUpdatedTime)
.replace(/{br}/g, "\n");
}

export function CapitalizeFirstLetter(description: string): string {
Expand Down

0 comments on commit 7555851

Please sign in to comment.