ft: mute_active overhaul
no longer toggles grey shader, just makes the border grey + fixed mute_active dunst notif + keybinds
This commit is contained in:
@@ -41,14 +41,26 @@ esac
|
||||
|
||||
sinks=$(pactl -f json list sink-inputs)
|
||||
binary=$(ps -q "$activePid" -o comm=)
|
||||
windowName="$binary"
|
||||
|
||||
mutableSinks=$(printf "%s" "$sinks" | jq -r ".[] | select(.properties.\"application.process.id\" == \"$activePid\") | .index")
|
||||
|
||||
# fallbacks
|
||||
[[ -z "$mutableSinks" ]] && mutableSinks=$(printf "%s" "$sinks" | jq -r ".[] | select(.properties.\"application.process.binary\" == \"$binary\") | .index") # Feishin
|
||||
[[ -z "$mutableSinks" ]] && mutableSinks=$(printf "%s" "$sinks" | jq -r ".[] | select(.properties.\"application.id\" == \"$binary\") | .index") # mpv
|
||||
[[ -z "$mutableSinks" && "$class" = \"tf_linux64\" ]] && mutableSinks=$(printf "%s" "$sinks" | jq -r ".[] | select(.properties.\"application.name\" == \"tf_linux64\" ) .index") # tf2
|
||||
|
||||
if [[ -z "$mutableSinks" ]]; then
|
||||
# feishin
|
||||
mutableSinks=$(printf "%s" "$sinks" | jq -r ".[] | select(.properties.\"application.process.binary\" == \"$binary\") | .index")
|
||||
windowName="Feishin"
|
||||
fi
|
||||
if [[ -z "$mutableSinks" ]]; then
|
||||
# mpv
|
||||
mutableSinks=$(printf "%s" "$sinks" | jq -r ".[] | select(.properties.\"application.id\" == \"$binary\") | .index")
|
||||
windowName="Mpv"
|
||||
fi
|
||||
if [[ -z "$mutableSinks" && "$class" = \"tf_linux64\" ]]; then
|
||||
# tf2
|
||||
mutableSinks=$(printf "%s" "$sinks" | jq -r ".[] | select(.properties.\"application.name\" == \"tf_linux64\" ) .index")
|
||||
windowName="TF2"
|
||||
fi
|
||||
|
||||
|
||||
if [[ -z "$mutableSinks" ]]; then
|
||||
@@ -66,7 +78,7 @@ else
|
||||
-a Mute \
|
||||
-r 35 \
|
||||
-i ~/.icons/candy-icons/apps/scalable/yast-sound.svg \
|
||||
"Toggled mute on active window"
|
||||
"Toggled mute on active window ($windowName)"
|
||||
fi
|
||||
|
||||
toggle_multiple "$mutableSinks"
|
||||
|
||||
Reference in New Issue
Block a user