From b20497008dbd9929eba7afa300ecc713e326bd84 Mon Sep 17 00:00:00 2001 From: meliurwen Date: Thu, 11 Aug 2022 09:03:12 +0200 Subject: [PATCH] Fixed `pactl` parsing issues when using a different system language --- i3/.config/i3/scripts/dev-ctrl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i3/.config/i3/scripts/dev-ctrl b/i3/.config/i3/scripts/dev-ctrl index ae56ef5..6c87e91 100755 --- a/i3/.config/i3/scripts/dev-ctrl +++ b/i3/.config/i3/scripts/dev-ctrl @@ -12,21 +12,21 @@ # https://gist.github.com/sebastiencs/5d7227f388d93374cebdf72e783fbd6a get_volume() { - pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}' + LC_ALL=C pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}' } is_mute() { - pactl get-sink-mute @DEFAULT_SINK@ | grep yes > /dev/null + LC_ALL=C pactl get-sink-mute @DEFAULT_SINK@ | grep yes > /dev/null } is_mic_mute() { - pactl get-source-mute @DEFAULT_SOURCE@ | grep yes > /dev/null + LC_ALL=C pactl get-source-mute @DEFAULT_SOURCE@ | grep yes > /dev/null } get_brightness() { max_bright=$(cat /sys/class/backlight/intel_backlight/max_brightness) act_bright=$(cat /sys/class/backlight/intel_backlight/actual_brightness) - echo $(( (act_bright*100+(max_bright/2))/max_bright )) + printf "%s\n" "$(( (act_bright*100+(max_bright/2))/max_bright ))" } get_level_icon() {