Various scripts that I maintain

new script: detect-gpu-issues

Signed-off-by: Shiloh Fen <shiloh@shilohfen.com>

matrixfurry.com 5d794a13 1fb313b5

verified
+27
+27
scripts/detect-gpu-issues.nu
··· 1 + #!/usr/bin/env nu 2 + # SPDX-License-Identifier: AGPL-3.0-only 3 + # Copyright (c) 2025 Shiloh Fen <shiloh@shilohfen.com> 4 + 5 + use std log 6 + 7 + # Detect & report problems with the GPU 8 + def main [] { 9 + if (vulkaninfo --summary 10 + | parse " deviceType{whitespace}= {device_type}" 11 + | where device_type == "PHYSICAL_DEVICE_TYPE_DISCRETE_GPU" 12 + | length) == 0 { 13 + report "Discrete GPU not found" 14 + } 15 + } 16 + 17 + def report [ 18 + message: string 19 + ] { 20 + log warning $"GPU Issue Detected: ($message)" 21 + job spawn { 22 + match (notify-send -u critical "GPU Issue Detected" $message -A reboot="Reboot") { 23 + reboot => (systemctl reboot) 24 + } 25 + } 26 + null 27 + }