ansible: sync templates with live system state
- 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
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#!/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}}"
|
||||
Reference in New Issue
Block a user