Skip to content

ryancurrah/weather-term

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

weather-term

Weather in your terminal! This binary updates a .weather file in your home directory that can be used in your terminal.

Requirements

  • Nerdfonts as your terminals font
  • OpenWeatherMap API key
  • weather-term binary running in the background preferably as a service

Add to startup on mac

Fill out com.weather-term.plist with your values

cp ./com.weather-term.plist ~/Library/LaunchAgents/com.weather-term.plist

launchctl load -w ~/Library/LaunchAgents/com.weather-term.plist

launchctl start -w ~/Library/LaunchAgents/com.weather-term.plist

Get it working with POWERLEVEL9k

In your .zshrc file add the following lines...

POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_CUSTOM_WEATHER="prompt_weather"
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_weather)

function prompt_weather() {
    echo "$(cat "${HOME}/.weather")"
}

Example

weather-term -country US -city Miami -key 0000000000000000000 -unit imperial
^C

cat ~/.weather
 77.41     5.82m/s SW