You are not logged in.
I have same, the problem is here, I think :
${if_match ${time %e} == 1}${time %d} \ ${if_match ${time %m} == 01}janvier${else}\ ${if_match ${time %m} == 02}février${else}\ ${if_match ${time %m} == 03}mars${else}\ ${if_match ${time %m} == 04}avril${else}\ ${if_match ${time %m} == 05}mai${else}\ ${if_match ${time %m} == 06}juin${else}\ ${if_match ${time %m} == 07}juillet${else}\ ${if_match ${time %m} == 08}août${else}\ ${if_match ${time %m} == 09}septembre${else}\ ${if_match ${time %m} == 10}octobre${else}\ ${if_match ${time %m} == 11}novembre${else}\ décembre${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif} \
There are 12 ${if_match.... and just 11 ${endif}
But If I had and ${endif}, I have this result :
http://pix.toile-libre.org/upload/img/1429535874.jpgAnd with 11 ${endif}, I have the error, but result is good :
http://pix.toile-libre.org/upload/img/1429536089.jpg
Try this:
${color5}${alignc}${membar 0,100} French Time ${membar 0,100}${color}
${alignc}${execpi 30 talktime_fr.sh}
${alignc}${if_match ${time %u} == 1}lundi${else}\
${if_match ${time %u} == 2}mardi${else}\
${if_match ${time %u} == 3}mercredi${else}\
${if_match ${time %u} == 4}jeudi${else}\
${if_match ${time %u} == 5}vendredi${else}\
${if_match ${time %u} == 6}samedi${else}\
dimanche${endif}${endif}${endif}${endif}${endif}${endif} \
${time %d} \
${if_match ${time %m} == 01}janvier${else}\
${if_match ${time %m} == 02}février${else}\
${if_match ${time %m} == 03}mars${else}\
${if_match ${time %m} == 04}avril${else}\
${if_match ${time %m} == 05}mai${else}\
${if_match ${time %m} == 06}juin${else}\
${if_match ${time %m} == 07}juillet${else}\
${if_match ${time %m} == 08}août${else}\
${if_match ${time %m} == 09}septembre${else}\
${if_match ${time %m} == 10}octobre${else}\
${if_match ${time %m} == 11}novembre${else}\
décembre${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif} \
${time %Y}
I don't think that ${time %e} is needed and I think THAT ${if_match} is messing things up.
${if_match ${time %e} == 1}${time %d} \
Must do a long term test.
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
Thank Sector, now that work fine without error when I launch the conky.
I correct my post #8294
Offline
Glad it's working and thanks for your help.
I'm testing a new line ... need to wait until May though:
${if_match ${time %e} <= 9}${time %e}${else}${time %d}${endif} \
time %e is the day number with a leading blank. If using a "good" mono font it should look OK.
1 May
01 May
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
Ok Sector,
I test your new line by changing the date on my laptop, and that work fine (I test with day 1 to 9)
Offline
@ichase
What happens when you do this?
In a terminal that is in the same directory as the "conkyClementine.py" script run this command "python2 conkyClementine.py --datatype=PP" and post the result.
Offline
Ok Sector,
I test your new line by changing the date on my laptop, and that work fine (I test with day 1 to 9)
OK - perfect Thank you.
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
I have bug with your last code's line, hours before 10 are not showing.
But i found what happen.
In the talktime_fr.sh, there is :
case $t_hr in
00)
t_hr_text=minuit ;;
01)
t_hr_text="une heure" ;;
02)
t_hr_text="deux heure" ;;
03)
t_hr_text="trois heure" ;;
04)
t_hr_text="quatre heure" ;;
05)
t_hr_text="cinq heure" ;;
06)
t_hr_text="six heure" ;;
07)
t_hr_text="sept heure" ;;
08)
t_hr_text="huit heure" ;;
09)
t_hr_text="neuf heure" ;;
I replace by :
case $t_hr in
0)
t_hr_text=minuit ;;
1)
t_hr_text="une heure" ;;
2)
t_hr_text="deux heure" ;;
3)
t_hr_text="trois heure" ;;
4)
t_hr_text="quatre heure" ;;
5)
t_hr_text="cinq heure" ;;
6)
t_hr_text="six heure" ;;
7)
t_hr_text="sept heure" ;;
8)
t_hr_text="huit heure" ;;
9)
t_hr_text="neuf heure" ;;
and that work, because your last code'line replace 00 by 0, 01 by 1, etc...
Offline
You may have more problems after 12 noon - ie: 13:00 14:00
The original code I have for French Time was for 24 hours time ... when you changed it I didn't notice you have changed it to 12 hour time
The new line I gave you
${if_match ${time %e} <= 9}${time %e}${else}${time %d}${endif} \
is for "day" numbers.
Here's a working 12 Hour French Time for conky (hopefully):
#!/bin/sh
# DC's english time 07/07/09
# Tweaked by Sector11
# More French help by: chepioq
#
# find current time
t_hr=$(date +%-I)
#echo $t_hr
t_min=$(date +%-M)
#echo $t_min
#t_hr=9 #tester
#t_min=17 #tester
# is it time to one ( the only wierd case)
if [ $t_hr -eq 12 ] && [ $t_min -gt 32 ] ;then
# what minute is it
case $t_min in
33|34|35|36|37)
echo une heure moins vingt-cinq ;;
38|39|40|41|42)
echo une heure moins vingt ;;
43|44|45|46|47)
echo une heure moins le quart ;;
48|49|50|51|52)
echo une heure moins dix ;;
53|54|55|56|57|58|59)
echo une heure moins cinq ;;
58|59)
echo presque une heure
esac
exit
fi
#echo $t_hr
#add one hour for the "to" hour
if [ $t_min -gt 32 ] ; then
t_hr=$(($t_hr + 1)) # override t_hr
fi
#echo $t_hr
# find out what hour it is and change into text
case $t_hr in
0)
t_hr_text=minuit ;;
1)
t_hr_text="une heure" ;;
2)
t_hr_text="deux heure" ;;
3)
t_hr_text="trois heure" ;;
4)
t_hr_text="quatre heure" ;;
5)
t_hr_text="cinq heure" ;;
6)
t_hr_text="six heure" ;;
7)
t_hr_text="sept heure" ;;
8)
t_hr_text="huit heure" ;;
9)
t_hr_text="neuf heure" ;;
10)
t_hr_text="dix heure" ;;
11)
t_hr_text="onze heure" ;;
12)
t_hr_text=midi ;;
esac
# what minute is it
case $t_min in
0|1|2)
echo $t_hr_text ;;
3|4|5|6|7)
echo $t_hr_text cinq ;;
8|9|10|11|12)
echo $t_hr_text dix ;;
13|14|15|16|17)
echo $t_hr_text et quart ;;
18|19|20|21|22)
echo $t_hr_text vingt ;;
23|24|25|26|27)
echo $t_hr_text vingt-cinq;;
28|29|30|31|32)
echo $t_hr_text et demie ;;
33|34|35|36|37)
echo $t_hr_text moins vingt-cinq ;;
38|39|40|41|42)
echo $t_hr_text moins vingt ;;
43|44|45|46|47)
echo $t_hr_text moins le quart ;;
48|49|50|51|52)
echo $t_hr_text moins dix ;;
53|54|55|56|57)
echo $t_hr_text moins cinq ;;
58|59)
echo presque $t_hr_text ;;
esac
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
I don't change for 12 hours format, I have 24 hours format.
My talktime_fr.sh
#!/bin/sh
# DC's english time 07/07/09
# Tweaked by Sector11
# Converted to French by Sector11 with help from ragamatrix
# find current time
t_hr=$(date +%-H)
#echo $t_hr
t_min=$(date +%-M)
#echo $t_min
#t_hr=9 #tester
#t_min=17 #tester
# is it time to ONE ( the only wierd case)
if [ $t_hr -eq 12 ] && [ $t_min -gt 32 ] ;then
# what minute is it
case $t_min in
33|34|35|36|37)
echo une heure moins vingt-cinq ;;
38|39|40|41|42)
echo une heure moins vingt ;;
43|44|45|46|47)
echo une heure moins le quart ;;
48|49|50|51|52)
echo une heure moins dix ;;
53|54|55|56|57|58|59)
echo une heure moins cinq ;;
58|59)
echo presque une heure
esac
exit
fi
#echo $t_hr
#add one hour for the "to" hour
if [ $t_min -gt 32 ] ; then
t_hr=$(($t_hr + 1)) # override t_hr
fi
#echo $t_hr
# find out what hour it is and change into text
case $t_hr in
0)
t_hr_text=minuit ;;
1)
t_hr_text="une heure" ;;
2)
t_hr_text="deux heure" ;;
3)
t_hr_text="trois heure" ;;
4)
t_hr_text="quatre heure" ;;
5)
t_hr_text="cinq heure" ;;
6)
t_hr_text="six heure" ;;
7)
t_hr_text="sept heure" ;;
8)
t_hr_text="huit heure" ;;
9)
t_hr_text="neuf heure" ;;
10)
t_hr_text="dix heure" ;;
11)
t_hr_text="onze heure" ;;
12)
t_hr_text=midi ;;
13)
t_hr_text="treize heure" ;;
14)
t_hr_text="quatorze heure" ;;
15)
t_hr_text="quinze heure" ;;
16)
t_hr_text="seize heure" ;;
17)
t_hr_text="dix-sept heure" ;;
18)
t_hr_text="dix-huit heure" ;;
19)
t_hr_text="dix-neuf heure" ;;
20)
t_hr_text="vingt heure" ;;
21)
t_hr_text="vingt et une heure" ;;
22)
t_hr_text="vingt-deux heure" ;;
23)
t_hr_text="vingt-trois heure" ;;
esac
# what minute is it
case $t_min in
0|1|2)
echo $t_hr_text ;;
3|4|5|6|7)
echo $t_hr_text cinq ;;
8|9|10|11|12)
echo $t_hr_text dix ;;
13|14|15|16|17)
echo $t_hr_text et quart ;;
18|19|20|21|22)
echo $t_hr_text vingt ;;
23|24|25|26|27)
echo $t_hr_text vingt-cinq;;
28|29|30|31|32)
echo $t_hr_text et demie ;;
33|34|35|36|37)
echo $t_hr_text moins vingt-cinq ;;
38|39|40|41|42)
echo $t_hr_text moins vingt ;;
43|44|45|46|47)
echo $t_hr_text moins le quart ;;
48|49|50|51|52)
echo $t_hr_text moins dix ;;
53|54|55|56|57)
echo $t_hr_text moins cinq ;;
58|59)
echo ± $t_hr_text ;;
esac
and that work fine.
Offline
I found where is the error, and my code solve it, but for other reason.
In post #8292, in the talktime_fr.sh, you have define "t_hr=$(date +%-H)"
And in man date:
%H hour (00..23)
....................................................................
By default, date pads numeric fields with zeroes. The following optional flags may follow '%':
- (hyphen) do not pad the field
And you have
00)
t_hr_text=minuit ;;
01)
t_hr_text=une ;;
02)
t_hr_text=deux ;;
03)
t_hr_text=trois ;;
04)
t_hr_text=quatre ;;
05)
t_hr_text=cinq ;;
06)
t_hr_text=six ;;
07)
t_hr_text=sept ;;
08)
t_hr_text=huit ;;
09)
t_hr_text=neuf ;;
and that don't work because the field need 0, 1, 2,... and not 00, 01, 02,....
I don't know if I'm clear enough
Offline
I'm finding even more errors ... back later.
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
I found where is the error, and my code solve it, but for other reason.
In post #8292, in the talktime_fr.sh, you have define "t_hr=$(date +%-H)"
I don't know if I'm clear enough
Perfectly clear.
I'm in test mode again
21 Apr 15 | 18:02:45 ~
$ talktime_fr_24.sh
dix-huit heure
21 Apr 15 | 18:02:48 ~
$ talktime_fr.sh
six heure
21 Apr 15 | 18:02:52 ~
$ talktime_fr.sh
six heure cinq
21 Apr 15 | 18:03:26 ~
$ talktime_fr_24.sh
dix-huit heure et cinco
21 Apr 15 | 18:03:29 ~
$
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
From the remind Fans List I got a request to show how this conky works.
Here you go Dave - The conky: S11_Rem_Cal.conky
# pkill -xf "conky -c /media/5/Conky/S11_Rem_Cal.conky" &
# Reminder fix compliments: Reid Thompson
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
#own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_class Conky
own_window_title Remind Calendar
#own_window_colour gray
### ARGB can be used for real transparency
own_window_argb_visual yes
own_window_argb_value 100
# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes
minimum_size 190 0 ## w|h 190
maximum_width 190
gap_x 9 # l|r
gap_y 9 # u|d
alignment tr
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Monofur:size=11
xftfont Fantasque Sans Mono:bold:size=10
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
draw_shades yes #no # amplifies text if yes p
default_shade_color 000000
draw_outline no # amplifies text if yes
default_outline_color 000000
default_color DCDCDC #220 220 220 Gainsboro
#default_color C0C0C0 #192 192 192 Silver
#default_color 778899 #119 136 153 LightSlateGray
#default_color B0E0E6 #176 224 230 PowderBlue
#default_color FFDEAD #255 222 173 NavajoWhite
color0 B0C4DE #176 196 222 LightSteelBlue
color1 B0E0E6 #176 224 230 PowderBlue
color2 FFD700 #Gold
color3 A9A9A9 #169 169 169 DarkGray
color4 FFA07A #255 160 122 LightSalmon
color5 778899 #119 136 153 LightSlateGray
color6 00BFFF # 0 191 255 DeepSkyBlue
color7 5F9EA0 # 95 158 160 CadetBlue
color8 FFDEAD #255 222 173 NavajoWhite
color9 CD5C5C #205 92 92 IndianRed
##################################################### End Color Settings ###
### Borders Section ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
#default_graph_size 15 40
##################################################### End Borders Secton ###
### Miscellaneous Section ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes
# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none
# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 1800
# Subtract (file system) buffers from used memory?
no_buffers yes
# change GiB to G and MiB to M
short_units yes
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
# Maximum size of user text buffer, i.e. layout below TEXT line in config file
# (default is 16384 bytes)
# max_user_text 16384
# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit
############################################## End Miscellaneous Section ###
### LUA Settings ###########################################################
## Above and After TEXT - After - requires a composite manager or blinks.
##
#lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 15 0 0 0 0 0x000000 0.3
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
####################################################### End LUA Settings ###
##${goto 20}SU MO ${color6}${time %b %Y}${color} FR SA
##${goto 20}${color3}${execpi 7200 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color3}/' | sed ':a;N;$!ba;s/\n/\n${goto 20}/g'}${color}
### REMINDER NOTE ###
# ~/.reminders - permissions must be:
#Owner: username
#Access: Read & Write
#Group: username
#Access: Read only
#Others: Read only
## Kino - remind -mc+4 ~/.reminders
### REMINDER NOTE ###
####${execpi 86400 ncal -bh | /media/5/Conky/scripts/ncal2.awk}
###### my original - shows just the month.
####${execpi 86400 rem -s | cut -c9-10,19-}
#### Kino: rem -s -b1 | cut -c 6-10,22- ## shows 03/25 NICE!
#### Because of Kino: rem -s+4 -b1 | cut -c 6-10,22- ## shows 03/25 = 4 weeks
#${goto 32}${color5}SU MO ${color}${time %b %Y}${color5} FR SA
#${goto 32}${color5}${execpi 43200 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color}&${color5}/' | sed ':a;N;$!ba;s/\n/\n${goto 32}/g'}${color}
## ${color7}${membar 0}${color}
## GG improvements:
## ${pre_exec date | awk '{print $1" "$3" "$2}'}
## ${time %a %d %b (%V)}
##### 4 weeks
#${font Fantasque Sans Mono:bold:size=14}${color6}Next 4 Weeks${color}${font}
#${execpi 86400 rem -s+4 -b1 | cut -c6-10,19-}
### PUT BACK
#${color7}${membar 0}${color}
#${font Fantasque Sans Mono:bold:size=14}${color6}TV Time${color}${font}
#${execpi 86400 head /media/5/Conky/Days/all.txt -n 49}${font}
# Do I need fold?
#${execpi 86400 remind -q -r ~/.reminders | fold -sw70 | sed -e "/.*(today):/d" -e '/^$/d'}
update_interval 1
TEXT
${font Fantasque Sans Mono:bold:size=12}${color6}Reminders${color}${font}
${color7}${membar 0}${color}
${color6}Easter:${color} ${pre_exec ncal -e}
${color7}${membar 0}${color}
${execpi 86400 /media/5/Conky/scripts/remind-cal.sh}
${color7}${membar 0}${color}
${font Fantasque Sans Mono:bold:size=12}${color6}${time %a %d %b}${color}${font}
${execpi 86400 remind -q -r ~/.reminders | sed -e "/.*(today):/d" -e '/^$/d'}
${color7}${membar 0}${color}
${font Fantasque Sans Mono:bold:size=12}${color6}${time %b %Y} & ${execi 86400 date --date="+1 month" +"%b %Y"}${color}${font}
${execpi 86400 rem -s2 | cut -c6-10,19-}
${color7}${membar 0}${color}
and MobileDiesel's calendar script that highlights this months "reminders": remind-cal.sh
#!/bin/bash
# calendar.sh
# copyright 2011 by Mobilediesel
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
# WARNING - No longer works
#m="m" # uncomment this line for starting the week on Monday instead of Sunday.
# WARNING - No longer works
dates=$(remind -s $HOME/.reminders | awk -F"[ /]+" '{if ( $3!=strftime( "%d" ) ) {DAYS=DAYS $3+0"|"}} END{sub("\\|$","",DAYS);printf DAYS}')
ncal -h -b -3$m | awk -v DAYS=${dates} '{
{if ( substr($0,1,20)!~/^ *$/ )
{PREV=substr($0,1,20)}}
{if ( NR==3 )
{NEXT=substr($0,45,20)} {sub(/^ */," ",NEXT)}}
{if ( NR==1 )
MONTH=substr($0,23,20)}
{if ( NR==2 )
DOW=substr($0,23,20)}
{if ( substr($0,23,20)!~/^ *$/ && NR!=1 && NR!=2 )
{tmp=substr($0,23,20);sub("^ +1\\>"," 1",tmp);sub(/[ ]+$/,"",tmp)
{if ( length(tmp)==20 || NR==3 )
CAL=CAL tmp"\n"
else
CAL=CAL tmp" "}}}}
END{
{gsub("\\<("DAYS")\\>","${color6}&${color5}",CAL)}
{sub("\\<"strftime( "%-d" )"\\>","${color1}&${color5}",CAL)}
sub(/[ ]+$/," ",PREV)
{if ( length(PREV)==20 )
PREV=PREV"\n"}
print "${color1}"MONTH"\n${color1}"DOW"\n${color3}"PREV"${color5}"CAL"${color3}"NEXT
}'
exit
Since I use ${execpi 86400 remind ...} and ${execpi 86400 rem ...] I can parse the "text" files for conky commands:
REM 13 Aug MSG ${color3}ß Someone.${color}
REM 19 Sep MSG ${color2}@ Mon & Pop${color}
Have fun.
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
This is my weather conky, Based on Conky-Harmattan Tweaked with permission. As you may have noticed uses Yahoo Weather code
Weather icons Smile i have adjusted them from 256x256 to 32x32 because reduce a lot of cpu usage also to fit my preferences layout. So if you want icons 32x32 just le me know, haven't released them so you need a new one for those. Font needed! "cure and anorexia" official page
# Conky settings #
background yes
update_interval 1
double_buffer yes
no_buffers yes
imlib_cache_size 10
# Window specifications #
gap_x 1190
gap_y 38
minimum_size 73
maximum_width 183
own_window yes
own_window_type desktop # other options are: override/normal/desktop/panel
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
#alignment middle_middle
#own_window_argb_visual yes
#own_window_argb_value 0
# Graphics settings #
draw_shades no
draw_outline yes
draw_borders no
default_outline_color 000000
draw_graph_borders no
# Text settings #
use_xft yes
xftalpha 0.8
xftfont cure:size=7
text_buffer_size 256
override_utf8_locale yes
imlib_cache_size 0
# Color scheme
default_color F2F2F2
color1 FFFFFF
color2 F5B800
color3 BFBFBF
TEXT
${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=472135&u=c&d=8" -o ~/.cache/weather.xml}
${font anorexia:bold:size=7}${voffset -3}${alignr}${color2}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} °${font}${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}Current${color}${font}
${execi 300 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:condition" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/weather.png}${image ~/.cache/weather.png -p -1,1 -s 32x32}
${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}+Next${font}${color}
${execi 300 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p -1,35 -s 32x32}
${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +1days +%d}${font}${color}
${execi 300 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p -1,71 -s 32x32}
${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +2days +%d}${font}${color}
${execi 300 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p -1,107 -s 32x32}
${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +3days +%d}${font}${color}
${execi 300 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png ~/.cache/weather-4.png}${image ~/.cache/weather-4.png -p -1,143 -s 32x32}
${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +4days +%d}${font}${color}
${execi 300 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png ~/.cache/weather-5.png}${image ~/.cache/weather-5.png -p -1,179 -s 32x32}
${voffset -9}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +5days +%d}${font}${color}
${execi 300 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6').png ~/.cache/weather-6.png}${image ~/.cache/weather-6.png -p -1,215 -s 32x32}
${voffset -6}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +6days +%d}${font}${color}
${execi 300 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7').png ~/.cache/weather-7.png}${image ~/.cache/weather-7.png -p -1,251 -s 32x32}
${voffset -6}${alignr}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8'}°/${color2}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8'}°${color}
${font cure:bold:size=7}${voffset 0}${alignr}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==8' | tr '[a-z]' '[A-Z]'}, ${execi 3600 date -d +7days +%d}${font}${color}
${execi 300 cp -f ~/.conky/conky-weather/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==7').png ~/.cache/weather-8.png}${image ~/.cache/weather-8.png -p -1,287 -s 32x32}
${font cure:size=7}${color2}${execi 300 grep "yweather:astronomy" ~/.cache/weather.xml | grep -o "sunrise=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}${alignr}Sunrise
${color4}${execi 300 grep "yweather:atmosphere" ~/.cache/weather.xml | grep -o "humidity=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}%${alignr}Humidity${color}
${color5}${execi 300 grep "yweather:wind" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${execi 300 grep "yweather:units" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${alignr}Wind${color}
Sunset${alignr}${color2}${execi 300 grep "yweather:astronomy" ~/.cache/weather.xml | grep -o "sunset=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}
${hr}
${color7}${execi 300 grep "lastBuildDate" ~/.cache/weather.xml | cut -c 33-40}${alignr}Fetch${color}
This code grab information at Yahoo Weather Feed, If you want your location, you must find your state WOEID
Tirane, Albania (currently used)
http://weather.yahooapis.com/forecastrs … 35&u=c&d=8
New York City
http://weather.yahooapis.com/forecastrss?w=2502265
http://weather.yahooapis.com/forecastrs … 65&u=c&d=8
http://weather.yahooapis.com/forecastrs … 5&u=c&d=10
Paris, France
http://weather.yahooapis.com/forecastrss?w=615702
http://weather.yahooapis.com/forecastrs … 02&u=c&d=8
http://weather.yahooapis.com/forecastrs … 2&u=c&d=10
The code feed show default "5days of week" you can tweak up to 7 but if you want to extend even more up to 10 days just change the last number c&d=8 to c&d=10
Documentation here explain everything you need to use.
Old of this code is on this thread but i don't use this style anymore.
If you need any thing else from this code or icons just let me know.
Regards,
Nili
Edit: I have made some changes and forgot a little dust-free to clean, i mean color5 color7.
Last edited by Nili (2015-04-25 15:31:10)
Offline
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
Offline
Thank NILI, I install your weather conky and that work fine.
Can we put it in French ?
Offline
Hi there Nili,
Is there a particular reason the refresh is set to 1 second on it? I'm just curious if this can be set with a looong update time to keep the outward-bound requests to a minimum or if there's a certain aspect to the conky that requires a quick interval.
Offline
I've run into two(perhaps related) issues when trying to apply Nili's weather:
On startup, I get a string of errors:
Conky: /home/schwim/.config/.conky/.conkyweatherrc: 6: no such configuration: 'imlib_cache_size'
Conky: /home/schwim/.config/.conky/.conkyweatherrc: 36: no such configuration: 'imlib_cache_size'
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Then, the images aren't found because they're being called with numbers for names.
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/26.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/38.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/30.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/30.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/30.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/11.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/30.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/34.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/34.png’: No such file or directory
I'm wondering how to know what to rename the images? Is there a legend for what each image should be named to work with the Yahoo weather calls?
Offline
Thank NILI, I install your weather conky and that work fine.
Can we put it in French ?
Ofcourse you can, just must know your city WOEID
this link is for Paris, France
http://weather.yahooapis.com/forecastrss?w=615702
I found also city Nice, FR WOEID 614274
http://weather.yahooapis.com/forecastrss?w=614274
Check out other WOEID on This Link then enough to put WOEID number behind conky url.
Offline
Hi there Nili,
Is there a particular reason the refresh is set to 1 second on it? I'm just curious if this can be set with a looong update time to keep the outward-bound requests to a minimum or if there's a certain aspect to the conky that requires a quick interval.
I know what you mean and have the right in a manner, but conky weather is checking or making refresh every 5min no 1sec even since it's there for no particular reason
just a simple demostration
execi 300 = 5min, interval update is every 5min
${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=472135&u=c&d=8" -o ~/.cache/weather.xml}
this part or any other part with "execi 300" makes the refresh every 5min, So we're not flooding the Weather Services.
If you want to change update interval enough change all those "300 numbers" to higher or lower.
P.S. Fetching is another update Interval that is part of Yahoo Weather.
Hope i have understood exactly your opinion.
Regards,
Nili
Offline
You could use ${exec} and set the update_interval to something longer. Most weather sites update once an hour (not necessarily on the hour) so fetching info every few minutes is a waste (IMHO) and weather for tomorrow and beyond is only an "educated guess" anyway.
update_interval 1200
TEXT
${exec ....}
- 20 minutes would work - - - with one REALLY BIG OOPS!
Change your wallpaper and you have to wait until conky updates to see the new wallpaper
Unless you use ARGB, now your conky updates ever 20 minutes and you see wallpaper changes instantly BUT there is another OOPS! ARGB setting washes out the images.
and on the conky ---- I can't seem to get the icons to work - but then I'm playing with different directories.
/media/5/Conky/Nili-wx/Nili-Weather.conky
/media/5/Conky/Nili-wx/cache/weather.xml
/media/5/Conky/Nili-wx/icon/3232
Used
25 Apr 15 | 15:48:04 /media/5/Conky/Nili-wx/icon/3232
$ mogrify -resize 32 *.png
to resize them...
I'll figure it out.
25 Apr 15 | 16:22:54 ~
$ pkill -xf "conky -c /media/5/Conky/Nili-wx/Nili-Weather.conky" &[2] 24629
[2]+ Done pkill -xf "conky -c /media/5/Conky/Nili-wx/Nili-Weather.conky"
25 Apr 15 | 16:23:05 ~
$ conky -c /media/5/Conky/Nili-wx/Nili-Weather.conky &
[2] 24817
25 Apr 15 | 16:23:12 ~
$ Conky: forked to background, pid is 24822
Conky: desktop window (264) is root window
Conky: window type - normal
Conky: drawing to created window (0x3e00001)
Conky: drawing to double buffer
cp: cannot stat `/media/5/Conky/Nili-wx/icon/3232/29.png': No such file or directory
cp: cannot stat `/media/5/Conky/Nili-wx/icon/3232/33.png': No such file or directory
cp: cannot stat `/media/5/Conky/Nili-wx/icon/3232/34.png': No such file or directory
cp: cannot stat `/media/5/Conky/Nili-wx/icon/3232/28.png': No such file or directory
cp: cannot stat `/media/5/Conky/Nili-wx/icon/3232/12.png': No such file or directory
cp: cannot stat `/media/5/Conky/Nili-wx/icon/3232/12.png': No such file or directory
cp: cannot stat `/media/5/Conky/Nili-wx/icon/3232/30.png': No such file or directory
cp: cannot stat `/media/5/Conky/Nili-wx/icon/3232/30.png': No such file or directory
cp: cannot stat `/media/5/Conky/Nili-wx/icon/3232/30.png': No such file or directory
Conky: Unable to load image '/media/5/Conky/Nili-wx/cache/weather-1.png'
Conky: Unable to load image '/media/5/Conky/Nili-wx/cache/weather-1.png'
Conky: Unable to load image '/media/5/Conky/Nili-wx/cache/weather-1.png'
Conky: Unable to load image '/media/5/Conky/Nili-wx/cache/weather-1.png'
Conky: Unable to load image '/media/5/Conky/Nili-wx/cache/weather-1.png'
Conky: Unable to load image '/media/5/Conky/Nili-wx/cache/weather-1.png'
25 Apr 15 | 16:25:40 ~
$ cp -f /media/5/Conky/Nili-wx/icon/3232/$(grep "yweather:condition" /media/5/Conky/Nili-wx/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png /media/5/Conky/Nili-wx/cache/weather.png}
cp: cannot stat `/media/5/Conky/Nili-wx/icon/3232/29.png': No such file or directory
25 Apr 15 | 16:25:45 ~
$
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
I've run into two(perhaps related) issues when trying to apply Nili's weather:
On startup, I get a string of errors:
Conky: /home/schwim/.config/.conky/.conkyweatherrc: 6: no such configuration: 'imlib_cache_size'
Conky: /home/schwim/.config/.conky/.conkyweatherrc: 36: no such configuration: 'imlib_cache_size'
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable image
Conky: unknown variable imageThen, the images aren't found because they're being called with numbers for names.
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/26.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/38.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/30.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/30.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/30.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/11.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/30.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/34.png’: No such file or directory
cp: cannot stat ‘/home/schwim/.config/.conky/weather-icons/34.png’: No such file or directoryI'm wondering how to know what to rename the images? Is there a legend for what each image should be named to work with the Yahoo weather calls?
I use settings on this destination /home/nili/.conky/
Images are stored like this
/home/nili/.conky/conky-weather/icons/
you can use on yours
/home/schwim/.conky/conky-weather/icons/
Ofcourse you can use every destination you like but must change the saving code according of your preferences.
Offline
Sector11, i'll change mine to every 3hour because from my observation noticed that Yahoo Weather becomes updated once in three hours, so i'll change interval 5min to 3h. Thanks for telling me. I wanted to make some change early but forgot it.
once again I load the weather code from:
/home/nili/.conky/yweather
while icons are stored at:
/home/nili/.conky/conky-weather/icons
Remember guys, you will need to adapt the settings according to your preferences because this conky is not made for public release although i released it here. But I am here to speak for everything possible to make functional on your system.
Thank you for understanding.
Kindly regards,
Nili
Last edited by Nili (2015-04-25 20:35:07)
Offline
I use settings on this destination /home/nili/.conky/
http://i.imgur.com/1l3aqLY.pngImages are stored like this
/home/nili/.conky/conky-weather/icons/you can use on yours
/home/schwim/.conky/conky-weather/icons/Ofcourse you can use every destination you like but must change the saving code according of your preferences.
I've already set the proper directories in the rc, but if you look at my errors, it's not looking for light rain.png or mist.png like the files are named, but 26.png and 30.png, which don't match any of the image names in the directory.
I just don't know what the numbers correlate to (for instance, maybe 26 = partly cloudy) or I would rename them to what the script is looking for.
Last edited by schwim (2015-04-25 20:02:35)
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat