You are not logged in.
You're welcome martix. Glad to have helped...
... and now back to the weather.
Dark tonight and light tomorrow, somewhere it's raining, somewhere snowing and somewr....
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
just had to figure out the correct name of the folder in /sys/devices/platform
For future reference this is too easy:
1. run sensors, you will have output in 'sections', mine are:
acpitz-virtual-0
f71862fg-isa-0a00
k10temp-pci-00c3
now look in /sys/devices/platform, and there it is - a match:
/alarmtimer
/f71882fg.2560
/i8042
/microcode
/pcspkr
/platform-framebuffer.0
/PNP0C0C:00
/power
/serial8250
/uevent
So conky uses:
${platform f71882fg.2560 fan 1}
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
OK back to the weather... I revamped a conky between yesterday, today and other things "life" Something about the "firs mono" font Teo turned me onto that I LOVE: I can see it very clearly at smaller sizes - two years ago things were fine, then I needed 'computer glasses' - then I needed 'computer glasses' and larger fonts. and along come: Fira Mono
So I made it narrower and just a little shorter, because the images are a little bigger.
You need: fira mon font, 1_accuweather and 4_moon.
old on the left new on the right.
S11-Clock-9day-Moon-16.conky
# pkill -xf "conky -q -c ~/1_accuweather/S11-Clock-9day-Moon-16.conky" &
# Created: Wed 26 Oct 2016 14:21:13
## ---------- Begin Window Settings
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints skip_taskbar,skip_pager,undecorated,below #,sticky
own_window_colour 000000
own_window_class Conky
own_window_title A Clock - Weather & Moon 2016
# ARGB can be used for real transparency
# own_window_argb_visual yes ## Options: yes or no
# Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
# own_window_argb_value 70
minimum_size 180 900
maximum_width 180
gap_x 10 ## l|r
gap_y 10 ## u|d
alignment tl
## ---------- End Window Settings
## ---------- Font Settings
## Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Fantasque Sans Mono:bold:size=11
xftfont Fira Mono:bold:size=8
## Alpha of Xft font. Must be a value at or between 1 and 0
xftalpha 1.0
## Force UTF8? requires XFT
override_utf8_locale yes
## --------- End Font Settings
## --------- Color Settings
draw_shades yes
default_shade_color 000000
draw_outline no
default_outline_color 000000
default_color f5fffa ## MintCream
color1 778899 ## LightSlateGray
color2 FFA07A ## LightSalmon
color3 87CEFA ## LightSkyBlue
color4 48D1CC ## MediumTurquoise
color5 FFDEAD ## NavajoWhite
color6 00BFFF ## DeepSkyBlue
color7 B0E0E6 ## PowderBlue
color8 FFD700 ## Gold
color9 CD5C5C ## IndianRed
## ---------- End Color Settings
## ---------- Begin Borders Section
draw_borders no
## Stippled borders?
stippled_borders 5
## border margins
border_inner_margin 5
border_outer_margin 0
## border width
border_width 2
## graph borders
draw_graph_borders yes ## no
## default_graph_size 15 40
## ---------- End Borders Secton
## ---------- Begin Miscellaneous Section
## Boolean value, if true, Conky will be forked to background when started.
background yes ## yes
imlib_cache_size 0
## 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
## Subtract (file slystem) buffers from used memory?
no_buffers yes
## Use the Xdbe extension? (eliminates flicker)
## It is highly reco${color}mmended to use own window with this one
## so double buffer won't be so big.
double_buffer yes
update_interval 1
#TEXT --- Remove line below TEXT when developing new conky
# These lines not required see: S12_time_tm.conky
#${execi 900 bash $HOME/1_accuweather/1_accuweather -f2015 -f2016 -h2015 -h2016}\
#${execi 900 bash /media/5/Conky/4_Moon/moon}\
TEXT
${image /media/5/Conky/images/bk_10.png -p -5,-5 -s 220x1000}\
${image /media/5/Conky/4_Moon/0.png -p 5,138 -s 60x60}\
${image $HOME/1_accuweather/forecast_2016/forecast_0.png -p 25,135 -s 140x140}\
${alignc}${color5}${swapbar 0,15} Today's Sun Data ${swapbar 0,15}${color}
Rise${color7} ${execpi 600 sed -n '14p' $HOME/1_accuweather/curr_cond}\
${alignr}${color}Set ${color7}${execpi 600 sed -n '15p' $HOME/1_accuweather/curr_cond}${color}
${alignc}Duration: ${color7}${execi 300 sed -n '16p' $HOME/1_accuweather/curr_cond}
${font LED_mono:size=30}${goto 20}${color1}88:88:88${goto 20}${color5}${time %T}${color}${font}
${font Fantasque Sans Mono:bold:size=16}${color5}${alignc}${time %a %d %b %Y}${color}${font}
${alignc}${color7}${if_match ${time %H}<12}Good Morning${else}\
${if_match ${time %H}<18}Good Afternoon${else}Good Evening${endif}${endif}${color}
${font monofur:bold:size=16}${color5}±${execpi 600 sed -n '3p' $HOME/1_accuweather/curr_cond}\
${alignr}${color}${execpi 600 sed -n '2p' $HOME/1_accuweather/curr_cond}${font}
Bar ${color7}${execpi 600 sed -n '8p' $HOME/1_accuweather/curr_cond}${color}\
${alignr}Cld ${color7}${execi 90 sed -n '10p' $HOME/1_accuweather/curr_cond}${color}
UVI ${color7}${execpi 600 sed -n '9p' $HOME/1_accuweather/curr_cond} /11${color}\
${alignr}Hum ${color7}${execpi 600 sed -n '7p' $HOME/1_accuweather/curr_cond}${color}
DP ${color7}${execi 90 sed -n '12p' $HOME/1_accuweather/curr_cond}${color}\
${alignr}Vis ${color7}${execi 90 sed -n '13p' $HOME/1_accuweather/curr_cond}${color}
${alignc}Wind ${color7}${execi 90 sed -n '5p' $HOME/1_accuweather/curr_cond}\
${color}@ ${color7}${execi 90 sed -n '6p' $HOME/1_accuweather/curr_cond}${color}
${alignc}${color5}${swapbar 0,15} TEN DAY FORECAST ${swapbar 0,15}${color}
${alignc}${pre_exec echo `date --date="0 day" | awk '{print $1" "$3" "$2}'`}\
${pre_exec echo `date --date="1 day" | awk '{print $1" "$3" "$2}'`}
${image $HOME/1_accuweather/forecast_2016/forecast_1.png -p 22,352 -s 50x50}\
${image $HOME/1_accuweather/forecast_2016/forecast_2.png -p 129,352 -s 50x50}\
${color5}${if_match "${execpi 300 sed -n '4p' /home/sector11/1_accuweather/first_days}" == "Lo"}\
${else}${execpi 300 sed -n '3p' /home/sector11/1_accuweather/first_days}${endif}\
${alignr 60}${execi 90 sed -n '8p' $HOME/1_accuweather/first_days}${color}
${color7}${if_match "${execpi 300 sed -n '4p' /home/sector11/1_accuweather/first_days}" == "Lo"}\
${execpi 300 sed -n '3p' /home/sector11/1_accuweather/first_days}\
${else}${execpi 300 sed -n '4p' /home/sector11/1_accuweather/first_days}${endif}\
${alignr 60}${execi 90 sed -n '9p' $HOME/1_accuweather/first_days}${color}
${alignc}${pre_exec echo `date --date="2 day" | awk '{print $1" "$3" "$2}'`}\
${pre_exec echo `date --date="3 day" | awk '{print $1" "$3" "$2}'`}
${image $HOME/1_accuweather/forecast_2016/forecast_3.png -p 22,417 -s 50x50}\
${image $HOME/1_accuweather/forecast_2016/forecast_4.png -p 129,417 -s 50x50}\
${color5}${execi 90 sed -n '13p' $HOME/1_accuweather/first_days}\
${alignr 60}${execi 90 sed -n '18p' $HOME/1_accuweather/first_days}${color}
${color7}${execi 90 sed -n '14p' $HOME/1_accuweather/first_days}\
${alignr 60}${execi 90 sed -n '19p' $HOME/1_accuweather/first_days}${color}
${alignc}${pre_exec echo `date --date="4 day" | awk '{print $1" "$3" "$2}'`}\
${pre_exec echo `date --date="5 day" | awk '{print $1" "$3" "$2}'`}
${image $HOME/1_accuweather/forecast_2016/forecast_5.png -p 22,482 -s 50x50}\
${image $HOME/1_accuweather/forecast_2016/forecast_6.png -p 129,482 -s 50x50}\
${color5}${execi 90 sed -n '23p' $HOME/1_accuweather/first_days}\
${alignr 60}${execi 90 sed -n '3p' $HOME/1_accuweather/last_days}${color}
${color7}${execi 90 sed -n '24p' $HOME/1_accuweather/first_days}\
${alignr 60}${execi 90 sed -n '4p' $HOME/1_accuweather/last_days}${color}
${alignc}${pre_exec echo `date --date="6 day" | awk '{print $1" "$3" "$2}'`}\
${pre_exec echo `date --date="7 day" | awk '{print $1" "$3" "$2}'`}
${image $HOME/1_accuweather/forecast_2016/forecast_7.png -p 22,547 -s 50x50}\
${image $HOME/1_accuweather/forecast_2016/forecast_8.png -p 129,547 -s 50x50}\
${color5}${execi 90 sed -n '8p' $HOME/1_accuweather/last_days}\
${alignr 60}${execi 90 sed -n '13p' $HOME/1_accuweather/last_days}${color}
${color7}${execi 90 sed -n '9p' $HOME/1_accuweather/last_days}\
${alignr 60}${execi 90 sed -n '14p' $HOME/1_accuweather/last_days}${color}
${alignc}${pre_exec echo `date --date="8 day" | awk '{print $1" "$3" "$2}'`}\
${pre_exec echo `date --date="9 day" | awk '{print $1" "$3" "$2}'`}
${image $HOME/1_accuweather/forecast_2016/forecast_9.png -p 22,611 -s 50x50}\
${image $HOME/1_accuweather/forecast_2016/forecast_10.png -p 129,611 -s 50x50}\
${color5}${execi 90 sed -n '18p' $HOME/1_accuweather/last_days}\
${alignr 60}${execi 90 sed -n '23p' $HOME/1_accuweather/last_days}${color}
${color7}${execi 90 sed -n '19p' $HOME/1_accuweather/last_days}\
${alignr 60}${execi 90 sed -n '24p' $HOME/1_accuweather/last_days}${color}
${swapbar 0}
${alignc}${color5}${swapbar 0,15} The Southern Moon ${swapbar 0,15}${color}
${alignc}${color5}${swapbar 0,15} ${time %a %d %b %Y} ${swapbar 0,15}${color}
${alignc}${color7}${execpi 600 sed -n '7p' /media/5/Conky/4_Moon/raw}${color}
Rise${color7} ${execpi 600 sed -n '18p' $HOME/1_accuweather/curr_cond}${color}\
${alignr}${color}Set ${color7}${execpi 600 sed -n '19p' $HOME/1_accuweather/curr_cond}${color}
Duration: ${color7}${execi 300 sed -n '20p' $HOME/1_accuweather/curr_cond}${color}
Illumination: ${color7}${execpi 600 sed -n '1p' /media/5/Conky/4_Moon/raw}${color}
Sun Angle: ${color7}${execpi 600 sed -n '2p' /media/5/Conky/4_Moon/raw}${color}
Sun Dist: ${color7}${execpi 600 sed -n '3p' /media/5/Conky/4_Moon/raw}${color}
Moon Dist: ${color7}${execpi 600 sed -n '4p' /media/5/Conky/4_Moon/raw}${color}
Moon Age: ${color7}${execpi 600 sed -n '5p' /media/5/Conky/4_Moon/raw} days${color}
Moon Angle: ${color7}${execpi 600 sed -n '6p' /media/5/Conky/4_Moon/raw}${color}
${alignc}${color5}${swapbar 0,150}${color}
${alignc}${execi 3600 echo `date --date="-2 day" | awk '{print $1" "$3" "$2}'`}\
${execi 3600 echo `date --date="-1 day" | awk '{print $1" "$3" "$2}'`}
${alignc}${execi 3600 echo `date --date="-2 day" | awk '{print $1" "$3" "$2}'`}\
${execi 3600 echo `date --date="-1 day" | awk '{print $1" "$3" "$2}'`}
${image /media/5/Conky/4_Moon/-2.png -p 20,846 -s 50x50}
${image /media/5/Conky/4_Moon/-1.png -p 125,846 -s 50x50}
${image /media/5/Conky/4_Moon/1.png -p 20,910 -s 50x50}
${image /media/5/Conky/4_Moon/2.png -p 125,910 -s 50x50}
${swapbar 0}
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
OK there's a reason for reposting a conky that for all intents and purposes is a re-do of an earlier conky.
There are some 'under the hood' changes that I wanted to point out to you. Now as most people that hang a hat here know I have a "test conky" and it came in handy today. While redoing the conky I had and idea that became two ideas and hey it worked.
Here's the test conky that grew as I was doing the weather conky above:
Two versions NOTE the border_inner_margin settings.
Now the interesting parts.
The 'date lines' are "alignc" with a space (7) between the commands.
The temps on the right are done with "${alignr 60}"
The temps on the left are done with "${alignc 72}
WHY: Normally I try to configure my conkys with space for '3 characters' for temps ( -10° and 102°) for the F people mostly although -10° is common for C as well. But using ${goto xx} and at times they look off.
Well, now they line up quite nicely - automatically and that third character ( - or 1, God forbid there is a 2) actually lines up in the 'hundreds' column. NICE!
Here's the code in question:
${alignc}↓ test code ↓
${color9}${swapbar 0}${color}
${alignc}= Old Conventional Way =
${goto 11}${color5}${pre_exec echo `date --date="0 day" | awk '{print $1" "$3" "$2}'`}\
${goto 112}${pre_exec echo `date --date="1 day" | awk '{print $1" "$3" "$2}'`}${color}
55${goto 104}55
${image /media/5/Conky/images/red+x.png -p 18,118 -s 50x50}
${image /media/5/Conky/images/green+x.png -p 120,118 -s 50x50}
-23${goto 104}-23
${alignc}= My New Way =
${alignc}${color5}${pre_exec echo `date --date="0 day" | awk '{print $1" "$3" "$2}'`}\
${pre_exec echo `date --date="1 day" | awk '{print $1" "$3" "$2}'`}${color}
${alignc 72}55${alignr 60}55
${image /media/5/Conky/images/red+x.png -p 18,209 -s 50x50}
${image /media/5/Conky/images/green+x.png -p 120,209 -s 50x50}
${alignc 72}-23${alignr 60}-23
NOTE THE DIFFERENCE:
border_inner_margin 0
border_outer_margin 0
Another tip: short lines
swapbars or membars
${swapbar 0,20}${alignr}${swapbar 1,20}
${swapbar 0,50}${alignr}${swapbar 1,50}
${swapbar 0,75}${alignr}${swapbar 1,75}
${alignc}${swapbar 0,143}
${alignc}${swapbar 0,50} hello ${swapbar 1,50}
${alignc}${swapbar 1,143}
${color9}${swapbar 0}${color}
${alignc}↑ between lines ↑
Enjoy!
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
7 year ago Habitual wrote a bash script to display weather in a terminal using conkyForecast, over the past couple of days I have tweaked it to use Teo's scripts.
For this example I choose the 1_accuweather script. And here's the output:
Now a bit of info before we start. If you do not want to see all the "wget" data flying by, I don't, you need to tweak your ~/1_accuweather/1_accuweather script:
Search for:
wget -O
Replace with
wget -q -O
so wget runs in 'quiet' mode.
Now there are two ways you can run this ... one is with the little bash script: 1-16s
1 - for 1_accuweather
-16 - because the script needs an option (-f2016), and
s - for small (there is a bigger version not completed yet)
#!/bin/bash
# --- original ---
# 4 Day Weather forecast script for Boardman, OH
# Written by: Habitual (JJ)
# 11.01.2010 12:10:07
# For conkyForecast by: Kaivalagi
# --- Edited by Sector11 ---
# 7 Day Forecast
# 13 Jan 2013 14:08 UTC
# For conkyForecast by: Kaivalagi
# Re-edited:
# Mon 09 Jan 2017
# For Teo's Accuweather Weather script
# Script name: ~/bin/1-16s
### Run Teos script to refresh the databases needed
### Change the "wget" commands to "wget -q" in 1_accuweather
~/1_accuweather/1_accuweather -f2016 2>&1 >/dev/null
# Clear the screen
tput clear
#tput bold ### for bold text
#tput dim ### for dim text
#tput sgr0 ### remove formatting
# Current (1st Group LEFT)
tput cup 1 1;tput setaf 9
echo "Currently"
tput cup 1 11;tput setaf 3
echo `sed -n '2p' ~/1_accuweather/curr_cond`"°"
tput cup 1 15;tput setaf 9
echo " for ±"
tput cup 1 21;tput setaf 3
echo `sed -n '3p' ~/1_accuweather/curr_cond`"°"
tput cup 2 1;tput setaf 2
echo `sed -n '4p' ~/1_accuweather/curr_cond`
tput cup 3 1;tput setaf 3
echo "Bar"
tput cup 3 5;tput setaf 9
echo `sed -n '8p' ~/1_accuweather/curr_cond`
tput cup 3 16;tput setaf 3
echo "Hum"
tput cup 3 20;tput setaf 9
echo `sed -n '7p' ~/1_accuweather/curr_cond`
tput cup 3 25;tput setaf 3
echo "UVI"
tput cup 3 29;tput setaf 9
echo `sed -n '9p' ~/1_accuweather/curr_cond`
tput cup 4 1;tput setaf 3
echo "Wnd"
tput cup 4 5;tput setaf 9
echo `sed -n '5p' ~/1_accuweather/curr_cond`" @ "`sed -n '6p' ~/1_accuweather/curr_cond`
tput cup 4 21;tput setaf 3
echo "Vis"
tput cup 4 25;tput setaf 9
echo `sed -n '13p' ~/1_accuweather/curr_cond`
tput cup 5 1;tput setaf 3
echo "Ceil"
tput cup 5 6;tput setaf 9
echo `sed -n '11p' ~/1_accuweather/curr_cond`
tput cup 5 14;tput setaf 3
echo "Dew"
tput cup 5 18;tput setaf 9
echo `sed -n '12p' ~/1_accuweather/curr_cond`"°"
tput cup 5 22;tput setaf 3
echo "CC"
tput cup 5 25;tput setaf 9
echo `sed -n '10p' ~/1_accuweather/curr_cond`
# Today Day 0 (1st Group RIGHT)
tput cup 1 35;tput setaf 9
echo "$(date --date="0 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 1 51;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 1 53;tput setaf 9
echo `sed -n '3p' ~/1_accuweather/first_days`"°"
tput cup 1 58;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 1 60;tput setaf 9
echo `sed -n '4p' ~/1_accuweather/first_days`"°"
tput cup 2 35;tput setaf 2
echo `sed -n '5p' ~/1_accuweather/first_days`
tput cup 3 35;tput setaf 9
echo "Sun Rise"
tput cup 3 44;tput setaf 3
echo `sed -n '23p' ~/1_accuweather/curr_cond`
tput cup 3 50;tput setaf 9
echo "Moon Rise "
tput cup 3 60;tput setaf 6
echo `sed -n '25p' ~/1_accuweather/curr_cond`
tput cup 4 40;tput setaf 9
echo "Set"
tput cup 4 44;tput setaf 3
echo `sed -n '24p' ~/1_accuweather/curr_cond`
tput cup 4 56;tput setaf 9
echo "Set"
tput cup 4 60;tput setaf 6
echo `sed -n '26p' ~/1_accuweather/curr_cond`
tput cup 5 35;tput setaf 9
echo "Duration"
tput cup 5 44;tput setaf 3
echo `sed -n '16p' ~/1_accuweather/curr_cond`
tput cup 5 57;tput setaf 6
echo `sed -n '20p' ~/1_accuweather/curr_cond`
# Day 1 (2nd Group LEFT)
tput cup 6 1;tput setaf 9
echo "----------------------------------"
tput cup 7 1;tput setaf 9
echo "$(date --date="1 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 7 17;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 7 19;tput setaf 9
echo `sed -n '8p' ~/1_accuweather/first_days`"°"
tput cup 7 25;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 7 27;tput setaf 9
echo `sed -n '9p' ~/1_accuweather/first_days`"°"
tput cup 8 1;tput setaf 2
echo `sed -n '10p' ~/1_accuweather/first_days`
# Day 2 (2nd Group RIGHT)
tput cup 6 35;tput setaf 9
echo "-------------------------------"
tput cup 7 35;tput setaf 9
echo "$(date --date="2 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 7 51;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 7 53;tput setaf 9
echo `sed -n '13p' ~/1_accuweather/first_days`"°"
tput cup 7 58;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 7 60;tput setaf 9
echo `sed -n '14p' ~/1_accuweather/first_days`"°"
tput cup 8 35;tput setaf 2
echo `sed -n '5p' ~/1_accuweather/first_days`
# Day 3 (3rd Group LEFT)
tput cup 9 1;tput setaf 9
echo "-------------------------------"
tput cup 10 1;tput setaf 9
echo "$(date --date="3 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 10 17;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 10 19;tput setaf 9
echo `sed -n '18p' ~/1_accuweather/first_days`"°"
tput cup 10 25;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 10 27;tput setaf 9
echo `sed -n '19p' ~/1_accuweather/first_days`"°"
tput cup 11 1;tput setaf 2
echo `sed -n '10p' ~/1_accuweather/first_days`
# Day 4 (3rd Group RIGHT)
tput cup 9 35;tput setaf 9
echo "-------------------------------"
tput cup 10 35;tput setaf 9
echo "$(date --date="4 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 10 51;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 10 53;tput setaf 9
echo `sed -n '23p' ~/1_accuweather/first_days`"°"
tput cup 10 58;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 10 60;tput setaf 9
echo `sed -n '24p' ~/1_accuweather/first_days`"°"
tput cup 11 35;tput setaf 2
echo `sed -n '5p' ~/1_accuweather/first_days`
# Day 5 (4th Group LEFT)
tput cup 12 1;tput setaf 9
echo "-------------------------------"
tput cup 13 1;tput setaf 9
echo "$(date --date="5 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 13 17;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 13 19;tput setaf 9
echo `sed -n '3p' ~/1_accuweather/last_days`"°"
tput cup 13 25;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 13 27
echo `sed -n '4p' ~/1_accuweather/last_days`"°"
tput cup 14 1;tput setaf 2
echo `sed -n '5p' ~/1_accuweather/last_days`
# Day 6 (4th Group RIGHT)
tput cup 12 35;tput setaf 9
echo "-------------------------------"
tput cup 13 35;tput setaf 9
echo "$(date --date="6 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 13 51;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 13 53;tput setaf 9
echo `sed -n '8p' ~/1_accuweather/last_days`"°"
tput cup 13 58;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 13 60
echo `sed -n '9p' ~/1_accuweather/last_days`"°"
tput cup 14 35;tput setaf 2
echo `sed -n '10p' ~/1_accuweather/last_days`
# Day 7 (5th Group LEFT)
tput cup 15 1;tput setaf 9
echo "-------------------------------"
tput cup 16 1;tput setaf 9
echo "$(date --date="7 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 16 17;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 16 19
echo `sed -n '13p' ~/1_accuweather/last_days`"°"
tput cup 16 25;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 16 27;tput setaf 9
echo `sed -n '14p' ~/1_accuweather/last_days`"°"
tput cup 17 1;tput setaf 2
echo `sed -n '15p' ~/1_accuweather/last_days`
tput cup 18 1;tput setaf 9
echo "-------------------------------"
# Day 8 (5th Group RIGHT)
tput cup 15 35;tput setaf 9
echo "-------------------------------"
tput cup 16 35;tput setaf 9
echo "$(date --date="8 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 16 51;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 16 53;tput setaf 9
echo `sed -n '18p' ~/1_accuweather/last_days`"°"
tput cup 16 58;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 16 60;tput setaf 9
echo `sed -n '19p' ~/1_accuweather/last_days`"°"
tput cup 17 35;tput setaf 2
echo `sed -n '20p' ~/1_accuweather/last_days`
tput cup 18 35;tput setaf 9
echo "-------------------------------"
tput sgr0
Slick huh. Thank you Habitual!
Now another way.
Remove or comment out the line in the script that calls for Teo's weather
### Run Teos script to refresh the databases needed
~/1_accuweather/1_accuweather -f2016 2>&1 >/dev/null
and copy the script to the bottom of Teo's script ~/1_accuweather/1_accuweather
Removing the #!/bin/bash like of course like this, your ending of the script may vary:
fi
################################################################################
### kill -CONT $(pidof conky)
################################################################################
fi
### ========================= Start terminal output ============================
# --- original ---
# 4 Day Weather forecast script for Boardman, OH
# Written by: Habitual (JJ)
# 11.01.2010 12:10:07
# For conkyForecast by: Kaivalagi
# --- Edited by Sector11 ---
# 7 Day Forecast
# 13 Jan 2013 14:08 UTC
# For conkyForecast by: Kaivalagi
# Re-edited:
# Mon 09 Jan 2017
# For Teo's Accuweather Weather script
# NOTE: Until further notice
# Data files must already be present!!!!
# Script name: ~/bin/1-16s
## Tacked on the end here at Teo's suggestion.
# Clear the screen
tput clear
{snip}
{snip}
{snip}
Now you need to run it like this:
$ bash $HOME/1_accuweather/1_accuweather -f2016
I think I prefer the 1-16s script by itself
Some tweaking may be required because of your terminal size and font.
Especially if your font does not display the ↑ and ↓ arrows.
My terminal uses: Fira Mono - Size 9
Have fun!
EDIT:
- 1-16s: modifications to the Sun Moon Duration data section.
- Output image updated as well
Last edited by Sector11 (2017-01-10 13:30:26)
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
This works for OpenBox on Bunsen using terminator, if you are interested.
In the 1-16s add a last line:
$SHELL
Create an OB menu entry: edit the menu.xml
<item label="BsAs Wx">
<action name="Execute">
<command>terminator --geometry=520x340+80+80 -b -x 1-16s</command>
</action>
</item>
or use the GUI app to create the menu entry:
Label: whatever you want: I use BsAs Wx
Action: Execute
Execute: terminator --geometry=520x340+80+80 -b -x 1-16s
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Very useful S11, thanks for posting.
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Offline
I just borrow tools others create - then use them to get creative.
Your welcome.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Hi all.
I have a little weather conky with yahoo api, but Yahoo site is often down, and my conky don't work as expected.
I rebuild my conky with 2b_Wunderground_API, in french (I modify script 2b and rename it as 3b).
Script 3b:
#!/bin/bash
#put your hemisphere here: n for north, s for south
hemisphere=n
#put your Weather Underground address API here
address="http://api.wunderground.com/api/your_api_key_here/conditions/forecast10day/astronomy/hourly/satellite/q/aubagne.json"
wun_icon_to_png () {
if [[ $1 == day ]]; then
case $2 in
chanceflurries)
echo 21
;;
chancerain)
echo 14
;;
chancesleet)
echo 26
;;
chancesnow)
echo 20
;;
chancetstorms)
echo 17
;;
clear)
echo 1
;;
cloudy)
echo 7
;;
flurries)
echo 21
;;
fog)
echo 11
;;
hazy)
echo 5
;;
mostlycloudy)
echo 6
;;
mostlysunny)
echo 4
;;
partlycloudy)
echo 4
;;
partlysunny)
echo 6
;;
sleet)
echo 26
;;
rain)
echo 18
;;
snow)
echo 22
;;
sunny)
echo 1
;;
tstorms)
echo 15
;;
unknown)
echo 0
;;
esac
elif [[ $1 == night ]]; then
case $2 in
chanceflurries)
echo 43
;;
chancerain)
echo 39
;;
chancesleet)
echo 40
;;
chancesnow)
echo 43
;;
chancetstorms)
echo 41
;;
clear)
echo 33
;;
cloudy)
echo 38
;;
flurries)
echo 43
;;
fog)
echo 11
;;
hazy)
echo 37
;;
mostlycloudy)
echo 36
;;
mostlysunny)
echo 35
;;
partlycloudy)
echo 35
;;
partlysunny)
echo 36
;;
sleet)
echo 40
;;
rain)
echo 40
;;
snow)
echo 44
;;
sunny)
echo 33
;;
tstorms)
echo 41
;;
unknown)
echo 0
;;
esac
fi
}
rm $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/*.png
wget -O $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/raw_data $address
sed -n '/, "current_observation": {/,/, "satellite": {/p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/raw_data | sed 's/"Clear"/"Ciel dégagé"/g;s/"Partly Cloudy"/"Partiellement Nuageux"/g;s/"Chance of Flurries"/"Risque de neige"/g;s/"Chance of Rain"/"Risque de pluie"/g;s/"Chance Rain"/"Risque de pluie"/g;s/"Chance of Freezing Rain"/"Risque de pluie verglaçante"/g;s/"Chance of Sleet"/"Risque de grésil"/g;s/"Chance of Snow"/"Risque de neige"/g;s/"Chance of Thunderstorm*"/"Risque d orage"/g;s/"Cloudy"/"Nuageux"/g;s/"Flurries"/"Averse de neige"/g;s/"Fog"/"Brouillard"/g;s/"Haze"/"Brume"/g;s/"Mostly Cloudy"/"Plutôt nuageux"/g;s/"Mostly Sunny"/"Plutôt ensoleillé"/g;s/"Partly Sunny"/"Partiellement ensoleillé"/g;s/"Freezing Rain"/"Pluie verglaçante"/g;s/"Rain"/"Pluie"/g;s/"Sleet"/"Neige fondue"/g;s/"Snow"/"Neige"/g;s/"Sunny"/"Ensoleillé"/g;s/"Thunderstorm*"/"Orage"/g;s/"Overscat"/"Couvert"/g;s/"Scattered Clouds"/"Nuages épars"/g;s/"NW"/"NO"/g;s/"WNW"/"ONO"/g;s/"SW"/"SO"/g;s/"WSW"/"OSO"/g;s/"NNW"/"NNO"/g' > $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions
sed -i 's/^[ \t]*"//g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions
sed -i '/current_observation\|image":\|logo_\|title":\|link":\|^[ \t]*},$\|^[ \t]*}$\|temperature_string\|forecast_url\|history_url\|ob_url\|satellite":/d' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions
sed -i -e 's/":"/\n/g' -e 's/",\|": {$//g' -e 's/"precip_1hr_string/\nprecip_1hr_string/g' -e 's/":/\n/g' -e 's/,$//g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions
sed -i -e 's/^http.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions
day_or_night=$(sed -n 137p $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions)
if [[ $day_or_night == nt ]]; then
cp $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Forecast_Images/$(wun_icon_to_png night $(sed -n 135p $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions)).png $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Now.png
else
cp $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Forecast_Images/$(wun_icon_to_png day $(sed -n 135p $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions)).png $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Now.png
fi
#Forecast feature: Forecast
sed -n '/"forecast":{/,/"simpleforecast": {/p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/raw_data > $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Forecast
sed -i -e '/"period":\|icon_url/d' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Forecast
sed -i 's/^[ \t]*"//g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Forecast
sed -i -e '/period\|icon\|title\|fcttext/!d' -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",//g' -e 's/,$//g' -e 's/nt_//g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Forecast
#Forecast feature: Simple Forecast
sed -n '/"simpleforecast": {/,/"hourly_forecast": \[/p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/raw_data | sed 's/"Clear"/"Ciel dégagé"/g;s/"Partly Cloudy"/"Partiellement Nuageux"/g;s/"Chance of Flurries"/"Risque de neige"/g;s/"Chance of Rain"/"Risque de pluie"/g;s/"Chance Rain"/"Risque de pluie"/g;s/"Chance of Freezing Rain"/"Risque de pluie verglaçante"/g;s/"Chance of Sleet"/"Risque de grésil"/g;s/"Chance of Snow"/"Risque de neige"/g;s/"Chance of Thunderstorm*"/"Risque d orage"/g;s/"Cloudy"/"Nuageux"/g;s/"Flurries"/"Averse de neige"/g;s/"Fog"/"Brouillard"/g;s/"Haze"/"Brume"/g;s/"Mostly Cloudy"/"Plutôt nuageux"/g;s/"Mostly Sunny"/"Plutôt ensoleillé"/g;s/"Partly Sunny"/"Partiellement ensoleillé"/g;s/"Freezing Rain"/"Pluie verglaçante"/g;s/"Rain"/"Pluie"/g;s/"Sleet"/"Neige fondue"/g;s/"Snow"/"Neige"/g;s/"Sunny"/"Ensoleillé"/g;s/"Thunderstorm*"/"Orage"/g;s/"Overscat"/"Couvert"/g;s/"Scattered Clouds"/"Nuages épars"/g;s/"NW"/"NO"/g;s/"WNW"/"ONO"/g;s/"SW"/"SO"/g;s/"WSW"/"OSO"/g;s/"NNW"/"NNO"/g' > $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast
sed -i 's/^[ \t]*"//g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast
sed -i '/hourly_forecast\|simpleforecast\|forecastday\|{"date"\|period\|icon_url\|^[ \t]*},$\|^[ \t]*}$\|^[ \t]*,$\|^[ \t]*\]$/d' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast
sed -i -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",$//g' -e 's/,$//g' -e 's/"$//g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2//Simple_Forecast
sed -i '/^[ \t]*{/d' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast
for (( i=2; i<=146; i+=16 ))
do
cp $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Forecast)).png $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/d$(( 1+(i-2)/16 )).png
j=$(( i+8 ))
cp $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Forecast_Images/$(wun_icon_to_png night $(sed -n ${j}p $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Forecast)).png $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2//n$(( 1+(i-2)/16 )).png
done
sed -n '/"hourly_forecast": \[/,/"moon_phase": {/p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/raw_data > $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Hourly
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Hourly
sed -i '/hourly_forecast\|FCTTIME\|^{$\|^},$\|^}$\|^,$\|^]$\|moon_phase/d' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Hourly
sed -i -e 's/": /\n/g' -e 's/","/\n/g' -e 's/", "/\n/g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Hourly
sed -i -e 's/^""//g' -e 's/^"//g' -e 's/^{"//g' -e 's/"},$//g' -e 's/",$//g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Hourly
sed -i -e 's/^},//g' -e 's/"}$//g' -e 's/^,//g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Hourly
sed -i -e 's/^icon_url.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Hourly
sed -i -e '/min_unpadded\|UTCDATE/,+1d' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Hourly
for (( i=64; i<=4212; i+=117 ))
do
j=$(( i+1 ))
day_or_night=$(sed -n ${j}p $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Hourly)
if [[ $day_or_night == nt ]]; then
cp $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Forecast_Images/$(wun_icon_to_png night $(sed -n ${i}p $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Hourly)).png $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/h$(( 1+(i-64)/117 )).png
else
cp $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Hourly)).png $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/h$(( 1+(i-64)/117 )).png
fi
done
My conky
conky.config = {
background = false,
use_xft = true,
font = 'DejaVuSansMono:size=8',
update_interval = 1800.0,
total_run_times = 0,
own_window = true,
own_window_type = 'dock',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_hints = 'undecorated,skip_taskbar,skip_pager,below',
double_buffer = true,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = true,
stippled_borders = 8,
border_inner_margin = 4,
alignment = 'top_left',
minimum_width = 170,
minimum_height = 283,
gap_x = 130,
gap_y = 85,
no_buffers = false,
uppercase = false,
cpu_avg_samples = 2,
net_avg_samples = 2,
override_utf8_locale = true,
use_spacer = right,
text_buffer_size = 6144,
imlib_cache_size = 8192,
default_outline_color = '000000',
color1 = 'F5B800',
color2 = '00f5ff',
lua_load = '/home/dominique/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/weather.lua',
lua_draw_hook_pre = 'main'
}
conky.text = [[
${goto 50}${font DejaVuSansMono:bold:size=8}${color2}Actuel${color1}${font} ${font DejaVuSansMono:bold:size=8}${goto 160}${color1}${exec sed -n '67p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions}°${font}
${color1}${goto 50}${exec sed -n '63p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions}
${image ~/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Now.png -p -1,1 -s 53x32}
${goto 50}${font DejaVuSansMono:bold:size=8}${color2}Aujourd'hui${font}${color1} ${color2}${goto 160}${exec sed -n '44p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°/${color1} ${exec sed -n '39p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°
${image ~/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/d1.png -p -1,35 -s 53x32} ${voffset -12}${goto 50}${exec sed -n '46p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}
${voffset 6}${goto 50}${font DejaVuSansMono:bold:size=8}${color2}${execi 3600 date --date="1 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'}${goto 160}${exec sed -n '150p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°/${color1} ${exec sed -n '145p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°${font}${color1}
${goto 50}${exec sed -n '152p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}
${image ~/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/d2.png -p -1,71 -s 53x32}
${color2}${goto 50}${execi 3600 date -d +2days | awk '{print $1""$3 }'| tr '[a-z]' '[A-Z]'}${goto 160}${exec sed -n '256p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°/${color1} ${exec sed -n '251p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°${font}${color1}
${goto 50}${exec sed -n '258p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}
${image ~/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/d3.png -p -1,107 -s 53x32}
${color2}${goto 50} ${execi 3600 date -d +3days | awk '{print $1""$3 }'| tr '[a-z]' '[A-Z]'}${goto 160}${exec sed -n '362p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°/${color1} ${exec sed -n '357p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°${font}${color1}
${goto 50}${exec sed -n '364p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}
${voffset -10}${image ~/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/d4.png -p -1,143 -s 53x32}
${voffset 6}${goto 50}${color2}${execi 3600 date -d +4days | awk '{print $1""$3 }'| tr '[a-z]' '[A-Z]'}${goto 160}${exec sed -n '362p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°/${color1} ${exec sed -n '357p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°${font}${color1}
${goto 50}${exec sed -n '470p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}
${voffset -10}${image ~/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/d5.png -p -1,179 -s 53x32}
${goto 50}${color2}${execi 3600 date -d +5days | awk '{print $1""$3 }'| tr '[a-z]' '[A-Z]'}${goto 160}${exec sed -n '574p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°/${color1} ${exec sed -n '569p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°${font}${color1}
${goto 50}${exec sed -n '576p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}
${voffset -10}${image ~/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/d6.png -p -1,215 -s 53x32}
${voffset 6}${color2}${goto 50}${execi 3600 date -d +6days | awk '{print $1""$3 }'| tr '[a-z]' '[A-Z]'}${goto 160}${exec sed -n '680p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°/${color1} ${exec sed -n '675p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°${font}${color1}
${goto 50}${exec sed -n '682p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}
${image ~/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/d7.png -p -1,251 -s 53x32}
${voffset 6}${color2}${goto 50}${execi 3600 date -d +7days | awk '{print $1""$3 }'| tr '[a-z]' '[A-Z]'}${goto 160}${exec sed -n '786p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°/${color1} ${exec sed -n '781p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}°${font}${color1}
${goto 50}${exec sed -n '788p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Simple_Forecast}
${image ~/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/d8.png -p -1,287 -s 53x32}
${color2}Humidité${alignr}${color1}${exec sed -n '69p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions}
${color2}Pression${alignr}${color1}${exec sed -n '85p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions} hPa
${color2}Vent${alignr}${color1}${exec sed -n '81p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions} km/h${alignr}
${color2}Direction ${alignr}${color1}${exec sed -n '73p' $HOME/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/Conditions}
]]
weather.lua script:
function conky_main()
os.execute("/home/dominique/.conkyrc/conky-1.10/conky-meteo/conky-aubagne-2/3b")
end
Last edited by chepioq (2017-01-12 19:30:50)
Offline
NICE! One quick question.
Why the LUA script?
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
NICE! One quick question.
Why the LUA script?
Why not ?
In my conky with yahoo's api, I have a lua script, I prefer launch the wget before drawing to the window, with conky 1.9 I used "pre_exec" command for that, but with conky 1.10 this command no longer exists.
Offline
Why not ?
That answer is right up there with Crinos512's response about his 'bash powered conky' 8 years ago: Because I can.
End of the discussion.
His conky was:
TEXT
${execpi 3600 ~/.conky/conkyparts/conkytemplate.sh}
${execpi 3600 ~/.conky/conkyparts/conkyheader.sh}
${execpi 60 ~/.conky/conkyparts/conkycalender.sh}
${execp ~/.conky/conkyparts/conkycore.sh}
${execp ~/.conky/conkyparts/conkymemory.sh}
${execpi 3600 ~/.conky/conkyparts/conkygraphics.sh}
${execp ~/.conky/conkyparts/conkydevices.sh}
${execp ~/.conky/conkyparts/conkynetwork.sh}
${execp ~/.conky/conkyparts/conkyTV.sh}
${execpi 3600 conkyForecast --location=USOK0233 --template=/home/crinos/.conky/conkyparts/weather.template}
with conky 1.9 I used "pre_exec"
That's "one of" the reasons I won't move to conky v1.10 in the foreseeable future, I use the "pre_exec" a lot, although I know at some time I'll have to.
- ${execi 86400 ...} just isn't the same.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
That's "one of" the reasons I won't move to conky v1.10 in the foreseeable future, I use the "pre_exec" a lot, although I know at some time I'll have to.
The setting "lua_draw_hook_pre" has the same effect as "pre_exec" command
lua_draw_hook_pre:
This function, if defined, will be called by Conky through each iteration before drawing to the window. Requires X support. Takes any number of optional arguments. Use this hook for drawing things on top of what Conky draws. Conky puts 'conky_' in front of function_name to prevent accidental calls to the wrong function unless you place 'conky_' in front of it yourself.
Offline
Nice one chepioq.
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Offline
Another weather conky in french, based on "2b_Wunderground_API" and without lua.
I modified the 2b script an rename in 3b
script 3b :
#!/bin/bash
#put your hemisphere here: n for north, s for south
hemisphere=n
#put your Weather Underground address API here
address="http://api.wunderground.com/api/your_api_key_here/conditions/forecast10day/astronomy/hourly/satellite/q/aubagne.json"
wun_icon_to_png () {
if [[ $1 == day ]]; then
case $2 in
chanceflurries)
echo 21
;;
chancerain)
echo 14
;;
chancesleet)
echo 26
;;
chancesnow)
echo 20
;;
chancetstorms)
echo 17
;;
clear)
echo 1
;;
cloudy)
echo 7
;;
flurries)
echo 21
;;
fog)
echo 11
;;
hazy)
echo 5
;;
mostlycloudy)
echo 6
;;
mostlysunny)
echo 4
;;
partlycloudy)
echo 4
;;
partlysunny)
echo 6
;;
sleet)
echo 26
;;
rain)
echo 18
;;
snow)
echo 22
;;
sunny)
echo 1
;;
tstorms)
echo 15
;;
unknown)
echo 0
;;
esac
elif [[ $1 == night ]]; then
case $2 in
chanceflurries)
echo 43
;;
chancerain)
echo 39
;;
chancesleet)
echo 40
;;
chancesnow)
echo 43
;;
chancetstorms)
echo 41
;;
clear)
echo 33
;;
cloudy)
echo 38
;;
flurries)
echo 43
;;
fog)
echo 11
;;
hazy)
echo 37
;;
mostlycloudy)
echo 36
;;
mostlysunny)
echo 35
;;
partlycloudy)
echo 35
;;
partlysunny)
echo 36
;;
sleet)
echo 40
;;
rain)
echo 40
;;
snow)
echo 44
;;
sunny)
echo 33
;;
tstorms)
echo 41
;;
unknown)
echo 0
;;
esac
fi
}
#rm $HOME/test/*.png
curl $address -o $HOME/test/raw_data
sed -n '/, "current_observation": {/,/, "satellite": {/p' $HOME/test/raw_data | sed 's/"Clear"/"Ciel dégagé"/g;s/"Partly Cloudy"/"Partiellement Nuageux"/g;s/"Chance of Flurries"/"Risque de neige"/g;s/"Chance of Rain"/"Risque de pluie"/g;s/"Chance Rain"/"Risque de pluie"/g;s/"Chance of Freezing Rain"/"Risque de pluie verglaçante"/g;s/"Chance of Sleet"/"Risque de grésil"/g;s/"Chance of Snow"/"Risque de neige"/g;s/"Chance of Thunderstorm*"/"Risque d orage"/g;s/"Cloudy"/"Nuageux"/g;s/"Flurries"/"Averse de neige"/g;s/"Fog"/"Brouillard"/g;s/"Haze"/"Brume"/g;s/"Mostly Cloudy"/"Plutôt nuageux"/g;s/"Mostly Sunny"/"Plutôt ensoleillé"/g;s/"Partly Sunny"/"Partiellement ensoleillé"/g;s/"Freezing Rain"/"Pluie verglaçante"/g;s/"Rain"/"Pluie"/g;s/"Sleet"/"Neige fondue"/g;s/"Snow"/"Neige"/g;s/"Sunny"/"Ensoleillé"/g;s/"Thunderstorm*"/"Orage"/g;s/"Overscat"/"Couvert"/g;s/"Scattered Clouds"/"Nuages épars"/g;s/"NW"/"NO"/g;s/"WNW"/"ONO"/g;s/"SW"/"SO"/g;s/"WSW"/"OSO"/g;s/"NNW"/"NNO"/g' > $HOME/test/Conditions
sed -i 's/^[ \t]*"//g' $HOME/test/Conditions
sed -i '/current_observation\|image":\|logo_\|title":\|link":\|^[ \t]*},$\|^[ \t]*}$\|temperature_string\|forecast_url\|history_url\|ob_url\|satellite":/d' $HOME/test/Conditions
sed -i -e 's/":"/\n/g' -e 's/",\|": {$//g' -e 's/"precip_1hr_string/\nprecip_1hr_string/g' -e 's/":/\n/g' -e 's/,$//g' $HOME/test/Conditions
sed -i -e 's/^http.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/test/Conditions
day_or_night=$(sed -n 137p $HOME/test/Conditions)
if [[ $day_or_night == nt ]]; then
cp $HOME/test/Forecast_Images/$(wun_icon_to_png night $(sed -n 135p $HOME/test/Conditions)).png $HOME/test/Now.png
else
cp $HOME/test/Forecast_Images/$(wun_icon_to_png day $(sed -n 135p $HOME/test/Conditions)).png $HOME/test/Now.png
fi
#Forecast feature: Forecast
sed -n '/"forecast":{/,/"simpleforecast": {/p' $HOME/test/raw_data > $HOME/test/Forecast
sed -i -e '/"period":\|icon_url/d' $HOME/test/Forecast
sed -i 's/^[ \t]*"//g' $HOME/test/Forecast
sed -i -e '/period\|icon\|title\|fcttext/!d' -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",//g' -e 's/,$//g' -e 's/nt_//g' $HOME/test/Forecast
#Forecast feature: Moon_Sun
sed -n '/"moon_phase": {/,/"sun_phase": {/p' $HOME/test/raw_data > $HOME/test/Moon_Sun
sed -i 's/^[ \t]*"//g' $HOME/test/Moon_Sun
sed -i '/moon_phase\|^[ \t]*},$\|sun_phase\|^[ \t]*}$/d' $HOME/test/Moon_Sun
sed -i -e 's/":"/\n/g' -e 's/".*$//g' $HOME/test/Moon_Sun
#Forecast feature: Simple Forecast
sed -n '/"simpleforecast": {/,/"hourly_forecast": \[/p' $HOME/test/raw_data | sed 's/"Clear"/"Ciel dégagé"/g;s/"Partly Cloudy"/"Partiellement Nuageux"/g;s/"Chance of Flurries"/"Risque de neige"/g;s/"Chance of Rain"/"Risque de pluie"/g;s/"Chance Rain"/"Risque de pluie"/g;s/"Chance of Freezing Rain"/"Risque de pluie verglaçante"/g;s/"Chance of Sleet"/"Risque de grésil"/g;s/"Chance of Snow"/"Risque de neige"/g;s/"Chance of Thunderstorm*"/"Risque d orage"/g;s/"Cloudy"/"Nuageux"/g;s/"Flurries"/"Averse de neige"/g;s/"Fog"/"Brouillard"/g;s/"Haze"/"Brume"/g;s/"Mostly Cloudy"/"Plutôt nuageux"/g;s/"Mostly Sunny"/"Plutôt ensoleillé"/g;s/"Partly Sunny"/"Partiellement ensoleillé"/g;s/"Freezing Rain"/"Pluie verglaçante"/g;s/"Rain"/"Pluie"/g;s/"Sleet"/"Neige fondue"/g;s/"Snow"/"Neige"/g;s/"Sunny"/"Ensoleillé"/g;s/"Thunderstorm*"/"Orage"/g;s/"Overscat"/"Couvert"/g;s/"Scattered Clouds"/"Nuages épars"/g;s/"NW"/"NO"/g;s/"WNW"/"ONO"/g;s/"SW"/"SO"/g;s/"WSW"/"OSO"/g;s/"NNW"/"NNO"/g' > $HOME/test/Simple_Forecast
sed -i 's/^[ \t]*"//g' $HOME/test/Simple_Forecast
sed -i '/hourly_forecast\|simpleforecast\|forecastday\|{"date"\|period\|icon_url\|^[ \t]*},$\|^[ \t]*}$\|^[ \t]*,$\|^[ \t]*\]$/d' $HOME/test/Simple_Forecast
sed -i -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",$//g' -e 's/,$//g' -e 's/"$//g' $HOME/test//Simple_Forecast
sed -i '/^[ \t]*{/d' $HOME/test/Simple_Forecast
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/test/Simple_Forecast
for (( i=2; i<=146; i+=16 ))
do
cp $HOME/test/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/test/Forecast)).png $HOME/test/d$(( 1+(i-2)/16 )).png
j=$(( i+8 ))
cp $HOME/test/Forecast_Images/$(wun_icon_to_png night $(sed -n ${j}p $HOME/test/Forecast)).png $HOME/test//n$(( 1+(i-2)/16 )).png
done
sed -n '/"hourly_forecast": \[/,/"moon_phase": {/p' $HOME/test/raw_data > $HOME/test/Hourly
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/test/Hourly
sed -i '/hourly_forecast\|FCTTIME\|^{$\|^},$\|^}$\|^,$\|^]$\|moon_phase/d' $HOME/test/Hourly
sed -i -e 's/": /\n/g' -e 's/","/\n/g' -e 's/", "/\n/g' $HOME/test/Hourly
sed -i -e 's/^""//g' -e 's/^"//g' -e 's/^{"//g' -e 's/"},$//g' -e 's/",$//g' $HOME/test/Hourly
sed -i -e 's/^},//g' -e 's/"}$//g' -e 's/^,//g' $HOME/test/Hourly
sed -i -e 's/^icon_url.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/test/Hourly
sed -i -e '/min_unpadded\|UTCDATE/,+1d' $HOME/test/Hourly
for (( i=64; i<=4212; i+=117 ))
do
j=$(( i+1 ))
day_or_night=$(sed -n ${j}p $HOME/test/Hourly)
if [[ $day_or_night == nt ]]; then
cp $HOME/test/Forecast_Images/$(wun_icon_to_png night $(sed -n ${i}p $HOME/test/Hourly)).png $HOME/test/h$(( 1+(i-64)/117 )).png
else
cp $HOME/test/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/test/Hourly)).png $HOME/test/h$(( 1+(i-64)/117 )).png
fi
done
The conky :
conky.config = {
background = false,
use_xft = true,
font = 'DejaVuSansMono:size=8',
update_interval = 1800.0,
total_run_times = 0,
own_window = true,
own_window_type = 'dock',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_hints = 'undecorated,skip_taskbar,skip_pager,below',
double_buffer = true,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = true,
stippled_borders = 8,
border_inner_margin = 4,
alignment = 'top_left',
minimum_width = 350,
minimum_height = 400,
gap_x = 130,
gap_y = 85,
no_buffers = false,
uppercase = false,
cpu_avg_samples = 2,
net_avg_samples = 2,
override_utf8_locale = true,
use_spacer = right,
text_buffer_size = 6144,
imlib_cache_size = 8192,
default_outline_color = '000000',
color1 = 'F5B800',
color2 = '00f5ff',
}
conky.text = [[
${exec bash $HOME/test/3b}\
${alignc}${font DejaVuSansMono:bold:size=10}${color2}Actuel
${image ~/test/Now.png -p -25,15 -s 125x75}
${voffset -15}${font}${goto 70}Temp : ${color1}${exec sed -n '67p' $HOME/test/Conditions}° ${color2}Pression : ${color1}${exec sed -n '85p' $HOME/test/Conditions} hPa
${goto 70}${color2}Vent : ${color1}${exec sed -n '81p' $HOME/test/Conditions} km/h${color2} Direction : ${color1}${exec sed -n '73p' $HOME/test/Conditions}
${color2}${alignc}${exec sed -n '63p' $HOME/test/Conditions}
${color2}${alignc}SOLEIL
${goto 70}Lever : ${color1}${execi 600 sed -n '16p' $HOME/test/Moon_Sun}:${execi 600 sed -n '18p' $HOME/test/Moon_Sun} \
${color2}Coucher : ${color1}${execi 600 sed -n '21p' $HOME/test/Moon_Sun}:${execi 600 sed -n '23p' $HOME/test/Moon_Sun}
${alignc}${font DejaVuSansMono:bold:size=10}${color2}Prévisions${font}
${color2}${goto 30}${membar 0,110} Aujourd'hui ${membar 0,85}
${image ~/test/d1.png -p 15,135 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '44p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '39p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '46p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="1 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d2.png -p 15,185 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '150p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '145p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '152p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="2 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d3.png -p 15,235 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '256p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '251p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '258p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="3 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d4.png -p 15,285 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '362p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '357p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '364p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="4 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d5.png -p 15,335 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '468p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '463p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '470p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="5 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d6.png -p 15,385 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '574p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '569p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '576p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="6 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d7.png -p 15,435 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '680p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '675p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '682p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,120} ${execi 3600 date --date="7 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,110}
${image ~/test/d8.png -p 15,485 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '786p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '781p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '788p' $HOME/test/Simple_Forecast}
]]
Offline
Very Nice!
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Bon!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Offline
my last conky-meteo (with 2b_Wunderground_API and script 3b (post #1457 ))
The conky :
conky.config = {
background = false,
use_xft = true,
font = 'DejaVuSansMono:size=8',
update_interval = 1800.0,
total_run_times = 0,
own_window = true,
own_window_type = 'dock',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_hints = 'undecorated,skip_taskbar,skip_pager,below',
double_buffer = true,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = true,
stippled_borders = 8,
border_inner_margin = 4,
alignment = 'top_left',
minimum_width = 240,
minimum_height = 400,
gap_x = 130,
gap_y = 85,
no_buffers = false,
uppercase = false,
cpu_avg_samples = 2,
net_avg_samples = 2,
override_utf8_locale = true,
use_spacer = right,
text_buffer_size = 6144,
imlib_cache_size = 8192,
default_outline_color = '000000',
color1 = 'F5B800',
color2 = '00f5ff',
}
conky.text = [[${exec bash $HOME/test/3b}\${font DejaVuSansMono:bold:size=10}${color2}${goto 145}Actuel
${font}${color2}${goto 40}${voffset 10}Temp ${color1}${exec sed -n '67p' $HOME/test/Conditions}°${color2}${goto 210} Pression ${color1}${exec sed -n '85p' $HOME/test/Conditions} hPa
${image ~/test/Now.png -p 55,0 -s 210x126}
${color2}${goto 40}${voffset 15}Vent ${color1}${exec sed -n '81p' $HOME/test/Conditions} km/h ${color2}${goto 210} Direction ${color1}${exec sed -n '73p' $HOME/test/Conditions}
${color2}${goto 150}SOLEIL
${goto 60}Lever : ${color1}${execi 600 sed -n '16p' $HOME/test/Moon_Sun}:${execi 600 sed -n '18p' $HOME/test/Moon_Sun} \
${color2}Coucher : ${color1}${execi 600 sed -n '21p' $HOME/test/Moon_Sun}:${execi 600 sed -n '23p' $HOME/test/Moon_Sun}
${goto 130}${font DejaVuSansMono:bold:size=10}${color2}Prévisions${font}
${color2}${goto 30}${membar 0,95} Aujourd'hui ${membar 0,100}
${image ~/test/d1.png -p 15,190 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '44p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '39p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '46p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="1 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d2.png -p 15,240 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '150p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '145p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '152p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="2 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d3.png -p 15,290 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '256p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '251p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '258p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="3 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d4.png -p 15,340 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '362p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '357p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '364p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="4 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d5.png -p 15,390 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '468p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '463p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '470p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="5 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d6.png -p 15,440 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '574p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '569p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '576p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="6 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d7.png -p 15,490 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '680p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '675p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '682p' $HOME/test/Simple_Forecast}
${color2}${goto 30}${membar 0,105} ${execi 3600 date --date="7 day" | awk '{print $1""$3}' | tr '[a-z]' '[A-Z]'} ${color2}${membar 0,125}
${image ~/test/d8.png -p 15,540 -s 53x32}
${voffset -15}${font}${goto 70}Temp mini : ${color1}${exec sed -n '786p' $HOME/test/Simple_Forecast}° ${color2}Temp maxi : ${color1}${exec sed -n '781p' $HOME/test/Simple_Forecast}°
${color2}${alignc}${exec sed -n '788p' $HOME/test/Simple_Forecast}
]]
I have a question:
when I go to wundergroud-weather site ( https://www.wunderground.com/q/zmw:0000 … IAUBAGNE45 ) I can see all strings for forecast are in french.
But with the API they are in English.
Can I have the API in french ?
Or it is not possible ?
Offline
Forget my question, I found the answer.
To have the API in French, you must just add lang:FR in the address in the script 3b (or 2b), like this :
#put your Weather Underground address API here
address="http://api.wunderground.com/api/you_api_key_here/conditions/forecast10day/astronomy/hourly/satellite/lang:FR/q/aubagne.json"
I test and that work !!!
Now you can remove the translation in the script :
#!/bin/bash
#put your hemisphere here: n for north, s for south
hemisphere=n
#put your Weather Underground address API here
address="http://api.wunderground.com/api/your_api_key_here/conditions/forecast10day/astronomy/hourly/satellite/lang:FR/q/aubagne.json"
wun_icon_to_png () {
if [[ $1 == day ]]; then
case $2 in
chanceflurries)
echo 21
;;
chancerain)
echo 14
;;
chancesleet)
echo 26
;;
chancesnow)
echo 20
;;
chancetstorms)
echo 17
;;
clear)
echo 1
;;
cloudy)
echo 7
;;
flurries)
echo 21
;;
fog)
echo 11
;;
hazy)
echo 5
;;
mostlycloudy)
echo 6
;;
mostlysunny)
echo 4
;;
partlycloudy)
echo 4
;;
partlysunny)
echo 6
;;
sleet)
echo 26
;;
rain)
echo 18
;;
snow)
echo 22
;;
sunny)
echo 1
;;
tstorms)
echo 15
;;
unknown)
echo 0
;;
esac
elif [[ $1 == night ]]; then
case $2 in
chanceflurries)
echo 43
;;
chancerain)
echo 39
;;
chancesleet)
echo 40
;;
chancesnow)
echo 43
;;
chancetstorms)
echo 41
;;
clear)
echo 33
;;
cloudy)
echo 38
;;
flurries)
echo 43
;;
fog)
echo 11
;;
hazy)
echo 37
;;
mostlycloudy)
echo 36
;;
mostlysunny)
echo 35
;;
partlycloudy)
echo 35
;;
partlysunny)
echo 36
;;
sleet)
echo 40
;;
rain)
echo 40
;;
snow)
echo 44
;;
sunny)
echo 33
;;
tstorms)
echo 41
;;
unknown)
echo 0
;;
esac
fi
}
#rm $HOME/test/*.png
curl $address -o $HOME/test/raw_data
sed -n '/, "current_observation": {/,/, "satellite": {/p' $HOME/test/raw_data > $HOME/test/Conditions
sed -i 's/^[ \t]*"//g' $HOME/test/Conditions
sed -i '/current_observation\|image":\|logo_\|title":\|link":\|^[ \t]*},$\|^[ \t]*}$\|temperature_string\|forecast_url\|history_url\|ob_url\|satellite":/d' $HOME/test/Conditions
sed -i -e 's/":"/\n/g' -e 's/",\|": {$//g' -e 's/"precip_1hr_string/\nprecip_1hr_string/g' -e 's/":/\n/g' -e 's/,$//g' $HOME/test/Conditions
sed -i -e 's/^http.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/test/Conditions
day_or_night=$(sed -n 137p $HOME/test/Conditions)
if [[ $day_or_night == nt ]]; then
cp $HOME/test/Forecast_Images/$(wun_icon_to_png night $(sed -n 135p $HOME/test/Conditions)).png $HOME/test/Now.png
else
cp $HOME/test/Forecast_Images/$(wun_icon_to_png day $(sed -n 135p $HOME/test/Conditions)).png $HOME/test/Now.png
fi
#Forecast feature: Forecast
sed -n '/"forecast":{/,/"simpleforecast": {/p' $HOME/test/raw_data > $HOME/test/Forecast
sed -i -e '/"period":\|icon_url/d' $HOME/test/Forecast
sed -i 's/^[ \t]*"//g' $HOME/test/Forecast
sed -i -e '/period\|icon\|title\|fcttext/!d' -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",//g' -e 's/,$//g' -e 's/nt_//g' $HOME/test/Forecast
#Forecast feature: Moon_Sun
sed -n '/"moon_phase": {/,/"sun_phase": {/p' $HOME/test/raw_data > $HOME/test/Moon_Sun
sed -i 's/^[ \t]*"//g' $HOME/test/Moon_Sun
sed -i '/moon_phase\|^[ \t]*},$\|sun_phase\|^[ \t]*}$/d' $HOME/test/Moon_Sun
sed -i -e 's/":"/\n/g' -e 's/".*$//g' $HOME/test/Moon_Sun
#Forecast feature: Simple Forecast
sed -n '/"simpleforecast": {/,/"hourly_forecast": \[/p' $HOME/test/raw_data > $HOME/test/Simple_Forecast
sed -i 's/^[ \t]*"//g' $HOME/test/Simple_Forecast
sed -i '/hourly_forecast\|simpleforecast\|forecastday\|{"date"\|period\|icon_url\|^[ \t]*},$\|^[ \t]*}$\|^[ \t]*,$\|^[ \t]*\]$/d' $HOME/test/Simple_Forecast
sed -i -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",$//g' -e 's/,$//g' -e 's/"$//g' $HOME/test//Simple_Forecast
sed -i '/^[ \t]*{/d' $HOME/test/Simple_Forecast
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/test/Simple_Forecast
for (( i=2; i<=146; i+=16 ))
do
cp $HOME/test/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/test/Forecast)).png $HOME/test/d$(( 1+(i-2)/16 )).png
j=$(( i+8 ))
cp $HOME/test/Forecast_Images/$(wun_icon_to_png night $(sed -n ${j}p $HOME/test/Forecast)).png $HOME/test//n$(( 1+(i-2)/16 )).png
done
sed -n '/"hourly_forecast": \[/,/"moon_phase": {/p' $HOME/test/raw_data > $HOME/test/Hourly
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/test/Hourly
sed -i '/hourly_forecast\|FCTTIME\|^{$\|^},$\|^}$\|^,$\|^]$\|moon_phase/d' $HOME/test/Hourly
sed -i -e 's/": /\n/g' -e 's/","/\n/g' -e 's/", "/\n/g' $HOME/test/Hourly
sed -i -e 's/^""//g' -e 's/^"//g' -e 's/^{"//g' -e 's/"},$//g' -e 's/",$//g' $HOME/test/Hourly
sed -i -e 's/^},//g' -e 's/"}$//g' -e 's/^,//g' $HOME/test/Hourly
sed -i -e 's/^icon_url.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/test/Hourly
sed -i -e '/min_unpadded\|UTCDATE/,+1d' $HOME/test/Hourly
for (( i=64; i<=4212; i+=117 ))
do
j=$(( i+1 ))
day_or_night=$(sed -n ${j}p $HOME/test/Hourly)
if [[ $day_or_night == nt ]]; then
cp $HOME/test/Forecast_Images/$(wun_icon_to_png night $(sed -n ${i}p $HOME/test/Hourly)).png $HOME/test/h$(( 1+(i-64)/117 )).png
else
cp $HOME/test/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/test/Hourly)).png $HOME/test/h$(( 1+(i-64)/117 )).png
fi
done
Last edited by chepioq (2017-01-15 14:39:48)
Offline
I have a question:
when I go to wundergroud-weather site ( https://www.wunderground.com/q/zmw:0000 … IAUBAGNE45 ) I can see all strings for forecast are in french.But with the API they are in English.
Can I have the API in french ?
Or it is not possible ?
I can't answer your questions - that's beyond me. But I do have a comment.
When I click on the link you posted, I see everything in English.
A quick search, maybe here Switch Language.
oh oh ... here: How to Tap The Weather Underground’s Plethora of Data Via API I see - and they used French as an example too:
In your URL you also can include an optional setting. There are a few, but one important one is language. The default is English; if you want to use, for example, French, you input lang:FR.
So far, our URL looks like this:
http://api.wunderground.com/api/SECURITYKEY/feature/
Or, with a language:
I hope that helps you.
Have a GREAT day!
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline