pointfichiers/bar/waybar/scripts/gpu_status.sh

17 lines
343 B
Bash
Raw Normal View History

2023-11-14 15:58:32 +01:00
#!/bin/bash
ACTIVE_ICON='󰍹'
SUSPENDED_ICON='󰶐'
RESUMING_ICON='󱄄'
icon=$ACTIVE_ICON
status=$(cat /sys/bus/pci/devices/0000:01:00.0/power/runtime_status)
if [ "$status" == "suspended" ]; then
icon=$SUSPENDED_ICON
elif [ "$status" == "resuming" ]; then
icon=$RESUMING_ICON
fi
echo "{\"text\": \"$icon\", \"class\": \"$status\"}"