feat: differentiate between laptop and desktop

This commit is contained in:
Fabio Lenherr 2023-01-03 09:20:42 +01:00
parent 3a59d32f55
commit 5bb44594bb
50 changed files with 3432 additions and 1 deletions

35
eww_laptop/scripts/change-audio Executable file
View file

@ -0,0 +1,35 @@
#! /bin/bash
internal() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false
notify-send "changed audio to internal speakers "
else
notify-send "failed, not available!"
fi
}
bluetooth() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false
notify-send "changed audio to Bluetooth"
else
notify-send "failed, not available!"
fi
}
if [ "$1" == "internal" ]; then
internal
elif [ "$1" == "bluetooth" ]; then
bluetooth
else
SPEAKER=$(pactl info | grep "Default Sink" | awk -F ': ' ' { print $2 } ')
pactl set-sink-mute "$SPEAKER" false
fi