From 24739df294e3ee56ee9515568aeacdbf5aca51b6 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Sun, 3 May 2020 01:48:15 -0400 Subject: [PATCH] Update i3 colors, add discord settings and weather.sh RD --- .config/i3/config | 7 +++++- .local/bin/i3scripts/weather | 49 ++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100755 .local/bin/i3scripts/weather diff --git a/.config/i3/config b/.config/i3/config index a3fce77..43e13bb 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -215,6 +215,10 @@ for_window [class="Bitwarden"] resize set height 600 for_window [class="Bitwarden"] resize set width 800 for_window [class="Bitwarden"] move position center +for_window [class="discord"] floating enable +for_window [class="discord"] resize set height 600 +for_window [class="discord"] resize set width 800 +for_window [class="discord"] move position center for_window [class="Wicd-client.py"] floating enable for_window [class="Wicd-client.py"] resize set height 400 @@ -236,6 +240,7 @@ exec --no-startup-id sh ~/.fehbg exec --no-startup-id xautolock -time 10 -locker blurlock exec --no-startup-id wicd-client -t exec --no-startup-id xfce4-power-manager +exec --no-startup-id google-drive-ocamlfuse ~/gdrive # Application keybinds @@ -376,7 +381,7 @@ exec_always --no-startup-id compton # Theme colors # class border backgr. text indic. child_border - client.focused #01e110 #01e110 #80FFF9 #01e110 + client.focused #01e110 #01e110 #80FFF9 #FF0100 client.focused_inactive #2F3D44 #2F3D44 #1ABC9C #454948 client.unfocused #000000 #000000 #1ABC9C #000000 client.urgent #CB4B16 #FDF6E3 #1ABC9C #268BD2 diff --git a/.local/bin/i3scripts/weather b/.local/bin/i3scripts/weather new file mode 100755 index 0000000..92f78c5 --- /dev/null +++ b/.local/bin/i3scripts/weather @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +################################ +# Shows info about the weather (in Cincinnati) from accuweather.com +# +# TODO: completely rewrite, probably using openweather APIs +# TODO: make location configurable +# TODO: make temperature unit configurable +# +# @return {Number(degrees Fahrenheit)}: Current temperature in Cincinnati +################################ + +dir=$(dirname $0) +source $dir/util.sh + +full="" +short="" +status=0 + +URL='http://www.accuweather.com/en/us/cincinnati-oh/45212/weather-forecast/350126' +SITE="$(curl -s "$URL")" + +weather="$(echo "$SITE" | awk -F\' '/acm_RecentLocationsCarousel\.push/{print $13 }'| head -1)" +temp="$(echo "$SITE" | awk -F\' '/acm_RecentLocationsCarousel\.push/{print $10 }'| head -1)" + +if [[ $weather == *thunder* || $weather == *Thunder* ]]; then + icon="" +else + if [[ $weather == *rain* || $weather == *Rain* ]]; then + icon="" + else + if [[ $weather == *snow* || $weather == *Snow* ]]; then + icon="❄" + else + if [[ $weather == *cloud* || $weather == *Cloud* ]]; then + icon="" + else + icon="" + fi + fi + fi +fi + +full="$icon $temp°" +short="$temp°" + +echo $full +echo $short +exit $status