Fork from dracula and change the theme to be minimal
This commit is contained in:
parent
05be73462a
commit
df2068c2d6
|
@ -1 +0,0 @@
|
|||
☀ 18° Pleasanton, CA
|
|
@ -1,8 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# source and run dracula theme
|
||||
|
||||
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
$current_dir/scripts/dracula.sh
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This is a clone from dracula
|
||||
# source and run lxtmux theme
|
||||
|
||||
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
$current_dir/scripts/lxtmux.sh
|
||||
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 410 KiB |
|
@ -52,9 +52,8 @@ main()
|
|||
{
|
||||
bat_stat=$(battery_status)
|
||||
bat_perc=$(battery_percent)
|
||||
echo "♥ $bat_stat$bat_perc"
|
||||
echo "$bat_stat$bat_perc"
|
||||
}
|
||||
|
||||
#run main driver program
|
||||
main
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
running_containers() {
|
||||
docker ps -q|wc -l
|
||||
}
|
||||
|
||||
all_containers() {
|
||||
docker ps -a -q|wc -l
|
||||
}
|
||||
|
||||
|
||||
main() {
|
||||
echo "$(running_containers) | $(all_containers)"
|
||||
}
|
||||
|
||||
main
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
git_branch() {
|
||||
git branch |grep "*"|cut -d ' ' -f 2
|
||||
}
|
||||
|
||||
|
||||
main() {
|
||||
br=$(git_branch)
|
||||
echo "$@"
|
||||
}
|
||||
|
||||
main
|
|
@ -17,10 +17,8 @@ main()
|
|||
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# set configuration option variables
|
||||
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)
|
||||
show_fahrenheit=$(get_tmux_option "@dracula-show-fahrenheit" true)
|
||||
show_battery=$(get_tmux_option "@lx-show-battery" true)
|
||||
show_network=$(get_tmux_option "@lx-show-network" true)
|
||||
|
||||
# Dracula Color Pallette
|
||||
white='#f8f8f2'
|
||||
|
@ -35,11 +33,6 @@ main()
|
|||
pink='#ff79c6'
|
||||
yellow='#f1fa8c'
|
||||
|
||||
# start weather script in background
|
||||
if $show_weather; then
|
||||
$current_dir/sleep_weather.sh $show_fahrenheit &
|
||||
fi
|
||||
|
||||
# set refresh interval
|
||||
tmux set-option -g status-interval 5
|
||||
|
||||
|
@ -60,23 +53,17 @@ main()
|
|||
# status bar
|
||||
tmux set-option -g status-style "bg=${gray},fg=${white}"
|
||||
|
||||
tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ☺ "
|
||||
tmux set-option -g status-left "#[bg=${dark_gray},fg=${white}]#{?client_prefix,#[bg=${yellow}],}"
|
||||
|
||||
tmux set-option -g status-right ""
|
||||
|
||||
if $show_battery; then
|
||||
tmux set-option -g status-right "#[fg=${dark_gray},bg=${pink}] #($current_dir/battery.sh) "
|
||||
tmux set-option -g status-right "#[fg=${dark_gray},bg=${orange}] #($current_dir/battery.sh) "
|
||||
fi
|
||||
|
||||
if $show_network; then
|
||||
tmux set-option -ga status-right "#[fg=${dark_gray},bg=${cyan}]#($current_dir/network.sh) "
|
||||
fi
|
||||
tmux set-option -ga status-right "#[fg=${white},bg=${dark_gray}]D: #($current_dir/docker.sh) "
|
||||
|
||||
if $show_weather; then
|
||||
tmux set-option -ga status-right "#[fg=${dark_gray},bg=${orange}] #(cat $current_dir/../data/weather.txt) "
|
||||
fi
|
||||
|
||||
tmux set-option -ga status-right "#[fg=${white},bg=${dark_purple}] %a %m/%d %I:%M %p #(date +%Z) "
|
||||
tmux set-option -ga status-right "#[fg=${white},bg=${dark_purple}] %m/%d %I:%M "
|
||||
|
||||
# window tabs
|
||||
tmux set-window-option -g window-status-current-format "#[fg=${white},bg=${dark_purple}] #I #W "
|
|
@ -1,26 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#wrapper script for running weather on interval
|
||||
|
||||
fahrenheit=$1
|
||||
|
||||
main()
|
||||
{
|
||||
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
$current_dir/weather.sh > $current_dir/../data/weather.txt
|
||||
|
||||
while tmux has-session &> /dev/null
|
||||
do
|
||||
$current_dir/weather.sh $fahrenheit > $current_dir/../data/weather.txt
|
||||
if tmux has-session &> /dev/null
|
||||
then
|
||||
sleep 1200
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#run main driver function
|
||||
main
|
|
@ -1,85 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
fahrenheit=$1
|
||||
|
||||
load_request_params()
|
||||
{
|
||||
|
||||
city=$(curl -s https://ipinfo.io/city 2> /dev/null)
|
||||
region=$(curl -s https://ipinfo.io/region 2> /dev/null)
|
||||
zip=$(curl -s https://ipinfo.io/postal 2> /dev/null | tail -1)
|
||||
country_w_code=$(curl -w "\n%{http_code}\n" -s https://ipinfo.io/country 2> /dev/null)
|
||||
country=`grep -Eo [a-zA-Z]+ <<< "$country_w_code"`
|
||||
exit_code=`grep -Eo [0-9]{3} <<< "$country_w_code"`
|
||||
|
||||
region_code_url=http://www.ip2country.net/ip2country/region_code.html
|
||||
weather_url=https://forecast.weather.gov/zipcity.php
|
||||
}
|
||||
|
||||
#substitute region code for regions in north america
|
||||
get_region_code()
|
||||
{
|
||||
curl -s $region_code_url | grep $region &> /dev/null && region=$(curl -s $region_code_url | grep $region | cut -d ',' -f 2)
|
||||
echo $region
|
||||
}
|
||||
|
||||
weather_information()
|
||||
{
|
||||
curl -sL $weather_url?inputstring=$zip | grep myforecast-current | grep -Eo '>.*<' | sed -E 's/>(.*)</\1/'
|
||||
}
|
||||
get_temp()
|
||||
{
|
||||
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=$(weather_information | head -n 1)
|
||||
|
||||
if [[ $forecast =~ 'Snow' ]]; then
|
||||
echo '❄ '
|
||||
elif [[ (($forecast =~ 'Rain') || ($forecast =~ 'Shower')) ]]; then
|
||||
echo '☂ '
|
||||
elif [[ (($forecast =~ 'Overcast') || ($forecast =~ 'Cloud')) ]]; then
|
||||
echo '☁ '
|
||||
elif [[ $forecast = 'NA' ]]; then
|
||||
echo ''
|
||||
else
|
||||
echo '☀ '
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
#get weather display if in US
|
||||
display_weather()
|
||||
{
|
||||
if [ $country = 'US' ]; then
|
||||
echo "$(forecast_unicode)$(get_temp)°"
|
||||
else
|
||||
echo ''
|
||||
fi
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
# don't run the rest of the script unless we can safely get all the information
|
||||
load_request_params
|
||||
|
||||
if [[ $exit_code -eq 429 ]]; then
|
||||
echo "Request Limit Reached"
|
||||
exit
|
||||
fi
|
||||
# process should be cancelled when session is killed
|
||||
if ping -q -c 1 -W 1 ipinfo.io &>/dev/null; then
|
||||
echo "$(display_weather) $city, $(get_region_code)"
|
||||
else
|
||||
echo "Location Unavailable"
|
||||
fi
|
||||
}
|
||||
|
||||
#run main driver program
|
||||
main
|
Loading…
Reference in New Issue