From 6e77d5a081004fb9fe0d47950bd031119c29e9c2 Mon Sep 17 00:00:00 2001 From: ene Date: Sat, 4 Mar 2023 15:00:11 +0100 Subject: Feat(hm/config/yambar): Update the scripts and better paths --- .../config/yambar/scripts/old/amixer-monitor | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 home-manager/config/yambar/scripts/old/amixer-monitor (limited to 'home-manager/config/yambar/scripts/old/amixer-monitor') diff --git a/home-manager/config/yambar/scripts/old/amixer-monitor b/home-manager/config/yambar/scripts/old/amixer-monitor new file mode 100755 index 00000000..9e75acfa --- /dev/null +++ b/home-manager/config/yambar/scripts/old/amixer-monitor @@ -0,0 +1,24 @@ +#!/bin/sh +# An improved amixer script that actually detects volume beyond 100% + + +SLEEPTIME=1 + + +while true; do + + volume=$(pactl get-sink-volume 0 | awk 'BEGIN { FS="/"} {print $2 }' | tr -d "%" | tr -d ' ') + + if [ "$volume" -eq 0 ]; then + echo "muted|bool|true" + + else + # Read sink volume in percentages + echo "volume|string|$volume" + echo "muted|bool|false" + fi + + echo "" + sleep "$SLEEPTIME" + +done -- cgit 1.4.1