From 3e4cda0212d9262c8583af101d4b7b4f37a9652a Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Fri, 4 Mar 2022 22:04:41 -0300 Subject: [PATCH] Update volume block --- blocks.def/volume.sh | 10 ++++++++++ blocks.def/volume_button.sh | 2 ++ 2 files changed, 12 insertions(+) diff --git a/blocks.def/volume.sh b/blocks.def/volume.sh index db9a2c1..31571db 100755 --- a/blocks.def/volume.sh +++ b/blocks.def/volume.sh @@ -14,6 +14,11 @@ SINKHDMI=alsa_output.pci-0000_01_00.1.hdmi-stereo SINKANALOG=alsa_output.pci-0000_00_1b.0.analog-stereo checkDefaultSink() { + if [ -v LAPTOP ]; then + SINK=$SINKANALOG + return + fi + PACTLOUTPUT=`pactl info` if echo $PACTLOUTPUT | grep -q "$SINKANALOG"; then @@ -42,6 +47,11 @@ getIcon() { fi fi + if [ -v LAPTOP ]; then + printf "$ICON %s" "$VOLUME%" + return + fi + if [ "$SINK" = "$SINKHDMI" ]; then printf "$ICON %s" "$VOLUME%" elif [ "$SINK" = "$SINKANALOG" ]; then diff --git a/blocks.def/volume_button.sh b/blocks.def/volume_button.sh index 49d535e..d49ff28 100755 --- a/blocks.def/volume_button.sh +++ b/blocks.def/volume_button.sh @@ -15,6 +15,8 @@ checkDefaultSink() { } changeDefaultSink() { + [ -v LAPTOP ] && return + if [ "$SINK" = "$SINKANALOG" ]; then pactl set-default-sink $SINKHDMI elif [ "$SINK" = "$SINKHDMI" ]; then