feat: differentiate between laptop and desktop
This commit is contained in:
parent
3a59d32f55
commit
5bb44594bb
50 changed files with 3432 additions and 1 deletions
35
eww_laptop/scripts/change-audio
Executable file
35
eww_laptop/scripts/change-audio
Executable 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
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue