diff options
-rwxr-xr-x | .scripts/waybar-wttr.py | 119 | ||||
-rw-r--r-- | .shells/alias.sh | 44 | ||||
-rw-r--r-- | .shells/exports.sh | 27 |
3 files changed, 0 insertions, 190 deletions
diff --git a/.scripts/waybar-wttr.py b/.scripts/waybar-wttr.py deleted file mode 100755 index 08b49a6..0000000 --- a/.scripts/waybar-wttr.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env python - -import json -import requests -from datetime import datetime - -WEATHER_CODES = { - '113': '☀️ ', - '116': '⛅ ', - '119': '☁️ ', - '122': '☁️ ', - '143': '☁️ ', - '176': '🌧️', - '179': '🌧️', - '182': '🌧️', - '185': '🌧️', - '200': '⛈️ ', - '227': '🌨️', - '230': '🌨️', - '248': '☁️ ', - '260': '☁️ ', - '263': '🌧️', - '266': '🌧️', - '281': '🌧️', - '284': '🌧️', - '293': '🌧️', - '296': '🌧️', - '299': '🌧️', - '302': '🌧️', - '305': '🌧️', - '308': '🌧️', - '311': '🌧️', - '314': '🌧️', - '317': '🌧️', - '320': '🌨️', - '323': '🌨️', - '326': '🌨️', - '329': '❄️ ', - '332': '❄️ ', - '335': '❄️ ', - '338': '❄️ ', - '350': '🌧️', - '353': '🌧️', - '356': '🌧️', - '359': '🌧️', - '362': '🌧️', - '365': '🌧️', - '368': '🌧️', - '371': '❄️', - '374': '🌨️', - '377': '🌨️', - '386': '🌨️', - '389': '🌨️', - '392': '🌧️', - '395': '❄️ ' -} - -data = {} - - -weather = requests.get("https://wttr.in/?format=j1").json() - - -def format_time(time): - return time.replace("00", "").zfill(2) - - -def format_temp(temp): - return (hour['FeelsLikeC']+"°").ljust(3) - - -def format_chances(hour): - chances = { - "chanceoffog": "Fog", - "chanceoffrost": "Frost", - "chanceofovercast": "Overcast", - "chanceofrain": "Rain", - "chanceofsnow": "Snow", - "chanceofsunshine": "Sunshine", - "chanceofthunder": "Thunder", - "chanceofwindy": "Wind" - } - - conditions = [] - for event in chances.keys(): - if int(hour[event]) > 0: - conditions.append(chances[event]+" "+hour[event]+"%") - return ", ".join(conditions) - -tempint = int(weather['current_condition'][0]['FeelsLikeC']) -extrachar = '' -if tempint > 0 and tempint < 10: - extrachar = '+' - - -data['text'] = ' '+WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \ - " "+extrachar+weather['current_condition'][0]['FeelsLikeC']+"°" - -data['tooltip'] = f"<b>{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}°</b>\n" -data['tooltip'] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}°\n" -data['tooltip'] += f"Wind: {weather['current_condition'][0]['windspeedKmph']}Km/h\n" -data['tooltip'] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n" -for i, day in enumerate(weather['weather']): - data['tooltip'] += f"\n<b>" - if i == 0: - data['tooltip'] += "Today, " - if i == 1: - data['tooltip'] += "Tomorrow, " - data['tooltip'] += f"{day['date']}</b>\n" - data['tooltip'] += f"⬆️ {day['maxtempF']}° ⬇️ {day['mintempF']}° " - data['tooltip'] += f"🌅 {day['astronomy'][0]['sunrise']} 🌇 {day['astronomy'][0]['sunset']}\n" - for hour in day['hourly']: - if i == 0: - if int(format_time(hour['time'])) < datetime.now().hour-2: - continue - data['tooltip'] += f"{format_time(hour['time'])} {WEATHER_CODES[hour['weatherCode']]} {format_temp(hour['FeelsLikeC'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n" - - -print(json.dumps(data)) diff --git a/.shells/alias.sh b/.shells/alias.sh deleted file mode 100644 index a7ace2e..0000000 --- a/.shells/alias.sh +++ /dev/null @@ -1,44 +0,0 @@ -alias grep='grep --color=auto' -alias anki='QTWEBENGINE_CHROMIUM_FLAGS="--disable-seccomp-filter-sandbox" anki' - -alias o="emacsclient -n" -alias clear='printf "\033c"' - -#git -alias ga='git add' -alias gaa='git add .' -alias gc='git commit -m' -alias gp='git push -u origin' -alias gpm='git push -u origin master' -alias gpd='git push -u origin developer' -alias gs='git status' -alias cpm='config push -u origin master' -alias ca='config add' -alias cs='config status' -alias cc='config commit -m' - -#pacman | yay -alias yeet='paru -Rsc' - -# weather -alias weather="curl wttr.in" - -alias ls='ls --color' -alias ll='ls -la --color' -alias sb='sudo systemctl start bluetooth' -alias mykeys='setxkbmap -option caps:escape' -alias logout='pkill -U $USER' -#alias neofetch='neofetch | lolcat' -alias b='bluetoothctl' -alias ba='bluetooth-autoconnect' -alias music='mocp' -alias ytd="yt-dlp" -alias c="pavucontrol" -alias r="ranger" -alias klight="brightnessctl --device='tpacpi::kbd_backlight' set 1" - -##yarn -alias sweb='BROWSER="firefox" yarn start' - -##flatpaks -alias fanki='flatpak run net.ankiweb.Anki' diff --git a/.shells/exports.sh b/.shells/exports.sh deleted file mode 100644 index aaf0f7d..0000000 --- a/.shells/exports.sh +++ /dev/null @@ -1,27 +0,0 @@ -# Export 'SHELL' to child processes. Programs such as 'screen' -# honor it and otherwise use /bin/sh. -export SHELL -export PATH -export PATH=/home/$USER/.local/bin:$PATH -export EDITOR="emacsclient" -export GIT_EDITOR="emacsclient" -export SBCL_HOME="/usr/lib/sbcl/" -export PATH=$PATH:~/.roswell/bin -export SBCL_HOME=/usr/local/lib/sbcl -export XDG_SESSION_TYPE=x11 -export OLLAMA_HOST=zeus:11434 - -## Python -export PYENV_ROOT="$HOME/.pyenv" -export PATH="$PYENV_ROOT/bin:$PATH" - -if [[ $- != *i* ]] -then - # We are being invoked from a non-interactive shell. If this - # is an SSH session (as in "ssh host command"), source - # /etc/profile so we get PATH and other essential variables. - [[ -n "$SSH_CLIENT" ]] && source /etc/profile - - # Don't do anything else. - return -fi |