celsius option
This commit is contained in:
parent
0b5735373b
commit
60675a1710
7 changed files with 15 additions and 26 deletions
|
@ -1 +1 @@
|
||||||
Loading Weather...
|
☀ 18° Pleasanton, CA
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Author: Dane Williams
|
|
||||||
# a theme for tmux inspired by dracula
|
|
||||||
|
|
||||||
# source and run dracula theme
|
# source and run dracula theme
|
||||||
|
|
||||||
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/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()
|
battery_percent()
|
||||||
{
|
{
|
||||||
# Check OS
|
# Check OS
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# a tmux color scheme inspired by dracula
|
|
||||||
# author: Dane Williams
|
|
||||||
|
|
||||||
get_tmux_option() {
|
get_tmux_option() {
|
||||||
local option=$1
|
local option=$1
|
||||||
local default_value=$2
|
local default_value=$2
|
||||||
|
@ -23,7 +20,7 @@ main()
|
||||||
show_battery=$(get_tmux_option "@dracula-show-battery" true)
|
show_battery=$(get_tmux_option "@dracula-show-battery" true)
|
||||||
show_network=$(get_tmux_option "@dracula-show-network" true)
|
show_network=$(get_tmux_option "@dracula-show-network" true)
|
||||||
show_weather=$(get_tmux_option "@dracula-show-weather" 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
|
# Dracula Color Pallette
|
||||||
white='#f8f8f2'
|
white='#f8f8f2'
|
||||||
|
@ -40,7 +37,7 @@ main()
|
||||||
|
|
||||||
# start weather script in background
|
# start weather script in background
|
||||||
if $show_weather; then
|
if $show_weather; then
|
||||||
$current_dir/sleep_weather.sh &
|
$current_dir/sleep_weather.sh $show_fahrenheit &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set refresh interval
|
# set refresh interval
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/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"
|
HOSTS="google.com github.com example.com"
|
||||||
|
|
||||||
get_ssid()
|
get_ssid()
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#wrapper script for running weather on interval
|
#wrapper script for running weather on interval
|
||||||
|
|
||||||
|
fahrenheit=$1
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
@ -10,7 +12,7 @@ main()
|
||||||
|
|
||||||
while tmux has-session &> /dev/null
|
while tmux has-session &> /dev/null
|
||||||
do
|
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
|
if tmux has-session &> /dev/null
|
||||||
then
|
then
|
||||||
sleep 1200
|
sleep 1200
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/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
|
fahrenheit=$1
|
||||||
# only testing last request because of redundancy
|
|
||||||
load_request_params()
|
load_request_params()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -33,7 +30,11 @@ weather_information()
|
||||||
}
|
}
|
||||||
get_temp()
|
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()
|
forecast_unicode()
|
||||||
{
|
{
|
||||||
|
@ -57,7 +58,7 @@ forecast_unicode()
|
||||||
display_weather()
|
display_weather()
|
||||||
{
|
{
|
||||||
if [ $country = 'US' ]; then
|
if [ $country = 'US' ]; then
|
||||||
echo "$(forecast_unicode)$(get_temp)°F"
|
echo "$(forecast_unicode)$(get_temp)°"
|
||||||
else
|
else
|
||||||
echo ''
|
echo ''
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue