1

The conky configuration Harmattan displays information about the current state of the weather but it does not display the name of the city that the weather refers to.

How can I add the name of the city as well?

1 Answer 1

2

Open the ~/.conkyrc file. This is a hidden file in your home directory. You can see the hidden files by hitting Ctrl+H.

In this file, find a line that says

# The "conditions" section of the conky #

3 lines below the above line, there's a line beginning with

${goto 46}${voffset 14}${font Droid Sans :size=12}

We will use this line later.

Make a new text file using your favorite text editor and add the following in it:

#!/bin/bash
grep "yweather:location" ~/.cache/weather.xml | grep -o "city=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" |tr -d '\n' && echo -n " - " && grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"

Save the file in your home folder. I saved it in ~/.conky-weather/town_descr. Remember to mark it as executable by going to Properties->Permissions->Execute file as program.

Then go back to that line you've found into ~/.conkyrc and edit it to be like this:

${goto 46}${voffset 14}${font Droid Sans :size=11}${color1}${execi 300 ~/.conky-weather/town_descr}${font}${color}

Notice we've reduced the font side to 11 because now the town name will be displayed as well and we need more space.

Result:

conky result

Notice the "Patra - Partly Cloudy"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .