Customize waybar with Catppuccin Latte theme and niri modules
- Replace sway modules with niri/workspaces, niri/window, niri/language - Remove battery, backlight, mpd (desktop machine) - Add custom modules: GPU (nvidia-smi), weather (wttr.in), mail (Thunderbird) - Add disk, privacy modules - Catppuccin Latte colors with Mocha dark background - Wi-Fi signal level icon, bold 15px font - Scripts for GPU, weather, and mail monitoring Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
9
bazzite/waybar/scripts/gpu.sh
Normal file
9
bazzite/waybar/scripts/gpu.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
data=$(nvidia-smi --query-gpu=utilization.gpu,temperature.gpu --format=csv,noheader,nounits 2>/dev/null)
|
||||
if [ -z "$data" ]; then
|
||||
echo '{"text": "N/A", "tooltip": "nvidia-smi not available"}'
|
||||
exit 0
|
||||
fi
|
||||
usage=$(echo "$data" | cut -d',' -f1 | tr -d ' ')
|
||||
temp=$(echo "$data" | cut -d',' -f2 | tr -d ' ')
|
||||
echo "{\"text\": \"${usage}% ${temp}°C\", \"tooltip\": \"GPU: ${usage}%\\nTemp: ${temp}°C\", \"class\": \"\"}"
|
||||
45
bazzite/waybar/scripts/mail.py
Normal file
45
bazzite/waybar/scripts/mail.py
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python3
|
||||
import glob
|
||||
import json
|
||||
import sqlite3
|
||||
import os
|
||||
|
||||
profile_dirs = glob.glob(
|
||||
os.path.expanduser("~/.var/app/org.mozilla.Thunderbird/.thunderbird/*.default-esr")
|
||||
) or glob.glob(
|
||||
os.path.expanduser("~/.thunderbird/*.default-esr")
|
||||
)
|
||||
|
||||
if not profile_dirs:
|
||||
print(json.dumps({"text": "", "tooltip": "No Thunderbird profile found"}))
|
||||
exit()
|
||||
|
||||
db_path = os.path.join(profile_dirs[0], "global-messages-db.sqlite")
|
||||
if not os.path.exists(db_path):
|
||||
print(json.dumps({"text": "", "tooltip": "No message database"}))
|
||||
exit()
|
||||
|
||||
try:
|
||||
conn = sqlite3.connect(f"file:{db_path}?mode=ro&nolock=1", uri=True)
|
||||
cursor = conn.cursor()
|
||||
cursor.execute(
|
||||
"SELECT COUNT(*) FROM messages WHERE jsonAttributes LIKE '%\"read\":false%' OR jsonAttributes LIKE '%\"read\": false%'"
|
||||
)
|
||||
count = cursor.fetchone()[0]
|
||||
conn.close()
|
||||
except Exception:
|
||||
# fallback: try folderStatus
|
||||
try:
|
||||
conn = sqlite3.connect(f"file:{db_path}?mode=ro&nolock=1", uri=True)
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("SELECT SUM(numNewMessages) FROM folderlocations WHERE numNewMessages > 0")
|
||||
row = cursor.fetchone()
|
||||
count = row[0] if row and row[0] else 0
|
||||
conn.close()
|
||||
except Exception:
|
||||
count = 0
|
||||
|
||||
if count > 0:
|
||||
print(json.dumps({"text": f" {count}", "tooltip": f"{count} unread emails", "class": "unread"}))
|
||||
else:
|
||||
print(json.dumps({"text": "", "tooltip": "No unread emails"}))
|
||||
8
bazzite/waybar/scripts/weather.sh
Normal file
8
bazzite/waybar/scripts/weather.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
weather=$(curl -s "wttr.in/?format=%c%t" 2>/dev/null)
|
||||
if [ -z "$weather" ] || echo "$weather" | grep -q "Unknown"; then
|
||||
echo '{"text": "N/A", "tooltip": "Weather unavailable"}'
|
||||
exit 0
|
||||
fi
|
||||
tooltip=$(curl -s "wttr.in/?format=%l:+%C+%t+%w+%h" 2>/dev/null)
|
||||
echo "{\"text\": \"${weather}\", \"tooltip\": \"${tooltip}\"}"
|
||||
Reference in New Issue
Block a user