hyprlock: hide playerctl errors

This commit is contained in:
2 * r + 2 * t 2025-04-11 12:01:22 +10:00
parent 636d94daf5
commit 18b1c11ee5

View file

@ -5,7 +5,7 @@ $cpu_temps = cat /sys/class/thermal/thermal_zone*/temp
$get_cpu_temp = fish -c 'math -s 1 \( ($cpu_temps | string join +) \) / ($cpu_temps | wc -l) / 1000'
$get_cpu_load = top -bn1 | grep 'Cpu(s)' | sed 's/.*, *\([0-9.]*\)%* id.*/\1/' | awk '{print 100 - $1}'
$has_media = playerctl status > /dev/null
$has_media = playerctl status &> /dev/null
$print_media = printf '%s: %s\nBy: %s' "$($player_cmd status)" "$($metadata_cmd xesam:title)" "$($metadata_cmd xesam:artist)"
$get_media = $has_media && $print_media || printf 'No media playing\nTry playing something!'