Skip to content

Commit f97aeb5

Browse files
committed
mic loopback script
1 parent bef2de8 commit f97aeb5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

home/sway.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@
9999
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
100100
"XF86Macro1" = "exec ${pkgs.playerctl}/bin/playerctl next";
101101
"shift+XF86Macro1" = "exec ${pkgs.playerctl}/bin/playerctl previous";
102+
"${modifier}+m" = "exec ${(pkgs.writeShellScript "toggle-mic-monitor" ''
103+
MODULE_ID=$(pactl list modules short | grep "module-loopback" | awk '{print $1}')
104+
if [ -n "$MODULE_ID" ]; then
105+
pactl unload-module "$MODULE_ID"
106+
notify-send "Transparency Mode" "OFF"
107+
else
108+
pactl load-module module-loopback latency_msec=2
109+
notify-send "Transparency Mode" "ON"
110+
fi
111+
'')}";
102112
"${modifier}+shift+v" = "exec ${(pkgs.writeShellScript "play-youtube-pinned" ''
103113
url=$(${pkgs.wl-clipboard}/bin/wl-paste --no-newline)
104114
if echo "$url" | ${pkgs.gnugrep}/bin/grep -qE 'https?://(www\.)?(youtube\.com/watch\?v=|youtu\.be/)'; then

0 commit comments

Comments
 (0)