- hyprland: add pulseaudio + custom/gpu modules to waybar - hyprland: template hyprlauncher.conf - hyprland: add keybinding updates (yazi, chrome, screenshots, reload) - hyprland: add uwsm package, replace wofi with hyprlauncher - hyprland: add waybar GPU monitoring script - greetd: update tuigreet command to uwsm start - vars: add uwsm, hyprlauncher; remove wofi; add screenshot tools
22 lines
612 B
Django/Jinja
22 lines
612 B
Django/Jinja
#!/usr/bin/env bash
|
|
# Waybar GPU usage module - NVIDIA
|
|
set -euo pipefail
|
|
|
|
GPU=$(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits 2>/dev/null | head -1 | tr -d ' ')
|
|
TEMP=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits 2>/dev/null | head -1 | tr -d ' ')
|
|
|
|
if [ -z "$GPU" ]; then
|
|
echo '{"text": "GPU N/A", "percentage": 0}'
|
|
exit 0
|
|
fi
|
|
|
|
if [ "$GPU" -ge 80 ]; then
|
|
ICON=""
|
|
elif [ "$GPU" -ge 50 ]; then
|
|
ICON=""
|
|
else
|
|
ICON=""
|
|
fi
|
|
|
|
echo "{\"text\": \"${ICON} ${GPU}%\", \"tooltip\": \"GPU Usage: ${GPU}% | Temp: ${TEMP}°C\", \"percentage\": ${GPU}}"
|