Merge pull request #21 from dracula/celsius

celsius option
This commit is contained in:
Dane Williams 2020-04-29 11:35:38 -07:00 committed by GitHub
commit 48a91171de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 26 deletions

View file

@ -1 +1 @@
Loading Weather...
☀ 18° Pleasanton, CA

View file

@ -1,8 +1,5 @@
#!/usr/bin/env bash
# Author: Dane Williams
# a theme for tmux inspired by dracula
# source and run dracula theme
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

View file

@ -1,9 +1,5 @@
#!/usr/bin/env bash
#author: Dane Williams
#scipt for gathering battery percentage and A/C status
#script is called in dracula.tmux program
battery_percent()
{
# Check OS

View file

@ -1,8 +1,5 @@
#!/usr/bin/env bash
# a tmux color scheme inspired by dracula
# author: Dane Williams
get_tmux_option() {
local option=$1
local default_value=$2
@ -23,7 +20,7 @@ main()
show_battery=$(get_tmux_option "@dracula-show-battery" true)
show_network=$(get_tmux_option "@dracula-show-network" true)
show_weather=$(get_tmux_option "@dracula-show-weather" true)
fahrenheit=$(get_tmux_option "@dracula-fahrenheit" true)
show_fahrenheit=$(get_tmux_option "@dracula-show-fahrenheit" true)
# Dracula Color Pallette
white='#f8f8f2'
@ -40,7 +37,7 @@ main()
# start weather script in background
if $show_weather; then
$current_dir/sleep_weather.sh &
$current_dir/sleep_weather.sh $show_fahrenheit &
fi
# set refresh interval

View file

@ -1,9 +1,5 @@
#!/usr/bin/env bash
#author: Dane Williams
#script for gathering internet connectivity info
#script is called in dracula.tmux program
HOSTS="google.com github.com example.com"
get_ssid()

View file

@ -2,6 +2,8 @@
#wrapper script for running weather on interval
fahrenheit=$1
main()
{
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@ -10,7 +12,7 @@ main()
while tmux has-session &> /dev/null
do
$current_dir/weather.sh > $current_dir/../data/weather.txt
$current_dir/weather.sh $fahrenheit > $current_dir/../data/weather.txt
if tmux has-session &> /dev/null
then
sleep 1200

View file

@ -1,11 +1,8 @@
#!/usr/bin/env bash
#author: Dane Williams
#script for gathering current location and weather at location
#script is then called in the dracula.tmux program
# test if rate limit hit
# only testing last request because of redundancy
fahrenheit=$1
load_request_params()
{
@ -33,7 +30,11 @@ weather_information()
}
get_temp()
{
weather_information | grep 'deg;F' | cut -d '&' -f 1
if $fahrenheit; then
echo $(weather_information | grep 'deg;F' | cut -d '&' -f 1)
else
echo $(( ($(weather_information | grep 'deg;F' | cut -d '&' -f 1) - 32) * 5 / 9 ))
fi
}
forecast_unicode()
{
@ -57,7 +58,7 @@ forecast_unicode()
display_weather()
{
if [ $country = 'US' ]; then
echo "$(forecast_unicode)$(get_temp)°F"
echo "$(forecast_unicode)$(get_temp)°"
else
echo ''
fi