Fixed `pactl` parsing issues when using a different system language

master
Meliurwen 2 years ago
parent 6195f08b8a
commit b20497008d
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 8
      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() {

Loading…
Cancel
Save