Skip to content

Commit

Permalink
🔧 do-not-disturb: match apps by sink's media.name
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianmiranda committed Jan 24, 2024
1 parent f0464e7 commit 95f2d80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions home/bin/do-not-disturb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

MODE=$1 # on/off

#
# $ pactl list sink-inputs
#
# ... application.name =
# ... device.description =
# ... media.name =
#

APPS=(
"element"
"telegram-desktop"
"whatsapp-for-linux"
)
Expand Down
2 changes: 1 addition & 1 deletion home/bin/toggle-app-audio
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

APP_NAME=$1
ACTION=$2
SINK_INPUTS=$(pactl list sink-inputs | grep -i -E -B 20 "(application.name = \"$APP_NAME\"|device.description = \"$APP_NAME\")" | grep "Sink Input #" | awk '{print $3}' | sed 's/#//g')
SINK_INPUTS=$(pactl list sink-inputs | grep -i -E -B 40 "(application.name = \"$APP_NAME\"|device.description = \"$APP_NAME\"|media.name = \"$APP_NAME)" | grep "Sink Input #" | awk '{print $3}' | sed 's/#//g')

for SINK in $SINK_INPUTS; do
MUTE_STATUS=0
Expand Down

0 comments on commit 95f2d80

Please sign in to comment.