initial commit

This commit is contained in:
2024-04-06 19:31:51 -05:00
commit 8ff9cb0e98
32 changed files with 1229 additions and 0 deletions

145
waybar/config.jsonc Normal file
View File

@ -0,0 +1,145 @@
// __ __ ___.
// / \ / \_____ ___.__.\_ |__ _____ _______
// \ \/\/ /\__ \< | | | __ \\__ \\_ __ \
// \ / / __ \\___ | | \_\ \/ __ \| | \/
// \__/\ / (____ / ____| |___ (____ /__|
// \/ \/\/ \/ \/
//
// https://github.com/Alexays/Waybar/wiki
// Configuration by Coby Powers
{
"layer": "top",
"position": "top",
"height": 50,
"modules-left": ["custom/app-drawer", "hyprland/workspaces", "cpu", "disk", "memory", "custom/weather"],
"modules-center": ["clock", "custom/updates"],
"modules-right": ["temperature", "custom/power_profile", "battery", "pulseaudio", "pulseaudio#microphone", "tray"],
"custom/app-drawer": {
"format": "",
"on-click": "sleep 0.1 && wofi",
"tooltip": false
},
"hyprland/workspaces": {
"persistent-workspaces": {
"1": [],
"2": [],
"3": []
}
},
"cpu": {
"format": " {usage}%",
//"format": "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}",
"format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"],
//"tooltip-format": "CPU Usage\n{usage}% | {load}\n{avg_frequency} GHz\n\n{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}\n{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}",
"tooltip-format": "bruh",
"on-click": "alacritty -o 'window.startup_mode=\"Fullscreen\"' -e btop"
},
"disk": {
"format": "󰋊 {percentage_used}%",
"tooltip-format": "Disk Usage\n\nFree: {percentage_free}%\nUsed: {percentage_used}%\nTotal: {total}",
"on-click": "alacritty -o 'window.startup_mode=\"Fullscreen\"' -e btop"
},
"memory": {
"format": " {percentage}%",
"tooltip-format": "Memory Usage\n\nFree: {avail} GiB\nUsed: {used} GiB\nTotal: {total} GiB",
"on-click": "alacritty -o 'window.startup_mode=\"Fullscreen\"' -e btop"
},
"custom/weather":{
"exec": "~/.config/waybar/scripts/weather.py",
"interval": 30,
"format": "{}",
"return-type": "json"
},
"clock": {
"format": "{:%I:%M %p • %D}",
"tooltip-format": "<big>{:%A, %b %d}</big>\n<tt>{calendar}</tt>",
"calendar": {
"format": {
"months": "",
"weekdays": "<span color='#89b4fa'><b><u>{}</u></b></span>",
"today": "<span color='#89b4fa'><b><u>{}</u></b></span>"
}
}
},
"custom/updates":{
"exec": "~/.config/waybar/scripts/updates.sh json",
"interval": 300,
"format": "{}",
"on-click": "~/.config/waybar/scripts/updates.sh update",
"return-type": "json"
},
"temperature": {
"thermal-zone": 0,
"critical-threshold": 75,
"format": " {temperatureC}°C",
"format-critical": " {temperatureC}°C",
"tooltip-format": "CPU Temp\n{temperatureC}°C | {temperatureF}°F"
},
"custom/power_profile":{
"exec": "asusctl profile -p | sed s:'Active profile is '::",
"interval": 30,
"format": "󰈐 {}",
"tooltip-format": "CPU Mode\n{}",
"on-click": "asusctl profile -n; pkill -SIGRTMIN+8 waybar",
"signal": 8
},
"battery": {
"states": {
"ok": 50,
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}%",
"format-charging": " {capacity}%",
"format-plugged": " {capacity}%",
"format-icons": ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"],
"tooltip-format": "Battery\n{capacity}% | {power} W\n\n{timeTo}"
},
"pulseaudio": {
"format": "{icon} {volume}%",
"tooltip-format": "{icon} {desc}",
"format-muted": " Muted",
"on-click": "pamixer -t",
"on-scroll-up": "pamixer -i 5",
"on-scroll-down": "pamixer -d 5",
"scroll-step": 5,
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
}
},
"pulseaudio#microphone": {
"format": "{format_source}",
"format-source": " {volume}%",
"format-source-muted": " Muted",
"tooltip-format": " {desc}",
"on-click": "pamixer --default-source -t",
"on-scroll-up": "pamixer --default-source -i 5",
"on-scroll-down": "pamixer --default-source -d 5",
"scroll-step": 5
},
"tray": {
"icon-size": 14,
"spacing": 10
}
}

27
waybar/scripts/updates.sh Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
if [ ! -f /etc/arch-release ]; then
exit 0
fi
AUR=$(paru -Qua | wc -l)
OFFICIAL=$(checkupdates | wc -l)
case $1 in
aur) echo "$AUR";;
official) echo "$OFFICIAL";;
esac
if [ "$1" = "update" ]; then
alacritty -o 'window.startup_mode="Fullscreen"' -e 'paru'
fi
if [ "$1" = "json" ]; then
COUNT=$((OFFICIAL+AUR))
echo "{ \"text\": \" $COUNT\", \"alt\": \"$COUNT Updates\", \"tooltip\": \"Updates Available\n\nAUR: $AUR\nOfficial: $OFFICIAL\nTotal: $COUNT\" }"
fi
if [ "$1" = "" ]; then
echo "$((OFFICIAL+AUR))"
fi

115
waybar/scripts/weather.py Executable file
View File

@ -0,0 +1,115 @@
#!/usr/bin/env python
import json
import requests
from datetime import datetime
ZIP_CODE = 38654
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(f"https://wttr.in/{ZIP_CODE}?format=j1").json()
def format_time(time):
return time.replace("00", "").zfill(2)
def format_temp(temp):
return (hour['FeelsLikeF']+"°").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]['FeelsLikeF'])
extrachar = ''
if tempint > 0 and tempint < 10:
extrachar = '+'
data['text'] = ''+WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \
" "+extrachar+weather['current_condition'][0]['FeelsLikeF']+"°"
data['tooltip'] = f"<b>{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_F']}°</b>\n"
data['tooltip'] += f"Feels like: {weather['current_condition'][0]['FeelsLikeF']}°\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['FeelsLikeF'])} {hour['weatherDesc'][0]['value'].replace('Clear ', 'Clear')}, {format_chances(hour)}\n"
print(json.dumps(data))

175
waybar/style.css Normal file
View File

@ -0,0 +1,175 @@
* {
border: none;
border-radius: 0;
font-family: "JetBrainsMono Nerd Font";
font-weight: bold;
font-size: 13px;
}
window#waybar {
background: transparent;
color: #cdd6f4;
}
tooltip {
background: #1e1e2e;
border-radius: 10px;
border: 1px solid #181825;
}
tooltip label {
color: #cdd6f4;
text-decoration: none;
}
tooltip > * {
border-radius: 10px;
}
#custom-app-drawer,
#cpu,
#disk,
#memory,
#custom-weather,
#workspaces,
#clock,
#custom-updates,
#window,
#temperature,
#custom-power_profile,
#battery,
#pulseaudio,
#tray {
background: #1e1e2e;
opacity: 0.9;
padding: 0px 10px;
margin-top: 10px;
border: 1px solid #181825;
}
#custom-app-drawer {
color: #94e2d5;
margin-left: 10px;
padding: 0 15px;
border-radius: 10px 0 0 10px;
}
#workspaces {
margin-right: 10px;
padding-right: 5px;
border-radius: 0 10px 10px 0;
border-left: 0;
}
#cpu,
#disk,
#memory {
color: #f2cdcd;
}
#cpu {
border-radius: 10px 0 0 10px;
}
#disk {
border-left: 0;
}
#memory {
border-left: none;
border-radius: 0 10px 10px 0;
margin-right: 10px;
}
#custom-weather {
color: #f9e2af;
border-radius: 10px;
}
#workspaces button {
color: #6c7086;
padding: 5px;
margin-right: 5px;
}
#workspaces button.active {
color: #a6adc8;
}
#workspaces button.focused {
color: #a6adc8;
background: #eba0ac;
}
#workspaces button.urgent {
color: #11111b;
background: #a6e3a1;
}
#workspaces button:hover {
background: #11111b;
color: #cdd6f4;
}
#clock {
color: #89b4fa;
border-radius: 10px 0 0 10px;
margin-left: 60px;
}
#custom-updates {
border-left: 0;
border-radius: 0 10px 10px 0;
margin-right: 60px;
}
#temperature {
color: #94e2d5;
border-radius: 10px 0px 0px 10px;
}
#temperature.critical {
color: #eba0ac;
}
#custom-power_profile {
color: #a6e3a1;
border-left: 0px;
border-right: 0px;
}
#battery {
color: #a6e3a1;
border-radius: 0 10px 10px 0;
margin-right: 10px;
border-left: 0px;
}
#battery.ok {
color: #f9e2af;
}
#battery.warning {
color: #fab387;
}
#battery.critical {
color: #eba0ac;
}
#pulseaudio {
color: #cba6f7;
border-radius: 10px 0 0 10px;
}
#pulseaudio.microphone {
color: #cba6f7;
border-radius: 0 10px 10px 0;
border-left: none;
margin-right: 10px;
}
#tray {
border-radius: 10px;
margin-right: 10px;
}