Files
.config
.emacs.d
.gkrellm2
.local
bin
Chatty
Checking-repo
Logc
Logs
Update
Update-kernel
backupSynology
backupSynologyMac
bin-cp
browser-x
chardetect
chatty-run
cleaner
cleanertmp
cmus-control
cmus-shell
cpumhz
debugger
dmenumount
dmenuumount
dmenuunicode
docker-start
dwmstatusbar
eix-repos-sync
epylint
euscan
ext
f2py
f2py3
f2py3.6
f2py3.7
f2py3.8
flask
futurize
gentoo-test
geoip
getforecast
gfetch
gfg
git-init-folder
haruhi-dl
iptables-restart
iptables-update
isort
jupyter
mailsync
minecraft-launcher
mouse-set
night
notify-program
password-manager
pasteurize
pwiz.py
pylint
pyreverse
rasp
rcon
record
remove-kernel
runJava
saver-off
sb-battery
sb-clock
sb-cpu
sb-mail
sb-mem
sb-music
sb-network
sb-temp
sb-volume
sb-weather
screen-switcher
screenshot
screenshot-area
set-wallpaper
shut-sup-rest
speedtest-cli
ssh-permissions
stream
suspend-at-time
symilar
tea
temp
term-wmi
tester-ebuild
tester-ubuntu
tmux-display-fix
trans
twitch
video-convert
volume
welcomer
welcomer-serwer
wheel
wsl-notify
wylaczoff
yatqa
yt-mp3
yt-video
.alacritty.yml
.gitignore
.markdownlint.json
.signature
.streamlinkrc
.tmux.conf
.vimrc-def
.wall.jpg
.xinitrc
.zshrc
myhome/.local/bin/sb-weather
Marcin Woźniak c18381a3c6 Added programs
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
2021-03-22 21:27:54 +01:00

8 lines
559 B
Bash
Executable File

#!/bin/bash
print_weather() {
[ "$(stat -c %y "/home/yorune/.config/weatherreport" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] && curl -s "wttr.in/$location" > "/home/yorune/.config/weatherreport"
printf "%s" "$(sed '16q;d' "/home/yorune/.config/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')" && sed '13q;d' "/home/yorune/.config/weatherreport" | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print" ❄",$1"°","☀",$2"°"}'
}
print_weather