moonarch/defaults/bin/moonarch-waybar-cpugov
nevaforget d5c1b8a155
All checks were successful
Update PKGBUILD version / update-pkgver (push) Successful in 2s
fix: audit LOW fixes — nmcli guards, sink cancel, cpugov stderr, gpu interval
- moonarch-vpn: add `--` argument-terminator to `nmcli connection up/down`
  so a profile name starting with `-` is never interpreted as a flag.
- moonarch-sink-switcher: guard against empty `$sink` when walker is
  cancelled, since awk masks walker's non-zero exit. Prevents the error
  `pactl set-default-sink ""` on every dismissal.
- moonarch-waybar-cpugov: redirect stderr so non-cpufreq systems (VMs,
  some desktops) do not spam the journal on every 60s poll.
- waybar config: switch custom/gpu-usage from `restart-interval: 10` to
  `interval: 60`. The module lives in a closed drawer, a 10 s poll spawn
  was unnecessary background noise.
2026-04-24 13:59:20 +02:00

42 lines
841 B
Bash
Executable File

#!/usr/bin/bash
# ABOUTME: Waybar-Modul das den CPU-Governor als JSON ausgibt.
# ABOUTME: Wird von der Waybar custom/cpugov Config referenziert.
CPU_GOV=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null)
case $CPU_GOV in
performance)
CPU_GOV_SHORT=󰓅
;;
balanced)
CPU_GOV_SHORT=󰾅
;;
powersave)
CPU_GOV_SHORT=󰌪
;;
userspace)
CPU_GOV_SHORT=uspace
;;
ondemand)
CPU_GOV_SHORT=ondmnd
;;
conservative)
CPU_GOV_SHORT=cons
;;
schedutil)
CPU_GOV_SHORT=sutil
;;
*)
CPU_GOV_SHORT="?"
;;
esac
CPU_GOV_FULL="${CPU_GOV^}"
jq --compact-output -n \
--arg text "$CPU_GOV_SHORT" \
--arg alt "$CPU_GOV_FULL" \
--arg tooltip "CPU Mode: $CPU_GOV_FULL" \
--arg class "cpugov" \
'{text: $text, alt: $alt, tooltip: $tooltip, class: $class}'