From 3b692f46807f1af6921b8efaf5f792ec0eeafb74 Mon Sep 17 00:00:00 2001 From: Rentib Date: Tue, 9 Aug 2022 11:42:18 +0200 Subject: [PATCH] shortened sb-volume code --- .local/bin/statusbar/sb-volume | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index 3cfdc457..de1d8e21 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -17,14 +17,11 @@ esac vol="$(pamixer --get-volume)" -if [ "$vol" -gt "70" ]; then - icon="🔊" -elif [ "$vol" -gt "30" ]; then - icon="🔉" -elif [ "$vol" -gt "0" ]; then - icon="🔈" +icons=("🔈" "🔉" "🔊") +if [ "$vol" -gt "0" ]; then + icon=${icons[((vol / 33))]} else - echo 🔇 && exit + echo 🔇 && exit fi echo "$icon$vol%"