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

@@ -30,8 +30,7 @@ in
(bind "${mainMod} + N" (exec "dunstctl close-all") "Clear dunst notifications") (bind "${mainMod} + N" (exec "dunstctl close-all") "Clear dunst notifications")
(bind "${mainMod} + SHIFT + N" (exec "~/.config/WMScripts/dunst.sh") "Toggle dunst notifications") (bind "${mainMod} + SHIFT + N" (exec "~/.config/WMScripts/dunst.sh") "Toggle dunst notifications")
(bind "CTRL + SHIFT + ESCAPE" (exec "~/.config/WMScripts/murder.sh") "Terminate a program") (bind "CTRL + SHIFT + ESCAPE" (exec "~/.config/WMScripts/murder.sh") "Terminate a program")
(bind "${mainMod} + CTRL + M" (exec "~/.config/WMScripts/mute_active.sh") "Toggle mute active window") (bind "${mainMod} + CTRL + M" (exec "~/.config/WMScripts/mute_active.sh muted") "Toggle mute active window")
(bind "${mainMod} + CTRL + SHIFT + M" (exec "~/.config/WMScripts/mute_active.sh muted") "Toggle mute active window and apply the 'muted' shader")
(bind "${mainMod} + M" (exec "~/.config/WMScripts/toggle_audiocables.sh combine") "Toggle hyperx audio output") (bind "${mainMod} + M" (exec "~/.config/WMScripts/toggle_audiocables.sh combine") "Toggle hyperx audio output")
(bind "${mainMod} + SHIFT + M" (exec "~/.config/WMScripts/toggle_audiocables.sh clementine") "Toggle clementine audio output") (bind "${mainMod} + SHIFT + M" (exec "~/.config/WMScripts/toggle_audiocables.sh clementine") "Toggle clementine audio output")
(bind "${mainMod} + Q" (exec "killall deadcells") "Murder Dead cells specifically") (bind "${mainMod} + Q" (exec "killall deadcells") "Murder Dead cells specifically")

View File

@@ -32,8 +32,6 @@ in
]; ];
window_rule = [ window_rule = [
{ match.tag = "shader/muted"; "darkwindow:shade" = "grey";}
{ match.tag = "muted"; "darkwindow:shade" = "grey";}
] ++ map (name: { match.tag = "shader/${name}"; "darkwindow:shade" = "${name}";}) shaders; ] ++ map (name: { match.tag = "shader/${name}"; "darkwindow:shade" = "${name}";}) shaders;
}; };

View File

@@ -68,7 +68,7 @@
{ match.class = ".*"; suppress_event = "maximize";} { match.class = ".*"; suppress_event = "maximize";}
# muted tag # muted tag
{ match.tag = "muted"; border_color = { colors = [ { match.tag = "shader/muted"; border_color = { colors = [
(lib.generators.mkLuaInline "colors.subtext0") # stupid hack to use catppuccin-nix colors (lib.generators.mkLuaInline "colors.subtext0") # stupid hack to use catppuccin-nix colors
(lib.generators.mkLuaInline "colors.subtext1") (lib.generators.mkLuaInline "colors.subtext1")
]; angle = 45;};} ]; angle = 45;};}

View File

@@ -41,14 +41,26 @@ esac
sinks=$(pactl -f json list sink-inputs) sinks=$(pactl -f json list sink-inputs)
binary=$(ps -q "$activePid" -o comm=) binary=$(ps -q "$activePid" -o comm=)
windowName="$binary"
mutableSinks=$(printf "%s" "$sinks" | jq -r ".[] | select(.properties.\"application.process.id\" == \"$activePid\") | .index") mutableSinks=$(printf "%s" "$sinks" | jq -r ".[] | select(.properties.\"application.process.id\" == \"$activePid\") | .index")
# fallbacks # fallbacks
[[ -z "$mutableSinks" ]] && mutableSinks=$(printf "%s" "$sinks" | jq -r ".[] | select(.properties.\"application.process.binary\" == \"$binary\") | .index") # Feishin if [[ -z "$mutableSinks" ]]; then
[[ -z "$mutableSinks" ]] && mutableSinks=$(printf "%s" "$sinks" | jq -r ".[] | select(.properties.\"application.id\" == \"$binary\") | .index") # mpv # feishin
[[ -z "$mutableSinks" && "$class" = \"tf_linux64\" ]] && mutableSinks=$(printf "%s" "$sinks" | jq -r ".[] | select(.properties.\"application.name\" == \"tf_linux64\" ) .index") # tf2 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 if [[ -z "$mutableSinks" ]]; then
@@ -66,7 +78,7 @@ else
-a Mute \ -a Mute \
-r 35 \ -r 35 \
-i ~/.icons/candy-icons/apps/scalable/yast-sound.svg \ -i ~/.icons/candy-icons/apps/scalable/yast-sound.svg \
"Toggled mute on active window" "Toggled mute on active window ($windowName)"
fi fi
toggle_multiple "$mutableSinks" 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);
}