Coming to a terminal near you - weather!

A place to share tips, guides, application configurations and scripts about all elements of ArchLabs

Moderator: Founder

Coming to a terminal near you - weather!

PostPosted by Sector11 » Mon Jul 10, 2017 3:00 pm

It's not a conky, but uses a script designed for conky .... now this is sexy!
Image

1. Head over to BunsenLab forum to TeoBigusGeekus' weather thread and grab the 1) Accuweather - 1_24-5-17 script and set it up as if you were going to use it in a conky. If you have it in a conky, even better, you can comment out the "wget" line and have at it.

2. create a bash script in ~/bin. I call mine 'bsas' because I live in Buenos Aires, do your own thing:
~/bin/bsas
Code: Select all
#!/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
### Run Teos script to refresh the databases
### Change the "wget" commands to "wget -o /dev/null" 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 "- Buenos Aries, Argentina -"
tput cup 1 35;tput setaf 9
echo "- Accuweather -"
tput cup 2 1;tput setaf 9
echo "Currently"
tput cup 2 11;tput setaf 3
echo `sed -n '2p' ~/1_accuweather/curr_cond`"°"
tput cup 2 15;tput setaf 9
echo " for ±"
tput cup 2 21;tput setaf 3
echo `sed -n '3p' ~/1_accuweather/curr_cond`"°"
tput cup 3 1;tput setaf 2
echo `sed -n '4p' ~/1_accuweather/curr_cond`
tput cup 4 1;tput setaf 3
echo "Bar"
tput cup 4 5;tput setaf 9
echo `sed -n '8p' ~/1_accuweather/curr_cond`
tput cup 4 16;tput setaf 3
echo "Hum"
tput cup 4 20;tput setaf 9
echo `sed -n '7p' ~/1_accuweather/curr_cond`
tput cup 4 25;tput setaf 3
echo "UVI"
tput cup 4 29;tput setaf 9
echo `sed -n '9p' ~/1_accuweather/curr_cond`
tput cup 5 1;tput setaf 3
echo "Wnd"
tput cup 5 5;tput setaf 9
echo `sed -n '5p' ~/1_accuweather/curr_cond`" @ "`sed -n '6p' ~/1_accuweather/curr_cond`
tput cup 5 21;tput setaf 3
echo "Vis"
tput cup 5 25;tput setaf 9
echo `sed -n '13p' ~/1_accuweather/curr_cond`
tput cup 6 1;tput setaf 3
echo "Ceil"
tput cup 6 6;tput setaf 9
echo `sed -n '11p' ~/1_accuweather/curr_cond`
tput cup 6 14;tput setaf 3
echo "Dew"
tput cup 6 18;tput setaf 9
echo `sed -n '12p' ~/1_accuweather/curr_cond`"°"
tput cup 6 22;tput setaf 3
echo "CC"
tput cup 6 25;tput setaf 9
echo `sed -n '10p' ~/1_accuweather/curr_cond`

# Today Day 0 (1st Group RIGHT) Mon
tput cup 2 35;tput setaf 9
echo "$(date --date="0 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 2 51;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 2 53;tput setaf 9
echo `sed -n '3p' ~/1_accuweather/first_days`"°"
tput cup 2 58;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 2 60;tput setaf 9
echo `sed -n '4p' ~/1_accuweather/first_days`"°"
tput cup 3 35;tput setaf 2
echo `sed -n '5p' ~/1_accuweather/first_days`
tput cup 4 35;tput setaf 9
echo "Sun Rise"
tput cup 4 44;tput setaf 3
echo `sed -n '23p' ~/1_accuweather/curr_cond`
tput cup 4 50;tput setaf 9
echo "Moon Rise "
tput cup 4 60;tput setaf 6
echo `sed -n '25p' ~/1_accuweather/curr_cond`
tput cup 5 40;tput setaf 9
echo "Set"
tput cup 5 44;tput setaf 3
echo `sed -n '24p' ~/1_accuweather/curr_cond`
tput cup 5 56;tput setaf 9
echo "Set"
tput cup 5 60;tput setaf 6
echo `sed -n '26p' ~/1_accuweather/curr_cond`
tput cup 6 35;tput setaf 9
echo "Duration"
tput cup 6 44;tput setaf 3
echo `sed -n '16p' ~/1_accuweather/curr_cond`
tput cup 6 57;tput setaf 6
echo `sed -n '20p' ~/1_accuweather/curr_cond`

# Day 1 (2nd Group LEFT) Tue
tput cup 7 1;tput setaf 9
echo "----------------------------------"
tput cup 8 1;tput setaf 9
echo "$(date --date="1 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 8 17;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 8 19;tput setaf 9
echo `sed -n '8p' ~/1_accuweather/first_days`"°"
tput cup 8 25;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 8 27;tput setaf 9
echo `sed -n '9p' ~/1_accuweather/first_days`"°"
tput cup 9 1;tput setaf 2
echo `sed -n '10p' ~/1_accuweather/first_days`

# Day 2 (2nd Group RIGHT) Wed
tput cup 7 35;tput setaf 9
echo "-------------------------------"
tput cup 8 35;tput setaf 9
echo "$(date --date="2 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 8 51;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 8 53;tput setaf 9
echo `sed -n '13p' ~/1_accuweather/first_days`"°"
tput cup 8 58;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 8 60;tput setaf 9
echo `sed -n '14p' ~/1_accuweather/first_days`"°"
tput cup 9 35;tput setaf 2
echo `sed -n '5p' ~/1_accuweather/first_days`

# Day 3 (3rd Group LEFT) Thu
tput cup 10 1;tput setaf 9
echo "-------------------------------"
tput cup 11 1;tput setaf 9
echo "$(date --date="3 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 11 17;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 11 19;tput setaf 9
echo `sed -n '18p' ~/1_accuweather/first_days`"°"
tput cup 11 25;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 11 27;tput setaf 9
echo `sed -n '19p' ~/1_accuweather/first_days`"°"
tput cup 12 1;tput setaf 2
echo `sed -n '10p' ~/1_accuweather/first_days`

# Day 4 (3rd Group RIGHT) Fri
tput cup 10 35;tput setaf 9
echo "-------------------------------"
tput cup 11 35;tput setaf 9
echo "$(date --date="4 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 11 51;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 11 53;tput setaf 9
echo `sed -n '23p' ~/1_accuweather/first_days`"°"
tput cup 11 58;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 11 60;tput setaf 9
echo `sed -n '24p' ~/1_accuweather/first_days`"°"
tput cup 12 35;tput setaf 2
echo `sed -n '5p' ~/1_accuweather/first_days`

# Day 5 (4th Group LEFT) Sat
tput cup 13 1;tput setaf 9
echo "-------------------------------"
tput cup 14 1;tput setaf 9
echo "$(date --date="5 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 14 17;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 14 19;tput setaf 9
echo `sed -n '3p' ~/1_accuweather/last_days`"°"
tput cup 14 25;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 14 27
echo `sed -n '4p' ~/1_accuweather/last_days`"°"
tput cup 15 1;tput setaf 2
echo `sed -n '5p' ~/1_accuweather/last_days`

# Day 6 (4th Group RIGHT) Sun
tput cup 13 35;tput setaf 9
echo "-------------------------------"
tput cup 14 35;tput setaf 9
echo "$(date --date="6 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 14 51;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 14 53;tput setaf 9
echo `sed -n '8p' ~/1_accuweather/last_days`"°"
tput cup 14 58;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 14 60
echo `sed -n '9p' ~/1_accuweather/last_days`"°"
tput cup 15 35;tput setaf 2
echo `sed -n '10p' ~/1_accuweather/last_days`

# Day 7 (5th Group LEFT) Mon
tput cup 16 1;tput setaf 9
echo "-------------------------------"
tput cup 17 1;tput setaf 9
echo "$(date --date="7 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 17 17;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 17 19
echo `sed -n '13p' ~/1_accuweather/last_days`"°"
tput cup 17 25;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 17 27;tput setaf 9
echo `sed -n '14p' ~/1_accuweather/last_days`"°"
tput cup 18 1;tput setaf 2
echo `sed -n '15p' ~/1_accuweather/last_days`
tput cup 19 1;tput setaf 9
echo "-------------------------------"

# Day 8 (5th Group RIGHT) Tue
tput cup 16 35;tput setaf 9
echo "-------------------------------"
tput cup 17 35;tput setaf 9
echo "$(date --date="8 day" | awk '{print $1" "$3" "$2" "$6}')"
tput cup 17 51;tput setaf 1;tput bold
echo "↑";tput sgr0
tput cup 17 53;tput setaf 9
echo `sed -n '18p' ~/1_accuweather/last_days`"°"
tput cup 17 58;tput setaf 6;tput bold
echo "↓";tput sgr0
tput cup 17 60;tput setaf 9
echo `sed -n '19p' ~/1_accuweather/last_days`"°"
tput cup 18 35;tput setaf 2
echo `sed -n '20p' ~/1_accuweather/last_days`
tput cup 19 35;tput setaf 9
echo "-------------------------------"
tput sgr0
$SHELL

In OpenBox I created a menu item:
Name:
Code: Select all
BsAs Wx

Execute: (your version might be Command)
Code: Select all
terminator --geometry=540x330+80+80 -b -x bsas

-- geometry will need changing to set the right size for your font ... I'm using: Inconsolata Bold - 10 in mine.
I'm a member of Conky Anonymous, a One Step Program
The CA One Step:
1. We admitted we were powerless over conky - and LOVE IT!
User avatar
Sector11
 
Posts: 79
Joined: Sat May 06, 2017 5:45 am

Re: Coming to a terminal near you - weather!

PostPosted by Dobbie03 » Mon Jul 10, 2017 6:26 pm

Thanks for this!!
I like my Metal like my coffee.......black
User avatar
Dobbie03
Founder
Founder
 
Posts: 549
Joined: Sat Feb 18, 2017 2:51 pm
Location: New Zealand
Running Release: DobbieBang

Re: Coming to a terminal near you - weather!

PostPosted by ector » Wed Jul 12, 2017 8:26 pm

thank,sector11

I also like this very much
https://github.com/chubin/wttr.in

but I always prefer the weather on the desktop.
Image
ector
 
Posts: 23
Joined: Thu Jun 01, 2017 6:14 am


Return to Configs, Scripts, Tutorials and Tips

Who is online

Users browsing this forum: No registered users and 0 guests