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:
2026-10-17 16:14:41 +02:00
parent c17d46dea1
commit bf31806ab7
5 changed files with 19 additions and 19 deletions

View File

@@ -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"

View File

@@ -1,9 +0,0 @@
// Values obtained from: http://en.wikipedia.org/wiki/Grayscale#Luma_coding_in_video_systems
vec3 LumaFactors = vec3(0.299, 0.587, 0.114);
void windowShader(inout vec4 color) {
// Desaturate to luma only
float luma = dot(vec3(color.r, color.g, color.b), LumaFactors);
color.rgb = vec3(luma, luma, luma);
}