fixes
This commit is contained in:
@@ -13,18 +13,17 @@
|
||||
"modules-right": [
|
||||
"privacy",
|
||||
"custom/mail",
|
||||
"idle_inhibitor",
|
||||
"custom/weather",
|
||||
"pulseaudio",
|
||||
"network",
|
||||
"niri/language",
|
||||
"power-profiles-daemon",
|
||||
"cpu",
|
||||
"memory",
|
||||
"temperature",
|
||||
"custom/gpu",
|
||||
"disk",
|
||||
"niri/language",
|
||||
"clock",
|
||||
"custom/calendar",
|
||||
"tray"
|
||||
],
|
||||
|
||||
@@ -34,11 +33,15 @@
|
||||
|
||||
"niri/window": {
|
||||
"format": "{}",
|
||||
"max-length": 50
|
||||
"max-length": 50,
|
||||
"align": 0.5,
|
||||
"justify": "center"
|
||||
},
|
||||
|
||||
"niri/language": {
|
||||
"format": "{short}"
|
||||
"format": "{short}",
|
||||
"align": 0.5,
|
||||
"justify": "center"
|
||||
},
|
||||
|
||||
"privacy": {
|
||||
@@ -53,20 +56,14 @@
|
||||
},
|
||||
|
||||
"custom/mail": {
|
||||
"format": "{}",
|
||||
"format": "<span font='Symbols Nerd Font Mono'>{}</span>",
|
||||
"return-type": "json",
|
||||
"exec": "python3 ~/.config/waybar/scripts/mail.py",
|
||||
"exec": "~/.config/waybar/scripts/mail",
|
||||
"interval": 60,
|
||||
"tooltip": true,
|
||||
"on-click": "flatpak run org.mozilla.Thunderbird"
|
||||
},
|
||||
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
}
|
||||
"on-click": "flatpak run org.mozilla.Thunderbird",
|
||||
"align": 0.5,
|
||||
"justify": "center"
|
||||
},
|
||||
|
||||
"custom/weather": {
|
||||
@@ -74,87 +71,109 @@
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/weather.sh",
|
||||
"interval": 900,
|
||||
"tooltip": true
|
||||
"tooltip": true,
|
||||
"align": 0.5,
|
||||
"justify": "center"
|
||||
},
|
||||
|
||||
"custom/gpu": {
|
||||
"format": " {}",
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/gpu.sh",
|
||||
"interval": 5,
|
||||
"tooltip": true
|
||||
"tooltip": true,
|
||||
"align": 0.5,
|
||||
"justify": "center"
|
||||
},
|
||||
|
||||
"disk": {
|
||||
"format": "{percentage_used}% ",
|
||||
"format": "<span font='Font Awesome 6 Free'></span> {percentage_used}%",
|
||||
"path": "/",
|
||||
"tooltip-format": "{used} / {total} ({percentage_used}%)"
|
||||
"tooltip-format": "{used} / {total} ({percentage_used}%)",
|
||||
"align": 0.5,
|
||||
"justify": "center"
|
||||
},
|
||||
|
||||
"tray": {
|
||||
"spacing": 10
|
||||
},
|
||||
|
||||
"clock": {
|
||||
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
|
||||
"format": "{:%H:%M}",
|
||||
"format-alt": "{:%Y-%m-%d}"
|
||||
"custom/calendar": {
|
||||
"format": "<span font='Font Awesome 6 Free'></span> {}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/khal-calendar",
|
||||
"interval": 30,
|
||||
"tooltip": true,
|
||||
"on-click": "alacritty --title khal-popup -e bash -c 'vdirsyncer sync 2>/dev/null; ikhal'",
|
||||
"align": 0.5,
|
||||
"justify": "center"
|
||||
},
|
||||
|
||||
"cpu": {
|
||||
"format": "{usage}% ",
|
||||
"tooltip": false
|
||||
"format": "<span font='Font Awesome 6 Free Solid'></span> {usage}%",
|
||||
"tooltip": false,
|
||||
"align": 0.5,
|
||||
"justify": "center"
|
||||
},
|
||||
|
||||
"memory": {
|
||||
"format": "{}% "
|
||||
"format": "<span font='Font Awesome 6 Free Solid'></span> {}%",
|
||||
"align": 0.5,
|
||||
"justify": "center"
|
||||
},
|
||||
|
||||
"temperature": {
|
||||
"critical-threshold": 80,
|
||||
"format": "{temperatureC}°C {icon}",
|
||||
"format-icons": ["", "", ""]
|
||||
"format": "<span font='Font Awesome 6 Free Solid'></span> {temperatureC}°C",
|
||||
"align": 0.5,
|
||||
"justify": "center"
|
||||
},
|
||||
|
||||
"network": {
|
||||
"format-wifi": "{icon}",
|
||||
"format-wifi": "<span font='Symbols Nerd Font Mono'>{icon}</span>",
|
||||
"format-ethernet": "",
|
||||
"format-icons": ["", "", "", "", ""],
|
||||
"tooltip-format-wifi": "{essid} ({signalStrength}%)\n{ipaddr}/{cidr}",
|
||||
"tooltip-format-ethernet": "{ifname}\n{ipaddr}/{cidr}",
|
||||
"format-linked": "{ifname} (No IP) ",
|
||||
"format-disconnected": "",
|
||||
"on-click": ""
|
||||
"format-disconnected": "<span font='Symbols Nerd Font Mono'></span>",
|
||||
"on-click": "",
|
||||
"align": 0.5,
|
||||
"justify": "center"
|
||||
},
|
||||
|
||||
"pulseaudio": {
|
||||
"format": "{volume}% {icon} {format_source}",
|
||||
"format-bluetooth": "{volume}% {icon} {format_source}",
|
||||
"format-bluetooth-muted": " {icon} {format_source}",
|
||||
"format-muted": " {format_source}",
|
||||
"format-source": "{volume}% ",
|
||||
"format-source-muted": "",
|
||||
"format": "<span font='Font Awesome 6 Free Solid'>{icon}</span> {volume}% <span font='Font Awesome 6 Free Solid'></span> {format_source}",
|
||||
"format-bluetooth": "<span font='Font Awesome 6 Free Solid'>{icon}</span> {volume}% <span font='Font Awesome 6 Brands'></span> <span font='Font Awesome 6 Free Solid'></span> {format_source}",
|
||||
"format-bluetooth-muted": "<span font='Font Awesome 6 Free Solid'></span> <span font='Font Awesome 6 Brands'></span> <span font='Font Awesome 6 Free Solid'></span> {format_source}",
|
||||
"format-muted": "<span font='Font Awesome 6 Free Solid'></span> <span font='Font Awesome 6 Free Solid'></span> {format_source}",
|
||||
"format-source": "{volume}%",
|
||||
"format-source-muted": "<span font='Font Awesome 6 Free Solid'></span>",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"hands-free": "",
|
||||
"headset": "",
|
||||
"phone": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"default": ["", "", ""]
|
||||
"headphone": "",
|
||||
"hands-free": "",
|
||||
"headset": "",
|
||||
"phone": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"default": ["", "", ""]
|
||||
},
|
||||
"on-click": "pavucontrol"
|
||||
"on-click": "pavucontrol",
|
||||
"align": 0.5,
|
||||
"justify": "center"
|
||||
},
|
||||
|
||||
"power-profiles-daemon": {
|
||||
"format": "{icon}",
|
||||
"format": "<span font='Font Awesome 6 Free Solid'>{icon}</span>",
|
||||
"tooltip-format": "Power profile: {profile}\nDriver: {driver}",
|
||||
"tooltip": true,
|
||||
"align": 0.5,
|
||||
"justify": "center",
|
||||
"format-icons": {
|
||||
"default": "",
|
||||
"performance": "",
|
||||
"balanced": "",
|
||||
"power-saver": ""
|
||||
"default": "",
|
||||
"performance": "",
|
||||
"balanced": "",
|
||||
"power-saver": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
4
bazzite/waybar/scripts/gpu.sh
Normal file → Executable file
4
bazzite/waybar/scripts/gpu.sh
Normal file → Executable file
@@ -1,9 +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"}'
|
||||
echo '{"text": "GPU 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\": \"\"}"
|
||||
echo "{\"text\": \"GPU ${usage}% ${temp}°C\", \"tooltip\": \"GPU: ${usage}%\\nTemp: ${temp}°C\", \"class\": \"\"}"
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/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"}))
|
||||
0
bazzite/waybar/scripts/weather.sh
Normal file → Executable file
0
bazzite/waybar/scripts/weather.sh
Normal file → Executable file
@@ -27,13 +27,13 @@
|
||||
@define-color crust #dce0e8;
|
||||
|
||||
* {
|
||||
font-family: 'JetBrainsMono Nerd Font', 'Noto Sans Mono', monospace;
|
||||
font-family: 'Noto Sans Mono', 'Symbols Nerd Font Mono', 'Symbols Nerd Font', 'Font Awesome 6 Free', monospace;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: #1e1e2e;
|
||||
background-color: rgba(30, 30, 46, 0.72);
|
||||
color: @text;
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
@@ -46,7 +46,7 @@ window#waybar.hidden {
|
||||
button {
|
||||
box-shadow: inset 0 -3px transparent;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
@@ -56,27 +56,30 @@ button:hover {
|
||||
|
||||
/* Workspaces */
|
||||
#workspaces button {
|
||||
padding: 0 6px;
|
||||
background-color: transparent;
|
||||
color: #a6adc8;
|
||||
min-height: 24px;
|
||||
padding: 4px 8px;
|
||||
background-color: #000000;
|
||||
color: @overlay2;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: alpha(@surface0, 0.5);
|
||||
background: #000000;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
color: #cdd6f4;
|
||||
color: @blue;
|
||||
box-shadow: inset 0 -2px @blue;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: alpha(@red, 0.2);
|
||||
color: @red;
|
||||
background-color: #000000;
|
||||
color: @base;
|
||||
}
|
||||
|
||||
/* Common module styling */
|
||||
#clock,
|
||||
#window,
|
||||
#custom-calendar,
|
||||
#cpu,
|
||||
#memory,
|
||||
#disk,
|
||||
@@ -85,27 +88,50 @@ button:hover {
|
||||
#pulseaudio,
|
||||
#wireplumber,
|
||||
#tray,
|
||||
#idle_inhibitor,
|
||||
#power-profiles-daemon,
|
||||
#language,
|
||||
#custom-gpu,
|
||||
#custom-weather,
|
||||
#privacy {
|
||||
padding: 0 10px;
|
||||
min-height: 24px;
|
||||
padding: 4px 8px;
|
||||
background-color: #000000;
|
||||
border-radius: 16px;
|
||||
color: @text;
|
||||
}
|
||||
|
||||
#workspaces button label,
|
||||
#window label,
|
||||
#custom-calendar label,
|
||||
#cpu label,
|
||||
#memory label,
|
||||
#disk label,
|
||||
#temperature label,
|
||||
#network label,
|
||||
#pulseaudio label,
|
||||
#wireplumber label,
|
||||
#tray label,
|
||||
#power-profiles-daemon label,
|
||||
#language label,
|
||||
#custom-gpu label,
|
||||
#custom-weather label,
|
||||
#privacy label {
|
||||
min-height: 24px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#window,
|
||||
#workspaces {
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
#window {
|
||||
color: #cdd6f4;
|
||||
color: @text;
|
||||
}
|
||||
|
||||
/* Clock */
|
||||
#clock {
|
||||
/* Calendar/Clock */
|
||||
#custom-calendar {
|
||||
color: @blue;
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -154,15 +180,6 @@ button:hover {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Idle inhibitor */
|
||||
#idle_inhibitor {
|
||||
color: @overlay1;
|
||||
}
|
||||
|
||||
#idle_inhibitor.activated {
|
||||
color: @peach;
|
||||
}
|
||||
|
||||
/* Power profiles */
|
||||
#power-profiles-daemon {
|
||||
color: @subtext0;
|
||||
@@ -206,24 +223,28 @@ button:hover {
|
||||
|
||||
/* Privacy */
|
||||
#privacy {
|
||||
background-color: transparent;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#privacy-item {
|
||||
padding: 0 5px;
|
||||
min-height: 24px;
|
||||
padding: 4px 8px;
|
||||
color: @base;
|
||||
background-color: #000000;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
#privacy-item.screenshare {
|
||||
background-color: @peach;
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
#privacy-item.audio-in {
|
||||
background-color: @red;
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
#privacy-item.audio-out {
|
||||
background-color: @blue;
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
/* Tray */
|
||||
|
||||
Reference in New Issue
Block a user